aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-09-07 16:36:25 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-09-07 16:36:25 +1000
commit221c2f0fe81430e7dd4087e5f5845bd7c62ec56d (patch)
treed6e0faaef01b9d517828557e1be82500d476f95e /src/Java/gtPlusPlus
parent5872c0947ce7bc788b03fa2fb690b8815d3d0a04 (diff)
downloadGT5-Unofficial-221c2f0fe81430e7dd4087e5f5845bd7c62ec56d.tar.gz
GT5-Unofficial-221c2f0fe81430e7dd4087e5f5845bd7c62ec56d.tar.bz2
GT5-Unofficial-221c2f0fe81430e7dd4087e5f5845bd7c62ec56d.zip
% Refactored the entire project to stop using MiscUtils everywhere possible, now it's gtPlusPlus.
Diffstat (limited to 'src/Java/gtPlusPlus')
-rw-r--r--src/Java/gtPlusPlus/GTplusplus.java185
-rw-r--r--src/Java/gtPlusPlus/core/block/ModBlocks.java78
-rw-r--r--src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java31
-rw-r--r--src/Java/gtPlusPlus/core/block/base/BasicBlock.java52
-rw-r--r--src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java154
-rw-r--r--src/Java/gtPlusPlus/core/block/base/MetaBlock.java28
-rw-r--r--src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java36
-rw-r--r--src/Java/gtPlusPlus/core/block/general/LightGlass.java128
-rw-r--r--src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java276
-rw-r--r--src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java51
-rw-r--r--src/Java/gtPlusPlus/core/block/general/fluids/FluidRegistryHandler.java50
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java35
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java83
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java83
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java5
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java165
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java75
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/heliumgen/gui/GUIHeliumGenerator.java72
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/heliumgen/slots/InvSlotRadiation.java78
-rw-r--r--src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java648
-rw-r--r--src/Java/gtPlusPlus/core/commands/CommandMath.java205
-rw-r--r--src/Java/gtPlusPlus/core/commands/CommandUtils.java20
-rw-r--r--src/Java/gtPlusPlus/core/common/CommonProxy.java132
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java19
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java171
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java26
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java33
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_IC2.java62
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java37
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_PneumaticCraft.java17
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_RFTools.java18
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_SimplyJetpacks.java18
-rw-r--r--src/Java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java47
-rw-r--r--src/Java/gtPlusPlus/core/container/Container_BackpackBase.java206
-rw-r--r--src/Java/gtPlusPlus/core/container/Container_Charger.java81
-rw-r--r--src/Java/gtPlusPlus/core/container/Container_NHG.java104
-rw-r--r--src/Java/gtPlusPlus/core/creative/AddToCreativeTab.java31
-rw-r--r--src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java18
-rw-r--r--src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java19
-rw-r--r--src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java18
-rw-r--r--src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java18
-rw-r--r--src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java18
-rw-r--r--src/Java/gtPlusPlus/core/entity/EntityTeleportFX.java236
-rw-r--r--src/Java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java56
-rw-r--r--src/Java/gtPlusPlus/core/gui/beta/Gui_Types.java8
-rw-r--r--src/Java/gtPlusPlus/core/gui/beta/MU_GuiId.java32
-rw-r--r--src/Java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java122
-rw-r--r--src/Java/gtPlusPlus/core/gui/machine/GUI_Charger.java50
-rw-r--r--src/Java/gtPlusPlus/core/gui/machine/GUI_NHG.java50
-rw-r--r--src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java155
-rw-r--r--src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java41
-rw-r--r--src/Java/gtPlusPlus/core/handler/CraftingManager.java17
-rw-r--r--src/Java/gtPlusPlus/core/handler/GuiHandler.java128
-rw-r--r--src/Java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java28
-rw-r--r--src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java32
-rw-r--r--src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java84
-rw-r--r--src/Java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java71
-rw-r--r--src/Java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java138
-rw-r--r--src/Java/gtPlusPlus/core/interfaces/IGuiManager.java16
-rw-r--r--src/Java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java3
-rw-r--r--src/Java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java241
-rw-r--r--src/Java/gtPlusPlus/core/item/ModItems.java488
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemBackpack.java89
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemGeneric.java30
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemWithCharge.java75
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BaseItemWithDamageValue.java29
-rw-r--r--src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java259
-rw-r--r--src/Java/gtPlusPlus/core/item/base/CoreItem.java118
-rw-r--r--src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java82
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java352
-rw-r--r--src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java42
-rw-r--r--src/Java/gtPlusPlus/core/item/base/foods/BaseItemFood.java47
-rw-r--r--src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java78
-rw-r--r--src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java82
-rw-r--r--src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java118
-rw-r--r--src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java73
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBase.java22
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java51
-rw-r--r--src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java22
-rw-r--r--src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java92
-rw-r--r--src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java82
-rw-r--r--src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java100
-rw-r--r--src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java99
-rw-r--r--src/Java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java93
-rw-r--r--src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java85
-rw-r--r--src/Java/gtPlusPlus/core/item/effects/RarityEffect.java41
-rw-r--r--src/Java/gtPlusPlus/core/item/effects/RarityEpic.java28
-rw-r--r--src/Java/gtPlusPlus/core/item/effects/RarityRare.java28
-rw-r--r--src/Java/gtPlusPlus/core/item/effects/RarityUncommon.java22
-rw-r--r--src/Java/gtPlusPlus/core/item/general/BedLocator_Base.java107
-rw-r--r--src/Java/gtPlusPlus/core/item/general/BufferCore.java93
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemCloakingDevice.java256
-rw-r--r--src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java228
-rw-r--r--src/Java/gtPlusPlus/core/item/general/NuclearFuelRodBase.java210
-rw-r--r--src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java314
-rw-r--r--src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java223
-rw-r--r--src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Thorium.java13
-rw-r--r--src/Java/gtPlusPlus/core/item/init/ItemsFoods.java43
-rw-r--r--src/Java/gtPlusPlus/core/item/materials/MaterialHandler.java10
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java79
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java179
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java279
-rw-r--r--src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java310
-rw-r--r--src/Java/gtPlusPlus/core/lib/CORE.java96
-rw-r--r--src/Java/gtPlusPlus/core/lib/LoadedMods.java174
-rw-r--r--src/Java/gtPlusPlus/core/lib/MaterialInfo.java149
-rw-r--r--src/Java/gtPlusPlus/core/proxy/ClientProxy.java86
-rw-r--r--src/Java/gtPlusPlus/core/proxy/ServerProxy.java28
-rw-r--r--src/Java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java98
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java233
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java32
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java115
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java299
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java601
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java46
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java177
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPE_Batteries.java49
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPE_CONSTANTS.java116
-rw-r--r--src/Java/gtPlusPlus/core/recipe/ShapedRecipeObject.java42
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotFrame.java25
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotItemBackpackInv.java28
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotRTG.java25
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java17
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/base/TILE_ENTITY_BASE.java39
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java310
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/machines/TileEntityCharger.java186
-rw-r--r--src/Java/gtPlusPlus/core/tileentities/machines/TileEntityNHG.java502
-rw-r--r--src/Java/gtPlusPlus/core/util/BaseHandler.java11
-rw-r--r--src/Java/gtPlusPlus/core/util/ClassUtils.java78
-rw-r--r--src/Java/gtPlusPlus/core/util/Log.java29
-rw-r--r--src/Java/gtPlusPlus/core/util/LoggingUtils.java54
-rw-r--r--src/Java/gtPlusPlus/core/util/Utils.java539
-rw-r--r--src/Java/gtPlusPlus/core/util/UtilsChatFormatting.java156
-rw-r--r--src/Java/gtPlusPlus/core/util/UtilsRarity.java23
-rw-r--r--src/Java/gtPlusPlus/core/util/UtilsText.java32
-rw-r--r--src/Java/gtPlusPlus/core/util/debug/DEBUG_BLOCK_ShapeSpawner.java139
-rw-r--r--src/Java/gtPlusPlus/core/util/debug/DEBUG_INIT.java43
-rw-r--r--src/Java/gtPlusPlus/core/util/debug/DEBUG_ITEM_ShapeSpawner.java55
-rw-r--r--src/Java/gtPlusPlus/core/util/debug/DEBUG_MULTIBLOCK_ShapeSpawner.java805
-rw-r--r--src/Java/gtPlusPlus/core/util/debug/DEBUG_ScreenOverlay.java45
-rw-r--r--src/Java/gtPlusPlus/core/util/debug/DEBUG_TimerThread.java64
-rw-r--r--src/Java/gtPlusPlus/core/util/debug/UtilityGL11Debug.java343
-rw-r--r--src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java44
-rw-r--r--src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java87
-rw-r--r--src/Java/gtPlusPlus/core/util/item/UtilsItems.java361
-rw-r--r--src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java87
-rw-r--r--src/Java/gtPlusPlus/core/util/math/MathUtils.java213
-rw-r--r--src/Java/gtPlusPlus/core/util/particles/EntityParticleFXMysterious.java17
-rw-r--r--src/Java/gtPlusPlus/core/util/player/PlayerCache.java190
-rw-r--r--src/Java/gtPlusPlus/core/util/player/UtilsMining.java180
-rw-r--r--src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java370
-rw-r--r--src/Java/gtPlusPlus/core/util/wrapper/var.java67
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java34
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_AlvearyFrameBlock.java45
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_BlockAlveary.java274
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_TileAlveary.java199
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/IAlvearyComponentAdvanced.java28
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/ISidedFrameWearingInventory.java10
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/TileAlvearyFrameHousing.java301
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/CONTAINER_FrameHousing.java98
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/GUI_FrameHousing.java49
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/InventoryFrameHousing.java21
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java97
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/items/FR_StringUtil.java24
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/items/MB_FrameType.java119
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/items/MB_ItemFrame.java140
-rw-r--r--src/Java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java82
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java49
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java55
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java95
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java229
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java39
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java826
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java144
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java199
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java7
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java38
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IronBlastFurnace.java31
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java41
-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.java123
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SolarGenerator.java80
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java97
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java65
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java30
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java72
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java64
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SafeBlock.java49
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SolarGenerator.java41
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SteamCondenser.java55
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java24
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java55
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java21
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java41
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java16
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java16
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java20
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java160
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_Generic_Item.java186
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem.java323
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java559
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java204
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java605
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java84
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java127
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java149
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaCondensor.java165
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java338
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java385
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java236
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_SuperConductor.java239
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSafeBlock.java76
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSuperConductorNodeBase.java297
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_BasicMachine_Custom_Recipe.java623
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_CustomRecipe_BasicMachine.java799
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java291
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java67
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java828
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java328
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java211
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java263
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechBaseMetaTileEntityLossless.java1857
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaPipeEntity_BaseSuperConductor.java640
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLossless.java66
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLosslessBasicTank.java251
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLosslessTieredMachineBlock.java67
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/MetaTileEntityLossless.java865
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java350
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/creative/GregtechMetaCreativeEnergyBuffer.java269
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java27
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java130
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechMaterialStack.java42
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechRenderedTexture.java162
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java19
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java366
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipeRegistrator.java340
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipe_OLD.java781
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java429
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java76
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java143
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java11
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java33
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java45
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java195
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java73
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java441
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java442
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java163
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java39
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java144
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java119
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java174
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySuperCondensor.java104
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTENuclearReactor.java287
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java326
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java272
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialElectrolyzer.java258
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialMacerator.java278
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialPlatePress.java204
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialSinter.java263
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialWireMill.java246
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIronBlastFurnace.java380
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java352
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityPowerSubStationController.java189
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java168
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_BaseMultiblockItem.java49
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java198
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_MaxEfficiencyMultiBlockItem.java27
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Block.java107
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_HotIngots.java23
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Ingot1.java68
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Plate1.java56
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Textures_Items.java10
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java222
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java46
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java81
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java55
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java291
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java99
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java83
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCentrifuge.java27
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCokeOven.java27
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElectrolyzer.java27
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMacerator.java27
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java27
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialPlatePress.java27
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialSinter.java24
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWiremill.java27
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIronBlastFurnace.java25
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java27
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java25
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java53
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarGenerators.java36
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamCondenser.java27
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperConductionPoint.java27
-rw-r--r--src/Java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java28
-rw-r--r--src/Java/gtPlusPlus/xmod/growthcraft/booze/Register_Booze.java64
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/HANDLER_IC2.java30
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java207
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/TileEntityRTG.java86
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RTG.java37
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java52
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_BlockKineticGenerator.java76
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_TEComponent.java48
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/ContainerKineticWindgenerator.java27
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/IC2_ContainerBase.java5
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/gui/GuiKineticWindGenerator.java76
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/tileentity/TileEntityKineticWindGenerator.java392
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradual.java42
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradualInteger.java53
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemIC2.java104
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java72
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/item/ItemGenerators.java55
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/item/RotorBase.java99
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java121
-rw-r--r--src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java151
-rw-r--r--src/Java/gtPlusPlus/xmod/psychedelicraft/HANDLER_Psych.java27
-rw-r--r--src/Java/gtPlusPlus/xmod/psychedelicraft/fluids/PS_Fluids.java54
-rw-r--r--src/Java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java37
-rw-r--r--src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java189
-rw-r--r--src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java182
-rw-r--r--src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Blocks.java26
-rw-r--r--src/Java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java67
-rw-r--r--src/Java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java79
-rw-r--r--src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java62
325 files changed, 45919 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java
new file mode 100644
index 0000000000..a67213251c
--- /dev/null
+++ b/src/Java/gtPlusPlus/GTplusplus.java
@@ -0,0 +1,185 @@
+package gtPlusPlus;
+
+import static gtPlusPlus.core.lib.CORE.DEBUG;
+import static gtPlusPlus.core.lib.CORE.configSwitches.disableEnderIOIntegration;
+import static gtPlusPlus.core.lib.CORE.configSwitches.disableIC2Recipes;
+import static gtPlusPlus.core.lib.CORE.configSwitches.disableStaballoyBlastFurnaceRecipe;
+import static gtPlusPlus.core.lib.CORE.configSwitches.enableAlternativeBatteryAlloy;
+import static gtPlusPlus.core.lib.CORE.configSwitches.enableAlternativeDivisionSigilRecipe;
+import static gtPlusPlus.core.lib.CORE.configSwitches.enableCustomAlvearyBlocks;
+import static gtPlusPlus.core.lib.CORE.configSwitches.enableSolarGenerators;
+import static gtPlusPlus.core.lib.CORE.configSwitches.enableThaumcraftShardUnification;
+import gregtech.api.util.GT_Config;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.Recipe_GT.Gregtech_Recipe_Map;
+import gtPlusPlus.core.commands.CommandMath;
+import gtPlusPlus.core.common.CommonProxy;
+import gtPlusPlus.core.handler.events.LoginEventHandler;
+import gtPlusPlus.core.item.general.RF2EU_Battery;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.xmod.gregtech.HANDLER_GT;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+import java.util.Collection;
+
+import net.minecraftforge.common.config.Configuration;
+import cpw.mods.fml.common.FMLCommonHandler;
+import cpw.mods.fml.common.Mod;
+import cpw.mods.fml.common.Mod.EventHandler;
+import cpw.mods.fml.common.SidedProxy;
+import cpw.mods.fml.common.event.FMLInitializationEvent;
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import cpw.mods.fml.common.event.FMLServerStartingEvent;
+import cpw.mods.fml.common.event.FMLServerStoppingEvent;
+
+@Mod(modid=CORE.MODID, name=CORE.name, version=CORE.VERSION, dependencies="required-after:Forge; after:IC2; after:ihl; after:psychedelicraft; after:gregtech; after:Forestry; after:MagicBees; after:CoFHCore; after:Growthcraft; after:Railcraft; after:CompactWindmills; after:ForbiddenMagic; after:MorePlanet; after:PneumaticCraft; after:ExtraUtilities; after:Thaumcraft; after:rftools; after:simplyjetpacks; after:BigReactors; after:EnderIO;")
+public class GTplusplus
+implements ActionListener
+{
+
+ @Mod.Instance(CORE.MODID)
+ public static GTplusplus instance;
+
+ @SidedProxy(clientSide="gtPlusPlus.core.proxy.ClientProxy", serverSide="gtPlusPlus.core.proxy.ServerProxy")
+ public static CommonProxy proxy;
+
+
+
+ public static void handleConfigFile(FMLPreInitializationEvent event) {
+ Configuration config = new Configuration(event.getSuggestedConfigurationFile());
+ config.load();
+
+ //Debug
+ DEBUG = config.getBoolean("debugMode", "debug", false, "Enables all sorts of debug logging. (Don't use unless told to, breaks other things.)");
+ disableEnderIOIntegration = config.getBoolean("disableEnderIO", "debug", false, "Disables EnderIO Integration.");
+ disableStaballoyBlastFurnaceRecipe = config.getBoolean("disableStaballoyBlastFurnaceRecipe", "debug", false, "Disables Staballoy Blast Furnace Recipe.");
+ //disableCentrifugeFormation = config.getBoolean("disableCentrifuge", "debug", false, "Keeps the Items around, just stops the multiblock forming. (It's broken currently, needs in depth testing)");
+
+ //Machines
+ enableSolarGenerators = config.getBoolean("enableSolarGenerators", "machines", false, "These may be overpowered, Consult a local electrician.");
+ enableThaumcraftShardUnification = config.getBoolean("enableThaumcraftShardUnification", "machines", false, "Allows the use of TC shards across many recipes by oreDicting them into a common group.");
+ enableAlternativeBatteryAlloy = config.getBoolean("enableAlternativeBatteryAlloy", "machines", false, "Adds a non-Antimony using Battery Alloy. Not Balanced at all..");
+ disableIC2Recipes = config.getBoolean("disableIC2Recipes", "machines", false, "Alkaluscraft Related - Removes IC2 Cables Except glass fibre. Few other Misc Tweaks.");
+ enableAlternativeDivisionSigilRecipe = config.getBoolean("enableAlternativeDivisionSigilRecipe", "machines", false, "Utilizes Neutronium instead.");
+
+ //Options
+ RF2EU_Battery.rfPerEU = config.getInt("rfUsedPerEUForUniversalBatteries", "configurables", 4, 1, 1000, "How much RF is a single unit of EU worth? (Most mods use 4:1 ratio)");
+
+ //Features
+ enableCustomAlvearyBlocks = config.getBoolean("enableCustomAlvearyBlocks", "features", false, "Enables Custom Alveary Blocks.");
+
+ config.save();
+ }
+
+ public static String randomDust_A;
+ public static String randomDust_B;
+ public static String randomDust_C;
+ public static String randomDust_D;
+
+ protected void FirstCall(){
+ Utils.LOG_WARNING("Summoning up mystic powers.");
+ String[] infusedDusts = {"Fire", "Water", "Earth", "Air", "Order", "Entropy"};
+ int a = MathUtils.randInt(0, 5);
+ int b = MathUtils.randInt(0, 5);
+ int c = MathUtils.randInt(0, 5);
+ int d = MathUtils.randInt(0, 5);
+ String infusedDust1 = "dustInfused"+infusedDusts[a];
+ String infusedDust2 = "dustInfused"+infusedDusts[b];
+ String infusedDust3 = "dustInfused"+infusedDusts[c];
+ String infusedDust4 = "dustInfused"+infusedDusts[d];
+ Utils.LOG_INFO("Found the aspect of "+infusedDusts[a]+" to embody into energy crystals.");
+ Utils.LOG_INFO("Found the aspect of "+infusedDusts[b]+" to embody into energy crystals.");
+ Utils.LOG_INFO("Found the aspect of "+infusedDusts[c]+" to embody into energy crystals.");
+ Utils.LOG_INFO("Found the aspect of "+infusedDusts[d]+" to embody into energy crystals.");
+ randomDust_A = infusedDust1;
+ randomDust_B = infusedDust2;
+ randomDust_C = infusedDust3;
+ randomDust_D = infusedDust4;
+ //ItemStack a1 = UtilsItems.getItemStackOfAmountFromOreDict("dustInfused"+infusedDusts[a], 8);
+ //ItemStack b1 = UtilsItems.getItemStackOfAmountFromOreDict("dustInfused"+infusedDusts[b], 8);
+ //ItemStack c1 = UtilsItems.getItemStackOfAmountFromOreDict("dustInfused"+infusedDusts[c], 8);
+ //ItemStack d1 = UtilsItems.getItemStackOfAmountFromOreDict("dustInfused"+infusedDusts[d], 8);
+
+ }
+
+
+
+
+ //Pre-Init
+ @Mod.EventHandler
+ public void preInit(FMLPreInitializationEvent event)
+ {
+ Utils.LOG_INFO("Loading "+CORE.name+" V"+CORE.VERSION);
+ FirstCall();
+ FMLCommonHandler.instance().bus().register(new LoginEventHandler());
+ Utils.LOG_INFO("Login Handler Initialized");
+
+ handleConfigFile(event);
+ proxy.registerTileEntities();
+ proxy.registerRenderThings();
+ HANDLER_GT.mMaterialProperties = new GT_Config(new Configuration(new File(new File(event.getModConfigurationDirectory(), "GTplusplus"), "MaterialProperties.cfg")));
+ proxy.preInit(event);
+ }
+
+ //Init
+ @Mod.EventHandler
+ public void init(FMLInitializationEvent event)
+ {
+ proxy.init(event);
+ //MinecraftForge.EVENT_BUS.register(this);
+ //FMLCommonHandler.instance().bus().register(this);
+ proxy.registerNetworkStuff();
+ }
+
+ //Post-Init
+ @Mod.EventHandler
+ public void postInit(FMLPostInitializationEvent event) {
+ proxy.postInit(event);
+
+ if (DEBUG){
+ dumpGtRecipeMap(Gregtech_Recipe_Map.sChemicalDehydratorRecipes);
+ dumpGtRecipeMap(Gregtech_Recipe_Map.sCokeOvenRecipes);
+ dumpGtRecipeMap(Gregtech_Recipe_Map.sMatterFab2Recipes);
+ }
+ }
+
+ @EventHandler
+ public void serverStarting(FMLServerStartingEvent event)
+ {
+ event.registerServerCommand(new CommandMath());
+ }
+
+ @Mod.EventHandler
+ public void serverStopping(FMLServerStoppingEvent event)
+ {
+
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent arg0) {
+
+ }
+
+ protected void dumpGtRecipeMap(GT_Recipe_Map r){
+ Collection<GT_Recipe> x = r.mRecipeList;
+ Utils.LOG_INFO("Dumping "+r.mUnlocalizedName+" Recipes for Debug.");
+ for(GT_Recipe newBo : x){
+ Utils.LOG_INFO("========================");
+ Utils.LOG_INFO("Dumping Input: "+UtilsItems.getArrayStackNames(newBo.mInputs));
+ Utils.LOG_INFO("Dumping Inputs "+UtilsItems.getFluidArrayStackNames(newBo.mFluidInputs));
+ Utils.LOG_INFO("Dumping Duration: "+newBo.mDuration);
+ Utils.LOG_INFO("Dumping EU/t: "+newBo.mEUt);
+ Utils.LOG_INFO("Dumping Output: "+UtilsItems.getArrayStackNames(newBo.mOutputs));
+ Utils.LOG_INFO("Dumping Output: "+UtilsItems.getFluidArrayStackNames(newBo.mFluidOutputs));
+ Utils.LOG_INFO("========================");
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/block/ModBlocks.java b/src/Java/gtPlusPlus/core/block/ModBlocks.java
new file mode 100644
index 0000000000..ceb8880299
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/ModBlocks.java
@@ -0,0 +1,78 @@
+package gtPlusPlus.core.block;
+
+import gtPlusPlus.core.block.general.LightGlass;
+import gtPlusPlus.core.block.general.fluids.FluidRegistryHandler;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraftforge.fluids.Fluid;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public final class ModBlocks {
+
+ //Blocks
+ //public static Block blockBloodSteel;
+ //public static Block blockStaballoy;
+ // WIP TODO public static Block blockToolBuilder;
+ public static Block blockGriefSaver;
+ public static Block blockCasingsMisc;
+ public static Block blockHeliumGenerator;
+ public static Block blockNHG;
+ public static Block blockCharger;
+
+ public static Block MatterFabricatorEffectBlock;
+
+ public static Fluid fluidJackDaniels = new Fluid("fluidJackDaniels");
+ public static Block blockFluidJackDaniels;
+ public static Block blockGtFrameStaballoy;
+ public static Block blockGtFrameTantalloy60;
+ public static Block blockGtFrameTantalloy61;
+
+
+
+ public static void init() {
+ Utils.LOG_INFO("Initializing Blocks.");
+ //blockGriefSaver = new TowerDevice().setBlockName("blockGriefSaver").setCreativeTab(AddToCreativeTab.tabBlock).setBlockTextureName("blockDefault");
+
+ registerBlocks();
+ }
+
+ public static void registerBlocks(){
+
+ Utils.LOG_INFO("Registering Blocks.");
+
+ //Blood Steel Block
+ //GameRegistry.registerBlock(blockBloodSteel = new BasicBlock("blockBloodSteel", Material.iron), "blockBloodSteel");
+
+ //Staballoy Block
+ //GameRegistry.registerBlock(blockStaballoy = new BasicBlock("blockStaballoy", Material.iron), "blockStaballoy");
+
+ //GameRegistry.registerBlock(MatterFabricatorEffectBlock = new MatterFabricatorEffectBlock(), "blockMF_Effect");
+
+ GameRegistry.registerBlock(MatterFabricatorEffectBlock = new LightGlass(Material.glass, false).setHardness(0.1F).setBlockTextureName(CORE.MODID + ":" + "blockMFEffect").setStepSound(Block.soundTypeGlass), "blockMFEffect");
+
+
+ //Casing Blocks
+ blockCasingsMisc = new GregtechMetaCasingBlocks();
+
+ //Fluids
+ FluidRegistryHandler.registerFluids();
+
+ // blockHeliumGenerator = GameRegistry.registerBlock(new HeliumGenerator(), "Helium_Collector");
+ // blockNHG = GameRegistry.registerBlock(new Machine_NHG("blockNuclearFueledHeliumGenerator"), "blockNuclearFueledHeliumGenerator");
+ // blockCharger = GameRegistry.registerBlock(new Machine_Charger("blockMachineCharger"), "blockMachineCharger");
+
+
+ //WIP TODO
+ //GameRegistry.registerBlock(blockGriefSaver, "blockGriefSaver");
+
+ //GtFrames
+ //GameRegistry.registerBlock(blockGtFrameSet1 = new BlockGtFrameBox("blockGtFrameSet1", Material.iron ,BlockTypes.FRAME, true, Utils.rgbtoHexValue(68, 75, 66), Utils.rgbtoHexValue(68, 75, 166), Utils.rgbtoHexValue(122, 135, 196)), "blockGtFrameSet1");
+ //GameRegistry.registerBlock(blockGtFrameTantalloy60 = new BlockBaseModular("blockGtFrameStaballoy", "Staballoy", BlockTypes.FRAME, Utils.rgbtoHexValue(68, 75, 66)), ItemBlockGtFrameBox.class, "blockGtFrameStaballoy");
+ //GameRegistry.registerBlock(blockGtFrameTantalloy60 = new BlockBaseModular("blockGtFrameTantalloy60", "Tantalloy-60", BlockTypes.FRAME, Utils.rgbtoHexValue(68, 75, 166)), ItemBlockGtFrameBox.class, "blockGtFrameTantalloy60");
+ //GameRegistry.registerBlock(blockGtFrameTantalloy61 = new BlockBaseModular("blockGtFrameTantalloy61", "Tantalloy-61", BlockTypes.FRAME, Utils.rgbtoHexValue(122, 135, 196)), ItemBlockGtFrameBox.class, "blockGtFrameTantalloy61");
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java b/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java
new file mode 100644
index 0000000000..b7ac24a71b
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/base/AdvancedBlock.java
@@ -0,0 +1,31 @@
+package gtPlusPlus.core.block.base;
+
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.world.World;
+
+public class AdvancedBlock extends Block {
+
+ protected AdvancedBlock(String unlocalizedName, Material material, CreativeTabs x, float blockHardness, float blockResistance, float blockLightLevel,
+ String blockHarvestTool, int blockHarvestLevel, SoundType BlockSound) {
+ super(material);
+ this.setBlockName(unlocalizedName);
+ this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(x);
+ this.setHardness(blockHardness); //block Hardness
+ this.setResistance(blockResistance);
+ this.setLightLevel(blockLightLevel);
+ this.setHarvestLevel(blockHarvestTool, blockHarvestLevel);
+ this.setStepSound(BlockSound);
+ }
+
+ @Override
+ public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_)
+ {
+ return false;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/block/base/BasicBlock.java b/src/Java/gtPlusPlus/core/block/base/BasicBlock.java
new file mode 100644
index 0000000000..cd879167ba
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/base/BasicBlock.java
@@ -0,0 +1,52 @@
+package gtPlusPlus.core.block.base;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+
+public class BasicBlock extends Block {
+
+ public BasicBlock(String unlocalizedName, Material material) {
+ super(material);
+ this.setBlockName(Utils.sanitizeString(unlocalizedName));
+ this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setHardness(2.0F);
+ this.setResistance(6.0F);
+ this.setLightLevel(0.0F);
+ this.setHarvestLevel("pickaxe", 2);
+ this.setStepSound(soundTypeMetal);
+ }
+
+
+ public static enum BlockTypes {
+ STANDARD("blockBlock", "pickaxe", soundTypeStone),
+ FRAME("blockFrameGt", "wrench", soundTypeMetal);
+
+ private String TEXTURE_NAME;
+ private String HARVEST_TOOL;
+ private SoundType soundOfBlock;
+ private BlockTypes (String textureName, String harvestTool, SoundType blockSound)
+ {
+ this.TEXTURE_NAME = textureName;
+ this.HARVEST_TOOL = harvestTool;
+ this.soundOfBlock = blockSound;
+ }
+
+ public String getTexture() {
+ return TEXTURE_NAME;
+ }
+
+ public String getHarvestTool(){
+ return HARVEST_TOOL;
+ }
+
+ public SoundType getBlockSoundType(){
+ return soundOfBlock;
+ }
+
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
new file mode 100644
index 0000000000..9654caac00
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/base/BlockBaseModular.java
@@ -0,0 +1,154 @@
+package gtPlusPlus.core.block.base;
+
+import gtPlusPlus.core.item.base.itemblock.ItemBlockGtBlock;
+import gtPlusPlus.core.item.base.itemblock.ItemBlockGtFrameBox;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.math.MathUtils;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.world.IBlockAccess;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.common.registry.LanguageRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class BlockBaseModular extends BasicBlock{
+
+ protected int blockColour;
+ protected BlockTypes thisBlock;
+ protected String thisBlockMaterial;
+ protected final String thisBlockType;
+
+ public BlockBaseModular(String unlocalizedName, String blockMaterial, BlockTypes blockType, int colour) {
+ super(blockType.getTexture()+unlocalizedName, Material.iron);
+ this.setHarvestLevel(blockType.getHarvestTool(), 2);
+ this.setBlockTextureName(CORE.MODID+":"+blockType.getTexture());
+ this.blockColour = colour;
+ this.thisBlock = blockType;
+ this.thisBlockMaterial = blockMaterial;
+ this.thisBlockType = blockType.name().toUpperCase();
+ this.setBlockName(GetProperName());
+
+ if (!CORE.DEBUG){
+ //Utils.LOG_INFO("=============Block Info Dump=============");
+ //Utils.LOG_INFO("thisBlock.name().toLowerCase() - "+thisBlock.name().toLowerCase());
+ //Utils.LOG_INFO("This Blocks Type - "+thisBlockType);
+ //Utils.LOG_INFO("BlockTypes.STANDARD.name().toLowerCase() - "+BlockTypes.STANDARD.name().toLowerCase());
+ //Utils.LOG_INFO("BlockTypes.FRAME.name().toLowerCase() - "+BlockTypes.FRAME.name().toLowerCase());
+ //Utils.LOG_INFO("blockMaterial - "+blockMaterial);
+ //Utils.LOG_INFO("==========================================");
+ }
+
+ if (thisBlockType == BlockTypes.STANDARD.name().toUpperCase()){
+ LanguageRegistry.addName(this, "Block of "+blockMaterial);
+ //Utils.LOG_INFO("Registered Block in Language Registry as: "+"Block of "+blockMaterial);
+ }
+ else if (thisBlockType == BlockTypes.FRAME.name().toUpperCase()){
+ LanguageRegistry.addName(this, blockMaterial+ " Frame Box");
+ //Utils.LOG_INFO("Registered Block in Language Registry as: "+blockMaterial+ " Frame Box");
+ }
+ else {
+ LanguageRegistry.addName(this, blockMaterial);
+ //Utils.LOG_INFO("Registered Block in Language Registry as: "+blockMaterial);
+ }
+
+ //setOreDict(unlocalizedName, blockType);
+ if (thisBlockType == BlockTypes.STANDARD.name().toUpperCase()){
+ GameRegistry.registerBlock(this, ItemBlockGtBlock.class, Utils.sanitizeString(blockType.getTexture()+unlocalizedName));
+ //Utils.LOG_INFO("Registered Block in Block Registry as: "+"Block of "+blockMaterial);
+ }
+ else if (thisBlockType == BlockTypes.FRAME.name().toUpperCase()){
+ GameRegistry.registerBlock(this, ItemBlockGtFrameBox.class, Utils.sanitizeString(blockType.getTexture()+unlocalizedName));
+ //Utils.LOG_INFO("Registered Block in Block Registry as: "+blockMaterial+" Frame Box");
+ }
+ else {
+ GameRegistry.registerBlock(this, ItemBlockGtBlock.class, Utils.sanitizeString(blockType.getTexture()+unlocalizedName));
+ //Utils.LOG_INFO("Registered Block in Block Registry as: "+blockMaterial);
+ }
+
+
+ }
+
+ /**
+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getRenderBlockPass()
+ {
+ if (thisBlock == BlockTypes.FRAME){
+ return 1;
+ }
+ return 0;
+ }
+
+ /*@Override
+ public String getLocalizedName() {
+ String tempIngot;
+ if (thisBlock == BlockTypes.STANDARD){
+ tempIngot = "Block of "+thisBlockMaterial;
+ }
+ else if (thisBlock == BlockTypes.FRAME){
+ tempIngot = thisBlockMaterial + " Frame Box";
+ }
+ else {
+
+ tempIngot = getUnlocalizedName().replace("tile.blockGt", "ingot");
+ }
+ return tempIngot;
+ }*/
+
+ public String GetProperName() {
+ String tempIngot;
+ if (thisBlock == BlockTypes.STANDARD){
+ tempIngot = "Block of "+thisBlockMaterial;
+ }
+ else if (thisBlock == BlockTypes.FRAME){
+ tempIngot = thisBlockMaterial + " Frame Box";
+ }
+ else {
+
+ tempIngot = getUnlocalizedName().replace("tile.blockGt", "ingot");
+ }
+ return tempIngot;
+ }
+
+ @Override
+ public boolean isOpaqueCube()
+ {
+ return false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(IIconRegister iIcon)
+ {
+ this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + thisBlock.getTexture());
+ }
+
+ @Override
+ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4){
+
+ if (this.blockColour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+
+ return this.blockColour;
+ }
+
+ @Override
+ public int getRenderColor(int aMeta) {
+ if (this.blockColour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+
+ return this.blockColour;
+ }
+
+ @Override
+ public int getBlockColor() {
+ return this.blockColour;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/block/base/MetaBlock.java b/src/Java/gtPlusPlus/core/block/base/MetaBlock.java
new file mode 100644
index 0000000000..4009c36726
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/base/MetaBlock.java
@@ -0,0 +1,28 @@
+package gtPlusPlus.core.block.base;
+
+import java.util.List;
+
+import net.minecraft.block.material.Material;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+
+public class MetaBlock extends MultiTextureBlock {
+
+ protected MetaBlock(String unlocalizedName, Material material, SoundType soundType) {
+ super(unlocalizedName, material, soundType);
+ }
+
+ @Override
+ public int damageDropped(int meta) {
+ return meta;
+ }
+
+ @Override
+ public void getSubBlocks(Item item, CreativeTabs tab, List list) {
+ for (int i = 0; i < 6; i ++) {
+ list.add(new ItemStack(item, 1, i));
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java b/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java
new file mode 100644
index 0000000000..4f022bae6d
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/base/MultiTextureBlock.java
@@ -0,0 +1,36 @@
+package gtPlusPlus.core.block.base;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.util.IIcon;
+
+public class MultiTextureBlock extends Block {
+
+ public IIcon[] icons = new IIcon[6];
+
+ protected MultiTextureBlock(String unlocalizedName, Material material, SoundType blockSound)
+ {
+ super(material);
+ this.setBlockName(unlocalizedName);
+ this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setHardness(2.0F);
+ this.setResistance(6.0F);
+ this.setStepSound(blockSound);
+ }
+
+ @Override
+ public void registerBlockIcons(IIconRegister reg) {
+ for (int i = 0; i < 6; i ++) {
+ this.icons[i] = reg.registerIcon(this.textureName + "_" + i);
+ }
+ }
+
+ @Override
+ public IIcon getIcon(int side, int meta) {
+ return this.icons[side];
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/general/LightGlass.java b/src/Java/gtPlusPlus/core/block/general/LightGlass.java
new file mode 100644
index 0000000000..5aa9f5b818
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/general/LightGlass.java
@@ -0,0 +1,128 @@
+package gtPlusPlus.core.block.general;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+
+import java.util.Random;
+
+import net.minecraft.block.BlockBreakable;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class LightGlass extends BlockBreakable
+{
+ private int state = 0;
+ private int a = 255;
+ private int r = 255;
+ private int g = 0;
+ private int b = 0;
+ private int hex;
+
+ public LightGlass(Material mat, boolean bool)
+ {
+ super("blockMFEffect", mat, bool);
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ this.setBlockName("blockMFEffect");
+ this.setLightLevel(12F);
+ this.setLightOpacity(0);
+ this.setTickRandomly(true);
+ this.setResistance(1);
+ }
+
+ /**
+ * Returns the quantity of items to drop on block destruction.
+ */
+ @Override
+ public int quantityDropped(Random rand)
+ {
+ return 0;
+ }
+
+ /**
+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getRenderBlockPass()
+ {
+ return 0;
+ }
+
+ /**
+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
+ */
+ @Override
+ public boolean renderAsNormalBlock()
+ {
+ return true;
+ }
+
+ /**
+ * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops.
+ */
+ @Override
+ protected boolean canSilkHarvest()
+ {
+ return false;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(IIconRegister iIcon)
+ {
+ this.blockIcon = iIcon.registerIcon(CORE.MODID + ":" + "blockMFEffect");
+ }
+
+ @Override
+ //http://stackoverflow.com/questions/31784658/how-can-i-loop-through-all-rgb-combinations-in-rainbow-order-in-java
+ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
+ {
+ if(state == 0){
+ g++;
+ if(g == 255)
+ state = 1;
+ }
+ if(state == 1){
+ r--;
+ if(r == 0)
+ state = 2;
+ }
+ if(state == 2){
+ b++;
+ if(b == 255)
+ state = 3;
+ }
+ if(state == 3){
+ g--;
+ if(g == 0)
+ state = 4;
+ }
+ if(state == 4){
+ r++;
+ if(r == 255)
+ state = 5;
+ }
+ if(state == 5){
+ b--;
+ if(b == 0)
+ state = 0;
+ }
+ hex = (a << 24) + (r << 16) + (g << 8) + (b);
+ return hex;
+ }
+
+ /**
+ * A randomly called display update to be able to add particles or other items for display
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void randomDisplayTick(World world, int posX, int posY, int posZ, Random random){
+ Utils.spawnFX(world, posX, posY, posZ, "smoke", "cloud");
+
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java b/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java
new file mode 100644
index 0000000000..7fa890b6c8
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/general/antigrief/TowerDevice.java
@@ -0,0 +1,276 @@
+package gtPlusPlus.core.block.general.antigrief;
+
+import static gtPlusPlus.core.block.ModBlocks.blockGriefSaver;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.general.TileEntityReverter;
+import gtPlusPlus.core.util.Utils;
+
+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;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class TowerDevice extends Block {
+ private static IIcon TEX_ANTIBUILDER;
+ public static final int META_ANTIBUILDER = 9;
+ private boolean bUnbreakable;
+
+ public TowerDevice()
+ {
+ super(Material.wood);
+ setHardness(10.0F);
+ setResistance(35.0F);
+ setStepSound(Block.soundTypeWood);
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ public int tickRate()
+ {
+ return 15;
+ }
+
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setBoolean("bUnbreakable", bUnbreakable);
+ }
+
+ public void loadNBTData(NBTTagCompound aNBT) {
+ bUnbreakable = aNBT.getBoolean("bUnbreakable");
+ }
+
+ public IIcon getIcon(int side, int meta)
+ {
+ return TEX_ANTIBUILDER;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(IIconRegister par1IconRegister)
+ {
+ TEX_ANTIBUILDER = par1IconRegister.registerIcon(CORE.MODID + ":" + "blockAntiGrief");
+ }
+
+ public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List)
+ {
+ par3List.add(new ItemStack(par1, 1, 9));
+ }
+
+ public boolean onBlockActivated(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
+ {
+ int meta = par1World.getBlockMetadata(x, y, z);
+ return false;
+ }
+
+ public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ)
+ {
+ int meta = world.getBlockMetadata(x, y, z);
+ return super.getExplosionResistance(par1Entity, world, x, y, z, explosionX, explosionY, explosionZ);
+ }
+
+ public float getBlockHardness(World world, int x, int y, int z)
+ {
+ int meta = world.getBlockMetadata(x, y, z);
+ return super.getBlockHardness(world, x, y, z);
+ }
+
+ public static boolean areNearbyLockBlocks(World world, int x, int y, int z)
+ {
+ boolean locked = false;
+ for (int dx = x - 2; dx <= x + 2; dx++) {
+ for (int dy = y - 2; dy <= y + 2; dy++) {
+ for (int dz = z - 2; dz <= z + 2; dz++) {
+ if ((world.getBlock(dx, dy, dz) == blockGriefSaver) && (world.getBlockMetadata(dx, dy, dz) == 4)) {
+ locked = true;
+ }
+ }
+ }
+ }
+ return locked;
+ }
+
+ public static void unlockBlock(World par1World, int x, int y, int z)
+ {
+ Block thereBlockID = par1World.getBlock(x, y, z);
+ int thereBlockMeta = par1World.getBlockMetadata(x, y, z);
+ if ((thereBlockID == blockGriefSaver) || (thereBlockMeta == 4))
+ {
+ changeToBlockMeta(par1World, x, y, z, 5);
+ par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.click", 0.3F, 0.6F);
+ }
+ }
+
+ private static void changeToBlockMeta(World par1World, int x, int y, int z, int meta)
+ {
+ Block thereBlockID = par1World.getBlock(x, y, z);
+ if ((thereBlockID == blockGriefSaver))
+ {
+ par1World.setBlock(x, y, z, thereBlockID, meta, 3);
+ par1World.markBlockRangeForRenderUpdate(x, y, z, x, y, z);
+ par1World.notifyBlocksOfNeighborChange(x, y, z, thereBlockID);
+ }
+ }
+
+ public void onBlockAdded(World par1World, int x, int y, int z)
+ {
+ int meta = par1World.getBlockMetadata(x, y, z);
+ if (!par1World.isRemote) {
+
+ }
+ }
+
+ public void onNeighborBlockChange(World par1World, int x, int y, int z, Block myBlockID)
+ {
+ int meta = par1World.getBlockMetadata(x, y, z);
+ if (!par1World.isRemote)
+ {
+
+ }
+ }
+
+ public void updateTick(World par1World, int x, int y, int z, Random par5Random)
+ {
+ if (!par1World.isRemote)
+ {
+ int meta = par1World.getBlockMetadata(x, y, z);
+ }
+ }
+
+ private void letsBuild(World par1World, int x, int y, int z)
+ {
+
+ }
+
+ private boolean isInactiveTrapCharged(World par1World, int x, int y, int z)
+ {
+ return false;
+ }
+
+ private boolean isReactorReady(World world, int x, int y, int z)
+ {
+ if ((world.getBlock(x, y + 1, z) != Blocks.redstone_block) ||
+ (world.getBlock(x, y - 1, z) != Blocks.redstone_block) ||
+ (world.getBlock(x + 1, y, z) != Blocks.redstone_block) ||
+ (world.getBlock(x - 1, y, z) != Blocks.redstone_block) ||
+ (world.getBlock(x, y, z + 1) != Blocks.redstone_block) ||
+ (world.getBlock(x, y, z - 1) != Blocks.redstone_block)) {
+ return false;
+ }
+ return true;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void randomDisplayTick(World par1World, int x, int y, int z, Random par5Random)
+ {
+ int meta = par1World.getBlockMetadata(x, y, z);
+ if ((meta == 3) || (meta == 1) || (meta == 9)) {
+ for (int i = 0; i < 1; i++) {
+ sparkle(par1World, x, y, z, par5Random);
+ }
+ }
+ }
+
+ public void sparkle(World world, int x, int y, int z, Random rand)
+ {
+ double offset = 0.0625D;
+ for (int side = 0; side < 6; side++)
+ {
+ double rx = x + rand.nextFloat();
+ double ry = y + rand.nextFloat();
+ double rz = z + rand.nextFloat();
+ if ((side == 0) && (!world.getBlock(x, y + 1, z).isOpaqueCube())) {
+ ry = y + 1 + offset;
+ }
+ if ((side == 1) && (!world.getBlock(x, y - 1, z).isOpaqueCube())) {
+ ry = y + 0 - offset;
+ }
+ if ((side == 2) && (!world.getBlock(x, y, z + 1).isOpaqueCube())) {
+ rz = z + 1 + offset;
+ }
+ if ((side == 3) && (!world.getBlock(x, y, z - 1).isOpaqueCube())) {
+ rz = z + 0 - offset;
+ }
+ if ((side == 4) && (!world.getBlock(x + 1, y, z).isOpaqueCube())) {
+ rx = x + 1 + offset;
+ }
+ if ((side == 5) && (!world.getBlock(x - 1, y, z).isOpaqueCube())) {
+ rx = x + 0 - offset;
+ }
+ if ((rx < x) || (rx > x + 1) || (ry < 0.0D) || (ry > y + 1) || (rz < z) || (rz > z + 1)) {
+ world.spawnParticle("reddust", rx, ry, rz, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ }
+
+ public static void checkAndActivateVanishBlock(World world, int x, int y, int z)
+ {
+ Block thereID = world.getBlock(x, y, z);
+ int thereMeta = world.getBlockMetadata(x, y, z);
+ }
+
+ public static void changeToActiveVanishBlock(World par1World, int x, int y, int z, int meta)
+ {
+ changeToBlockMeta(par1World, x, y, z, meta);
+ par1World.playSoundEffect(x + 0.5D, y + 0.5D, z + 0.5D, "random.pop", 0.3F, 0.6F);
+
+ Block thereBlockID = par1World.getBlock(x, y, z);
+ par1World.scheduleBlockUpdate(x, y, z, thereBlockID, getTickRateFor(thereBlockID, meta, par1World.rand));
+ }
+
+ private static int getTickRateFor(Block thereBlockID, int meta, Random rand)
+ {
+ return 15;
+ }
+
+ public int getLightValue(IBlockAccess world, int x, int y, int z)
+ {
+ Block blockID = world.getBlock(x, y, z);
+ int meta = world.getBlockMetadata(x, y, z);
+ if (blockID != this) {
+ return 0;
+ }
+ return 10;
+ }
+
+ public boolean hasTileEntity(int metadata)
+ {
+ return (metadata == 0);
+ }
+
+ public TileEntity createTileEntity(World world, int metadata)
+ {
+ if (metadata == 0) {
+ Utils.LOG_INFO("I have been created. [Antigriefer]"+this.getLocalizedName());
+ return new TileEntityReverter();
+ }
+ return null;
+ }
+
+ public Item getItemDropped(int meta, Random par2Random, int par3)
+ {
+ switch (meta)
+ {
+ case 0:
+ return null;
+ }
+ return Item.getItemFromBlock(this);
+ }
+
+ public int damageDropped(int meta)
+ {
+ return meta;
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java b/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java
new file mode 100644
index 0000000000..6096da7054
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/general/fluids/BlockFluidJackDaniels.java
@@ -0,0 +1,51 @@
+package gtPlusPlus.core.block.general.fluids;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import net.minecraftforge.fluids.BlockFluidClassic;
+import net.minecraftforge.fluids.Fluid;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class BlockFluidJackDaniels extends BlockFluidClassic {
+
+ @SideOnly(Side.CLIENT)
+ protected IIcon stillIcon;
+ @SideOnly(Side.CLIENT)
+ protected IIcon flowingIcon;
+
+ public BlockFluidJackDaniels(Fluid fluid, Material material) {
+ super(fluid, material);
+ setCreativeTab(AddToCreativeTab.tabMisc);
+ }
+
+ @Override
+ public IIcon getIcon(int side, int meta) {
+ return (side == 0 || side == 1)? stillIcon : flowingIcon;
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void registerBlockIcons(IIconRegister register) {
+ stillIcon = register.registerIcon(CORE.MODID+":fluids/fluid.jackdaniels");
+ flowingIcon = register.registerIcon(CORE.MODID+":fluids/fluid.jackdaniels");
+ }
+
+ @Override
+ public boolean canDisplace(IBlockAccess world, int x, int y, int z) {
+ if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;
+ return super.canDisplace(world, x, y, z);
+ }
+
+ @Override
+ public boolean displaceIfPossible(World world, int x, int y, int z) {
+ if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;
+ return super.displaceIfPossible(world, x, y, z);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/block/general/fluids/FluidRegistryHandler.java b/src/Java/gtPlusPlus/core/block/general/fluids/FluidRegistryHandler.java
new file mode 100644
index 0000000000..bda2aae35b
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/general/fluids/FluidRegistryHandler.java
@@ -0,0 +1,50 @@
+package gtPlusPlus.core.block.general.fluids;
+
+import static gtPlusPlus.core.block.ModBlocks.blockFluidJackDaniels;
+import static gtPlusPlus.core.block.ModBlocks.fluidJackDaniels;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.block.material.Material;
+import net.minecraftforge.fluids.FluidRegistry;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class FluidRegistryHandler {
+
+ //Fluids
+ /**
+ *
+ * Luminosity .setLuminosity(luminosity)
+ How much light does the fluid emit. Default: 0, Lava uses 15
+ Density .setDensity(density)
+ How dense is the fluid, the only effect is whether or not a fluid replaces another fluid when they flow into each other. Default: 1000, the density of water at 4 degrees Celsius in kg/m³
+ Temperature .setTemperature(temp)
+ How hot, or cold is the fluid. Has currently no effect. Default: 295, the "normal" room temperature in degrees Kelvin, this is approximately 72°F or 22°C.
+ Viscosity .setViscosity(viscosity)
+ How thick the fluid is. Determines how fast it flows. Default: 1000 for water, lava uses 6000
+ Is Gaseous .setGaseous(boolean)
+ Indicates if the fluid is gaseous. Used for rendering. Default: false
+ *
+ */
+
+ public static void registerFluids(){
+ run();
+ }
+
+ private static void run(){
+ fluidJackDaniels();
+ }
+
+ private static void fluidJackDaniels(){
+ //testFluid
+ fluidJackDaniels.setLuminosity(12);
+ fluidJackDaniels.setDensity(1200);
+ fluidJackDaniels.setTemperature(420);
+ fluidJackDaniels.setViscosity(750);
+ fluidJackDaniels.setGaseous(true);
+ fluidJackDaniels.setUnlocalizedName("fluidJackDaniels");
+ FluidRegistry.registerFluid(fluidJackDaniels);
+ blockFluidJackDaniels = new BlockFluidJackDaniels(fluidJackDaniels, Material.water).setBlockName("fluidBlockJackDaniels");
+ GameRegistry.registerBlock(blockFluidJackDaniels, CORE.MODID + "_" + blockFluidJackDaniels.getUnlocalizedName().substring(5));
+ fluidJackDaniels.setUnlocalizedName(blockFluidJackDaniels.getUnlocalizedName());
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java b/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java
new file mode 100644
index 0000000000..2832d4d0a4
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/machine/BlockGtFrameBox.java
@@ -0,0 +1,35 @@
+package gtPlusPlus.core.block.machine;
+
+import gtPlusPlus.core.block.base.MetaBlock;
+import gtPlusPlus.core.block.base.BasicBlock.BlockTypes;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.block.material.Material;
+import net.minecraft.world.IBlockAccess;
+
+public class BlockGtFrameBox extends MetaBlock {
+
+ private int[] colours;
+ private int totalColours;
+
+ public BlockGtFrameBox(
+ String unlocalizedName, Material material,
+ BlockTypes blockTypeENUM, boolean recolour, int... colour) {
+ super(unlocalizedName, material, blockTypeENUM.getBlockSoundType());
+ this.setBlockTextureName(CORE.MODID + ":" + "blockGtFrame");
+ this.setHarvestLevel(blockTypeENUM.getHarvestTool(), 2);
+ if (recolour && (colour != null && colour.length > 0)){
+ colours = colour;
+ totalColours = colours.length;
+ }
+ }
+
+ @Override
+ public int colorMultiplier(IBlockAccess p_149720_1_, int p_149720_2_,
+ int p_149720_3_, int p_149720_4_) {
+ for (int i : colours){
+
+ }
+ return super.colorMultiplier(p_149720_1_, p_149720_2_, p_149720_3_, p_149720_4_);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java b/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java
new file mode 100644
index 0000000000..4f426b99c9
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/machine/Machine_Charger.java
@@ -0,0 +1,83 @@
+package gtPlusPlus.core.block.machine;
+
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.machines.TileEntityCharger;
+
+import java.util.ArrayList;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+import scala.util.Random;
+
+public class Machine_Charger extends BlockContainer
+{
+ private static final String name = "Charging Machine";
+
+ private final Random rand = new Random();
+
+ public Machine_Charger(String unlocalizedName)
+ {
+ super(Material.iron);
+ //GameRegistry.registerBlock(this, unlocalizedName);
+ this.setBlockName(unlocalizedName);
+ this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ @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 TileEntityCharger)
+ {
+ player.openGui(GTplusplus.instance, 1, world, x, y, z);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void breakBlock(World world, int x, int y, int z, Block block, int par6)
+ {
+ if (world.isRemote) return;
+
+ ArrayList drops = new ArrayList();
+
+ TileEntity teRaw = world.getTileEntity(x, y, z);
+
+ if (teRaw != null && teRaw instanceof TileEntityCharger)
+ {
+ TileEntityCharger te = (TileEntityCharger) teRaw;
+
+ for (int i = 0; i < te.getSizeInventory(); i++)
+ {
+ ItemStack stack = te.getStackInSlot(i);
+
+ if (stack != null) drops.add(stack.copy());
+ }
+ }
+
+ for (int i = 0;i < drops.size();i++)
+ {
+ EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, (ItemStack) drops.get(i));
+ item.setVelocity((rand.nextDouble() - 0.5) * 0.25, rand.nextDouble() * 0.5 * 0.25, (rand.nextDouble() - 0.5) * 0.25);
+ world.spawnEntityInWorld(item);
+ }
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(World world, int par2)
+ {
+ return new TileEntityCharger();
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java b/src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java
new file mode 100644
index 0000000000..011e293000
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/machine/Machine_NHG.java
@@ -0,0 +1,83 @@
+package gtPlusPlus.core.block.machine;
+
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.machines.TileEntityNHG;
+
+import java.util.ArrayList;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+import scala.util.Random;
+
+public class Machine_NHG extends BlockContainer
+{
+ private static final String name = "Nuclear Fueled Helium Generator";
+
+ private final Random rand = new Random();
+
+ public Machine_NHG(String unlocalizedName)
+ {
+ super(Material.iron);
+ //GameRegistry.registerBlock(this, unlocalizedName);
+ this.setBlockName(unlocalizedName);
+ this.setBlockTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ @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 TileEntityNHG)
+ {
+ player.openGui(GTplusplus.instance, 0, world, x, y, z);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void breakBlock(World world, int x, int y, int z, Block block, int par6)
+ {
+ if (world.isRemote) return;
+
+ ArrayList drops = new ArrayList();
+
+ TileEntity teRaw = world.getTileEntity(x, y, z);
+
+ if (teRaw != null && teRaw instanceof TileEntityNHG)
+ {
+ TileEntityNHG te = (TileEntityNHG) teRaw;
+
+ for (int i = 0; i < te.getSizeInventory(); i++)
+ {
+ ItemStack stack = te.getStackInSlot(i);
+
+ if (stack != null) drops.add(stack.copy());
+ }
+ }
+
+ for (int i = 0;i < drops.size();i++)
+ {
+ EntityItem item = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, (ItemStack) drops.get(i));
+ item.setVelocity((rand.nextDouble() - 0.5) * 0.25, rand.nextDouble() * 0.5 * 0.25, (rand.nextDouble() - 0.5) * 0.25);
+ world.spawnEntityInWorld(item);
+ }
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(World world, int par2)
+ {
+ return new TileEntityNHG();
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java b/src/Java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java
new file mode 100644
index 0000000000..e964a9da01
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/machine/Machine_WireiusDeletus.java
@@ -0,0 +1,5 @@
+package gtPlusPlus.core.block.machine;
+
+public class Machine_WireiusDeletus { //A Block that removes GT Cable and Wire from it's inventory.
+
+}
diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java
new file mode 100644
index 0000000000..7a76b09cca
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/machine/heliumgen/block/HeliumGenerator.java
@@ -0,0 +1,165 @@
+package gtPlusPlus.core.block.machine.heliumgen.block;
+
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.core.block.machine.heliumgen.tileentity.TileEntityHeliumGenerator;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+
+import java.util.Random;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class HeliumGenerator extends BlockContainer {
+
+ private IIcon top, sides, front;
+ private Random randy = new Random();
+
+ public HeliumGenerator(){
+ super(Material.iron);
+ setStepSound(Block.soundTypeMetal);
+ setHardness(20.0F);
+ setBlockName("helium_collector");
+ setHarvestLevel("pickaxe", 3);
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void registerBlockIcons (IIconRegister iconRegister)
+ {
+ this.top = iconRegister.registerIcon(CORE.MODID+":blockHeliumCollector_SIDE");
+ this.sides = iconRegister.registerIcon(CORE.MODID+":blockHeliumCollector_SIDE");
+ this.front = iconRegister.registerIcon(CORE.MODID+":blockHeliumCollector_FRONT");
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side){
+ if(side == 1)
+ return top;
+ int facing = 2;
+ TileEntityHeliumGenerator machine = (TileEntityHeliumGenerator)world.getTileEntity(x, y, z);
+ if(machine != null)
+ facing = machine.getFacing();
+ if(side == facing)
+ return front;
+ else
+ return sides;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIcon (int side, int metadata)
+ {
+ if(side == 1)
+ return top;
+ if(side == 3)
+ return front;
+ return sides;
+ }
+
+ @Override
+ public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9)
+ {
+ if (world.isRemote)
+ {
+ return true;
+ }
+ player.openGui(GTplusplus.instance, 2, world, x, y, z);
+ return true;
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(World world, int meta)
+ {
+ return new TileEntityHeliumGenerator();
+ }
+
+ @Override
+ public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack item)
+ {
+ TileEntity tile = world.getTileEntity(x, y, z);
+ if(tile instanceof TileEntityHeliumGenerator) {
+ TileEntityHeliumGenerator machine = (TileEntityHeliumGenerator)tile;
+ int l = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
+
+ if (l == 0)
+ machine.setFacing((short) 2);
+
+ if (l == 1)
+ machine.setFacing((short) 5);
+
+ if (l == 2)
+ machine.setFacing((short) 3);
+
+ if (l == 3)
+ machine.setFacing((short) 4);
+ }
+
+ }
+
+ @Override
+ public void breakBlock(World world, int x, int y, int z, Block block, int wut)
+ {
+ TileEntityHeliumGenerator collector = (TileEntityHeliumGenerator)world.getTileEntity(x, y, z);
+
+ if (collector != null)
+ {
+ int i = 0;
+ for (i = 0; i < collector.getSizeInventory(); i++){
+
+ ItemStack itemstack = collector.getStackInSlot(i);
+
+ if (itemstack != null)
+ {
+ float f = this.randy.nextFloat() * 0.8F + 0.1F;
+ float f1 = this.randy.nextFloat() * 0.8F + 0.1F;
+ float f2 = this.randy.nextFloat() * 0.8F + 0.1F;
+
+ while (itemstack.stackSize > 0)
+ {
+ int j1 = this.randy.nextInt(21) + 10;
+
+ if (j1 > itemstack.stackSize)
+ {
+ j1 = itemstack.stackSize;
+ }
+
+ itemstack.stackSize -= j1;
+ EntityItem entityitem = new EntityItem(world, (double)((float)x + f), (double)((float)y + f1), (double)((float)z + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
+
+ if (itemstack.hasTagCompound())
+ {
+ entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
+ }
+
+ float f3 = 0.05F;
+ entityitem.motionX = (double)((float)this.randy.nextGaussian() * f3);
+ entityitem.motionY = (double)((float)this.randy.nextGaussian() * f3 + 0.2F);
+ entityitem.motionZ = (double)((float)this.randy.nextGaussian() * f3);
+ world.spawnEntityInWorld(entityitem);
+ }
+ }
+
+ world.func_147453_f(x, y, z, block);
+ }
+ }
+
+ super.breakBlock(world, x, y, z, block, wut);
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java
new file mode 100644
index 0000000000..d701f6f125
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/machine/heliumgen/container/ContainerHeliumGenerator.java
@@ -0,0 +1,75 @@
+package gtPlusPlus.core.block.machine.heliumgen.container;
+
+import gtPlusPlus.core.block.machine.heliumgen.tileentity.TileEntityHeliumGenerator;
+import ic2.core.ContainerBase;
+import ic2.core.slot.SlotInvSlot;
+
+import java.util.List;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Slot;
+import net.minecraft.inventory.SlotFurnace;
+
+public class ContainerHeliumGenerator
+extends ContainerBase<TileEntityHeliumGenerator>
+{
+ public short size;
+
+ public ContainerHeliumGenerator(InventoryPlayer player, TileEntityHeliumGenerator machine)
+ {
+ super(machine);
+ //Utils.LOG_WARNING("containerHeliumGenerator");
+ short sr = machine.getReactorSize();
+ this.addSlotToContainer(new SlotFurnace(player.player, machine, 2, 80, 35));
+ this.size = sr;
+ int startX = 16;
+ int startY = 16;
+ int i = 0;
+ for (i = 0; i < 9; i++)
+ {
+ int x = i % this.size;
+ int y = i / this.size;
+
+ addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + 18 * x, startY + 18 * y));
+ }
+ startX = 108;
+ startY = 16;
+ for (i = 9; i < 18; i++)
+ {
+ int x = i % this.size;
+ int y = (i-9) / this.size;
+
+ addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + 18 * x, startY + 18 * y));
+ }
+ for (i = 0; i < 3; ++i)
+ {
+ for (int j = 0; j < 9; ++j)
+ {
+ this.addSlotToContainer(new Slot(player, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
+ }
+ }
+
+ for (i = 0; i < 9; ++i)
+ {
+ this.addSlotToContainer(new Slot(player, i, 8 + i * 18, 142));
+ }
+ // addSlotToContainer(new SlotInvSlot(machine.coolantinputSlot, 0, 8, 25));
+ //addSlotToContainer(new SlotInvSlot(machine.hotcoolinputSlot, 0, 188, 25));
+ //addSlotToContainer(new SlotInvSlot(machine.coolantoutputSlot, 0, 8, 115));
+ //addSlotToContainer(new SlotInvSlot(machine.hotcoolantoutputSlot, 0, 188, 115));
+ }
+
+ @Override
+ public List<String> getNetworkedFields()
+ {
+ List<String> ret = super.getNetworkedFields();
+
+ ret.add("heat");
+ ret.add("maxHeat");
+ ret.add("EmitHeat");
+ /*ret.add("inputTank");
+ ret.add("outputTank");
+ ret.add("fluidcoolreactor");*/
+ return ret;
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/gui/GUIHeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/gui/GUIHeliumGenerator.java
new file mode 100644
index 0000000000..2106f144be
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/machine/heliumgen/gui/GUIHeliumGenerator.java
@@ -0,0 +1,72 @@
+package gtPlusPlus.core.block.machine.heliumgen.gui;
+
+import gtPlusPlus.core.block.machine.heliumgen.container.ContainerHeliumGenerator;
+import gtPlusPlus.core.block.machine.heliumgen.tileentity.TileEntityHeliumGenerator;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.StatCollector;
+
+import org.lwjgl.opengl.GL11;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+@SideOnly(Side.CLIENT)
+public class GUIHeliumGenerator extends GuiContainer
+{
+ private static final ResourceLocation collectorGuiTexture = new ResourceLocation(CORE.MODID, "textures/gui/helium_collector_gui.png");
+
+ public GUIHeliumGenerator(InventoryPlayer player, TileEntityHeliumGenerator machine)
+ {
+ super(new ContainerHeliumGenerator(player, machine));
+ }
+
+ /**
+ * Draw the foreground layer for the GuiContainer (everything in front of the items)
+ */
+ @Override
+ protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
+ {
+ String s = StatCollector.translateToLocal("Helium Collector");
+ this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752);
+ this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
+
+ this.fontRendererObj.drawString(StatCollector.translateToLocal("|"+-1), 80, 35, 2);
+
+ short sr = 3;
+ int size = sr;
+ int startX = 16;
+ int startY = 16;
+ int i = 0;
+ for (i = 0; i < 9; i++)
+ {
+ int x = i % size;
+ int y = i / size;
+ this.fontRendererObj.drawString(StatCollector.translateToLocal("|"+i), startX + 18 * x, startY + 18 * y, 4210752);
+ //addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + 18 * x, startY + 18 * y));
+ }
+ startX = 108;
+ startY = 16;
+ for (i = 9; i < 18; i++)
+ {
+ int x = i % size;
+ int y = (i-9) / size;
+ this.fontRendererObj.drawString(StatCollector.translateToLocal("|"+i), startX + 18 * x, startY + 18 * y, 4210752);
+ // addSlotToContainer(new SlotInvSlot(machine.reactorSlot, i, startX + 18 * x, startY + 18 * y));
+ }
+
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_)
+ {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.getTextureManager().bindTexture(collectorGuiTexture);
+ int k = (this.width - this.xSize) / 2;
+ int l = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
+
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/slots/InvSlotRadiation.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/slots/InvSlotRadiation.java
new file mode 100644
index 0000000000..86507a2d64
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/machine/heliumgen/slots/InvSlotRadiation.java
@@ -0,0 +1,78 @@
+package gtPlusPlus.core.block.machine.heliumgen.slots;
+
+import gtPlusPlus.core.block.machine.heliumgen.tileentity.TileEntityHeliumGenerator;
+import ic2.core.block.invslot.InvSlot;
+import net.minecraft.item.ItemStack;
+
+public class InvSlotRadiation extends InvSlot
+{
+ public InvSlotRadiation(TileEntityHeliumGenerator base, String name1, int oldStartIndex1, int count)
+ {
+ super(base, name1, oldStartIndex1, InvSlot.Access.IO, count);
+
+ setStackSizeLimit(1);
+ }
+
+ @Override
+ public boolean accepts(ItemStack itemStack)
+ {
+ return ((TileEntityHeliumGenerator)this.base).isUsefulItem(itemStack, true);
+ }
+
+ @Override
+ public int size()
+ {
+ //Utils.LOG_INFO("InvSlotRadiation/Size");
+ return 3 * 6;
+ }
+
+ public int rawSize()
+ {
+ return super.size();
+ }
+
+ @Override
+ public ItemStack get(int index)
+ {
+ return super.get(mapIndex(index));
+ }
+
+ public ItemStack get(int x, int y)
+ {
+ return super.get(y * 9 + x);
+ }
+
+ @Override
+ public void put(int index, ItemStack content)
+ {
+ super.put(mapIndex(index), content);
+ }
+
+ public void put(int x, int y, ItemStack content)
+ {
+ super.put(y * 9 + x, content);
+ }
+
+ private int mapIndex(int index)
+ {
+ int size = size();
+ int cols = size / 6;
+ if (index < size)
+ {
+ int row = index / cols;
+ int col = index % cols;
+
+ return row * 9 + col;
+ }
+ index -= size;
+ int remCols = 9 - cols;
+
+ int row = index / remCols;
+ int col = cols + index % remCols;
+
+ return row * 9 + col;
+ }
+
+ private final int rows = 6;
+ private final int maxCols = 9;
+}
diff --git a/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java b/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java
new file mode 100644
index 0000000000..06c13f997a
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/block/machine/heliumgen/tileentity/TileEntityHeliumGenerator.java
@@ -0,0 +1,648 @@
+package gtPlusPlus.core.block.machine.heliumgen.tileentity;
+
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.block.machine.heliumgen.slots.InvSlotRadiation;
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import ic2.api.Direction;
+import ic2.api.reactor.IReactor;
+import ic2.api.reactor.IReactorComponent;
+import ic2.api.tile.IWrenchable;
+import ic2.core.IC2;
+import ic2.core.IC2DamageSource;
+import ic2.core.Ic2Items;
+import ic2.core.block.TileEntityInventory;
+import ic2.core.init.MainConfig;
+import ic2.core.item.reactor.ItemReactorHeatStorage;
+import ic2.core.network.NetworkManager;
+import ic2.core.util.ConfigUtil;
+
+import java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+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 net.minecraft.network.Packet;
+import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.ChunkCoordinates;
+import net.minecraft.world.World;
+
+public class TileEntityHeliumGenerator extends TileEntityInventory implements IInventory ,IReactor, IWrenchable {
+
+ private ItemStack heliumStack;
+ private int facing = 2;
+ private int progress;
+
+
+ public void update2Entity(){
+ Utils.LOG_WARNING("updateEntity");
+ if(++progress >= 40){
+ //if(++progress >= 300){
+ if(heliumStack == null)
+ heliumStack = UtilsItems.getSimpleStack(ModItems.itemHeliumBlob);
+ else if(heliumStack.getItem() == ModItems.itemHeliumBlob && heliumStack.stackSize < 64)
+ heliumStack.stackSize++;
+ progress = 0;
+ markDirty();
+ }
+ }
+
+ @Override
+ public short getFacing(){
+ return (short) facing;
+ }
+
+ @Override
+ public void setFacing(short dir){
+ facing = dir;
+ }
+
+ /*@Override
+ public void readCustomNBT(NBTTagCompound tag)
+ {
+ this.heliumStack = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("Helium"));
+ this.progress = tag.getInteger("Progress");
+ this.facing = tag.getShort("Facing");
+ this.heat = tag.getInteger("heat");
+ this.prevActive = (this.active = tag.getBoolean("active"));
+ }
+
+ @Override
+ public void writeCustomNBT(NBTTagCompound tag)
+ {
+ tag.setInteger("Progress", this.progress);
+ tag.setShort("Facing", (short) this.facing);
+ tag.setInteger("heat", this.heat);
+ tag.setBoolean("active", this.active);
+ if(heliumStack != null) {
+ NBTTagCompound produce = new NBTTagCompound();
+ heliumStack.writeToNBT(produce);
+ tag.setTag("Helium", produce);
+ }
+ else
+ tag.removeTag("Helium");
+ }*/
+
+
+ @Override
+ public void readFromNBT(NBTTagCompound nbttagcompound)
+ {
+ super.readFromNBT(nbttagcompound);
+
+ //this.heliumStack = ItemStack.loadItemStackFromNBT(nbttagcompound.getCompoundTag("Helium"));
+ NBTTagList list = nbttagcompound.getTagList("Items", 10);
+ for (int i = 0; i < list.tagCount(); ++i) {
+ NBTTagCompound stackTag = list.getCompoundTagAt(i);
+ int slot = stackTag.getByte("Slot") & 255;
+ this.setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(stackTag));
+ }
+ this.progress = nbttagcompound.getInteger("Progress");
+ this.facing = nbttagcompound.getShort("Facing");
+ this.heat = nbttagcompound.getInteger("heat");
+ this.output = nbttagcompound.getShort("output");
+ this.prevActive = (this.active = nbttagcompound.getBoolean("active"));
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound nbttagcompound)
+ {
+ super.writeToNBT(nbttagcompound);
+
+ nbttagcompound.setInteger("Progress", this.progress);
+ nbttagcompound.setShort("Facing", (short) this.facing);
+ nbttagcompound.setInteger("heat", this.heat);
+ nbttagcompound.setShort("output", (short)(int)getReactorEnergyOutput());
+ nbttagcompound.setBoolean("active", this.active);
+ /*if(heliumStack != null) {
+ NBTTagCompound produce = new NBTTagCompound();
+ heliumStack.writeToNBT(produce);
+ nbttagcompound.setTag("Helium", produce);
+ }
+ else
+ nbttagcompound.removeTag("Helium");*/
+ NBTTagList list = new NBTTagList();
+ for (int i = 0; i < this.getSizeInventory(); ++i) {
+ if (this.getStackInSlot(i) != null) {
+ NBTTagCompound stackTag = new NBTTagCompound();
+ stackTag.setByte("Slot", (byte) i);
+ this.getStackInSlot(i).writeToNBT(stackTag);
+ list.appendTag(stackTag);
+ }
+ }
+ nbttagcompound.setTag("Items", list);
+ }
+
+
+ @Override
+ public Packet getDescriptionPacket() {
+ NBTTagCompound tag = new NBTTagCompound();
+ writeToNBT(tag);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, tag);
+ }
+
+ @Override
+ public void onDataPacket(net.minecraft.network.NetworkManager net, S35PacketUpdateTileEntity packet) {
+ super.onDataPacket(net, packet);
+ readFromNBT(packet.func_148857_g());
+ }
+
+
+ @Override
+ public int getSizeInventory()
+ {
+ return 19;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int slot){
+ return heliumStack;
+ }
+
+ @Override
+ public ItemStack decrStackSize(int slot, int decrement){
+ Utils.LOG_WARNING("decrStackSize");
+ if(heliumStack == null)
+ return null;
+ if(decrement < heliumStack.stackSize){
+ ItemStack take = heliumStack.splitStack(decrement);
+ if(heliumStack.stackSize <= 0)
+ heliumStack = null;
+ return take;
+ }
+ ItemStack take = heliumStack;
+ heliumStack = null;
+ return take;
+ }
+
+ @Override
+ public void openInventory() {}
+ @Override
+ public void closeInventory() {}
+
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer player)
+ {
+ return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) == this && player.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D;
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack stack){
+ return false;
+ }
+
+ @Override
+ public int getInventoryStackLimit(){
+ return 64;
+ }
+
+ @Override
+ public void setInventorySlotContents(int slot, ItemStack stack){
+ heliumStack = stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(int slot){
+ return null;
+ }
+
+ /**
+ * Returns the name of the inventory
+ */
+ @Override
+ public String getInventoryName()
+ {
+ //return "container.helium_collector";
+ return "container.helium_collector";
+ }
+
+ /**
+ * Returns if the inventory is named
+ */
+ @Override
+ public boolean hasCustomInventoryName()
+ {
+ return false;
+ }
+
+ //IC2 Nuclear Code
+
+
+ public Block[][][] surroundings = new Block[5][5][5];
+ public final InvSlotRadiation reactorSlot;
+ public float output = 0.0F;
+ public int updateTicker;
+ public int heat = 5000;
+ public int maxHeat = 100000;
+ public float hem = 1.0F;
+ private int EmitHeatbuffer = 0;
+ public int EmitHeat = 0;
+ private boolean redstone = false;
+ private boolean fluidcoolreactor = false;
+ private boolean active = true;
+ public boolean prevActive = false;
+
+
+ public short getReactorSize()
+ {
+ //Utils.LOG_WARNING("getReactorSize");
+ if (this.worldObj == null) {
+ Utils.LOG_WARNING("getReactorSize == 9");
+ return 9;
+ }
+ short cols = 3;
+ //Utils.LOG_WARNING("getReactorSize == "+cols);
+ for (Direction direction : Direction.directions)
+ {
+ TileEntity target = direction.applyToTileEntity(this);
+ if ((target instanceof TileEntityHeliumGenerator)) {
+ cols = (short)(cols + 1);
+ Utils.LOG_WARNING("getReactorSize =1= "+cols);
+ }
+ }
+ //Utils.LOG_WARNING("getReactorSize == "+cols);
+ return cols;
+ }
+
+ protected void updateEntityServer()
+ {
+ Utils.LOG_WARNING("updateEntityServer");
+ super.updateEntity();
+
+ if (this.updateTicker++ % getTickRate() != 0) {
+ return;
+ }
+ if (!this.worldObj.doChunksNearChunkExist(this.xCoord, this.yCoord, this.zCoord, 2))
+ {
+ this.output = 0.0F;
+ }
+ else
+ {
+
+ dropAllUnfittingStuff();
+
+ this.output = 0.0F;
+ this.maxHeat = 10000;
+ this.hem = 1.0F;
+
+ processChambers();
+ this.EmitHeatbuffer = 0;
+ if (calculateHeatEffects()) {
+ return;
+ }
+ setActive((this.heat >= 1000) || (this.output > 0.0F));
+
+ markDirty();
+ }
+ ((NetworkManager)IC2.network.get()).updateTileEntityField(this, "output");
+ }
+
+ @Override
+ public void setActive(boolean active1)
+ {
+ Utils.LOG_WARNING("setActive");
+ this.active = active1;
+ if (this.prevActive != active1) {
+ ((NetworkManager)IC2.network.get()).updateTileEntityField(this, "active");
+ }
+ this.prevActive = active1;
+ }
+
+ public void dropAllUnfittingStuff()
+ {
+ Utils.LOG_WARNING("dropAllUnfittingStuff");
+ for (int i = 0; i < this.reactorSlot.size(); i++)
+ {
+ ItemStack stack = this.reactorSlot.get(i);
+ if ((stack != null) && (!isUsefulItem(stack, false)))
+ {
+ this.reactorSlot.put(i, null);
+ eject(stack);
+ }
+ }
+ for (int i = this.reactorSlot.size(); i < this.reactorSlot.rawSize(); i++)
+ {
+ ItemStack stack = this.reactorSlot.get(i);
+
+ this.reactorSlot.put(i, null);
+ eject(stack);
+ }
+ }
+
+ public void eject(ItemStack drop)
+ {
+ Utils.LOG_WARNING("eject");
+ if ((!IC2.platform.isSimulating()) || (drop == null)) {
+ return;
+ }
+ float f = 0.7F;
+ double d = this.worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5D;
+ double d1 = this.worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5D;
+ double d2 = this.worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5D;
+ EntityItem entityitem = new EntityItem(this.worldObj, this.xCoord + d, this.yCoord + d1, this.zCoord + d2, drop);
+ entityitem.delayBeforeCanPickup = 10;
+ this.worldObj.spawnEntityInWorld(entityitem);
+ }
+
+ public boolean isUsefulItem(ItemStack stack, boolean forInsertion)
+ {
+ //Utils.LOG_WARNING("isUsefulItem");
+ Item item = stack.getItem();
+ if ((forInsertion) && (this.fluidcoolreactor) &&
+ ((item instanceof ItemReactorHeatStorage)) &&
+ (((ItemReactorHeatStorage)item).getCustomDamage(stack) > 0)) {
+ return false;
+ }
+ if ((item instanceof IReactorComponent)) {
+ return true;
+ }
+ return (item == Ic2Items.TritiumCell.getItem()) || (item == Ic2Items.reactorDepletedUraniumSimple.getItem()) || (item == Ic2Items.reactorDepletedUraniumDual.getItem()) || (item == Ic2Items.reactorDepletedUraniumQuad.getItem()) || (item == Ic2Items.reactorDepletedMOXSimple.getItem()) || (item == Ic2Items.reactorDepletedMOXDual.getItem()) || (item == Ic2Items.reactorDepletedMOXQuad.getItem());
+ }
+
+ public boolean calculateHeatEffects()
+ {
+ Utils.LOG_WARNING("calculateHeatEffects");
+ if ((this.heat < 8000) || (!IC2.platform.isSimulating()) || (ConfigUtil.getFloat(MainConfig.get(), "protection/reactorExplosionPowerLimit") <= 0.0F)) {
+ return false;
+ }
+ float power = this.heat / this.maxHeat;
+ if (power >= 1.0F)
+ {
+ explode();
+ return true;
+ }
+ if ((power >= 0.85F) && (this.worldObj.rand.nextFloat() <= 0.2F * this.hem))
+ {
+ int[] coord = getRandCoord(2);
+ if (coord != null)
+ {
+ Block block = this.worldObj.getBlock(coord[0], coord[1], coord[2]);
+ if (block.isAir(this.worldObj, coord[0], coord[1], coord[2]))
+ {
+ this.worldObj.setBlock(coord[0], coord[1], coord[2], Blocks.fire, 0, 7);
+ }
+ else if ((block.getBlockHardness(this.worldObj, coord[0], coord[1], coord[2]) >= 0.0F) && (this.worldObj.getTileEntity(coord[0], coord[1], coord[2]) == null))
+ {
+ Material mat = block.getMaterial();
+ if ((mat == Material.rock) || (mat == Material.iron) || (mat == Material.lava) || (mat == Material.ground) || (mat == Material.clay)) {
+ this.worldObj.setBlock(coord[0], coord[1], coord[2], Blocks.flowing_lava, 15, 7);
+ } else {
+ this.worldObj.setBlock(coord[0], coord[1], coord[2], Blocks.fire, 0, 7);
+ }
+ }
+ }
+ }
+ if (power >= 0.7F)
+ {
+ List list1 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(this.xCoord - 3, this.yCoord - 3, this.zCoord - 3, this.xCoord + 4, this.yCoord + 4, this.zCoord + 4));
+ for (int l = 0; l < list1.size(); l++)
+ {
+ Entity ent = (Entity)list1.get(l);
+ ent.attackEntityFrom(IC2DamageSource.radiation, (int)(this.worldObj.rand.nextInt(4) * this.hem));
+ }
+ }
+ if ((power >= 0.5F) && (this.worldObj.rand.nextFloat() <= this.hem))
+ {
+ int[] coord = getRandCoord(2);
+ if (coord != null)
+ {
+ Block block = this.worldObj.getBlock(coord[0], coord[1], coord[2]);
+ if (block.getMaterial() == Material.water) {
+ this.worldObj.setBlockToAir(coord[0], coord[1], coord[2]);
+ }
+ }
+ }
+ if ((power >= 0.4F) && (this.worldObj.rand.nextFloat() <= this.hem))
+ {
+ int[] coord = getRandCoord(2);
+ if ((coord != null) &&
+ (this.worldObj.getTileEntity(coord[0], coord[1], coord[2]) == null))
+ {
+ Block block = this.worldObj.getBlock(coord[0], coord[1], coord[2]);
+ Material mat = block.getMaterial();
+ if ((mat == Material.wood) || (mat == Material.leaves) || (mat == Material.cloth)) {
+ this.worldObj.setBlock(coord[0], coord[1], coord[2], Blocks.fire, 0, 7);
+ }
+ }
+ }
+ return false;
+ }
+
+ public int[] getRandCoord(int radius)
+ {
+ if (radius <= 0) {
+ return null;
+ }
+ int[] c = new int[3];
+ c[0] = (this.xCoord + this.worldObj.rand.nextInt(2 * radius + 1) - radius);
+ c[1] = (this.yCoord + this.worldObj.rand.nextInt(2 * radius + 1) - radius);
+ c[2] = (this.zCoord + this.worldObj.rand.nextInt(2 * radius + 1) - radius);
+ if ((c[0] == this.xCoord) && (c[1] == this.yCoord) && (c[2] == this.zCoord)) {
+ return null;
+ }
+ return c;
+ }
+
+ public void processChambers()
+ {
+ Utils.LOG_WARNING("processChambers");
+ int size = getReactorSize();
+ for (int pass = 0; pass < 6; pass++) {
+ for (int y = 0; y < 3; y++) {
+ for (int x = 0; x < size; x++)
+ {
+ ItemStack stack = this.reactorSlot.get(x, y);
+ if ((stack != null) && ((stack.getItem() instanceof IReactorComponent)))
+ {
+ IReactorComponent comp = (IReactorComponent)stack.getItem();
+ comp.processChamber(this, stack, x, y, pass == 0);
+ }
+ }
+ }
+ }
+ }
+
+ @Override
+ public ChunkCoordinates getPosition()
+ {
+ return new ChunkCoordinates(this.xCoord, this.yCoord, this.zCoord);
+ }
+
+ @Override
+ public World getWorld() {
+ return this.worldObj;
+ }
+
+ @Override
+ public int getHeat() {
+ return this.heat;
+ }
+
+ @Override
+ public void setHeat(int heat1)
+ {
+ this.heat = heat1;
+ }
+
+ @Override
+ public int addHeat(int amount)
+ {
+ this.heat += amount;
+ return this.heat;
+ }
+
+ @Override
+ public int getMaxHeat()
+ {
+ return this.maxHeat;
+ }
+
+ @Override
+ public void setMaxHeat(int newMaxHeat)
+ {
+ this.maxHeat = newMaxHeat;
+ }
+
+ @Override
+ public void addEmitHeat(int heat)
+ {
+ this.EmitHeatbuffer += heat;
+ }
+
+ @Override
+ public float getHeatEffectModifier()
+ {
+ return this.hem;
+ }
+
+ @Override
+ public void setHeatEffectModifier(float newHEM)
+ {
+ this.hem = newHEM;
+ }
+
+ @Override
+ public float getReactorEnergyOutput()
+ {
+ return this.output;
+ }
+
+ @Override
+ public double getReactorEUEnergyOutput()
+ {
+ return getOfferedEnergy();
+ }
+
+ public double getOfferedEnergy()
+ {
+ return getReactorEnergyOutput() * 5.0F * 1.0F;
+ }
+
+ @Override
+ public float addOutput(float energy)
+ {
+ return this.output += energy;
+ }
+
+ @Override
+ public ItemStack getItemAt(int x, int y)
+ {
+ Utils.LOG_WARNING("getItemAt");
+ if ((x < 0) || (x >= getReactorSize()) || (y < 0) || (y >= 6)) {
+ return null;
+ }
+ return this.reactorSlot.get(x, y);
+ }
+
+ @Override
+ public void setItemAt(int x, int y, ItemStack item)
+ {
+ Utils.LOG_WARNING("setItemAt");
+ if ((x < 0) || (x >= getReactorSize()) || (y < 0) || (y >= 6)) {
+ return;
+ }
+ this.reactorSlot.put(x, y, item);
+ }
+
+ public TileEntityHeliumGenerator() {
+ this.updateTicker = IC2.random.nextInt(getTickRate());
+ this.reactorSlot = new InvSlotRadiation(this, "helium_collector", 0, 54); //TODO
+ }
+
+ @Override
+ public void explode() {
+ Utils.LOG_WARNING("Explosion");
+ //TODO
+ }
+
+ @Override
+ public int getTickRate()
+ {
+ return 20;
+ }
+
+ public boolean receiveredstone()
+ {
+ Utils.LOG_WARNING("receiveRedstone");
+ if ((this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord)) || (this.redstone)) {
+ decrStackSize(-1, 1);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean produceEnergy()
+ {
+ Utils.LOG_WARNING("produceEnergy");
+ return (receiveredstone()) && (ConfigUtil.getFloat(MainConfig.get(), "balance/energy/generator/generator") > 0.0F);
+ }
+
+ @Override
+ public void setRedstoneSignal(boolean redstone)
+ {
+ this.redstone = redstone;
+ }
+
+ @Override
+ public boolean isFluidCooled() {
+ Utils.LOG_WARNING("isFluidCooled");
+ return false;
+ }
+
+ @Override
+ public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side)
+ {
+ return true;
+ }
+
+ @Override
+ public boolean wrenchCanRemove(EntityPlayer entityPlayer)
+ {
+ return true;
+ }
+
+ @Override
+ public float getWrenchDropRate()
+ {
+ return 1F;
+ }
+
+ @Override
+ public ItemStack getWrenchDrop(EntityPlayer entityPlayer)
+ {
+ return new ItemStack(ModBlocks.blockHeliumGenerator, 1);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/commands/CommandMath.java b/src/Java/gtPlusPlus/core/commands/CommandMath.java
new file mode 100644
index 0000000000..2a726dd8b1
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/commands/CommandMath.java
@@ -0,0 +1,205 @@
+package gtPlusPlus.core.commands;
+
+import gtPlusPlus.core.util.Utils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.minecraft.command.ICommand;
+import net.minecraft.command.ICommandSender;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityXPOrb;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.util.ChunkCoordinates;
+import net.minecraft.world.World;
+
+
+public class CommandMath implements ICommand
+{
+ private final List<String> aliases;
+
+ protected String fullEntityName;
+ protected Entity conjuredEntity;
+
+ public CommandMath()
+ {
+ aliases = new ArrayList<String>();
+
+ aliases.add("hometele");
+
+ aliases.add("warphome");
+
+ }
+
+ @Override
+ public int compareTo(Object o)
+ {
+ return 0;
+
+ }
+
+ @Override
+ public String getCommandName()
+ {
+ return "bed";
+
+ }
+
+ @Override
+ public String getCommandUsage(ICommandSender var1)
+ {
+ return "/bed [Teleports you to your bed for XP]";
+
+ }
+
+ @Override
+ public List<String> getCommandAliases()
+ {
+ return this.aliases;
+
+ }
+
+ public void processCommand(ICommandSender S, String[] argString)
+ {
+ World W = S.getEntityWorld();
+ CommandUtils C = new CommandUtils();
+ EntityPlayer P = C.getPlayer(S);
+ //System.out.println(P.getCommandSenderName());
+ //System.out.println(P.getDisplayName());
+ if (W.isRemote)
+
+ {
+
+ System.out.println("Not processing on Client side");
+
+ }
+
+ else
+
+ {
+
+ System.out.println("Processing on Server side - Home Teleport engaged by: "+P.getDisplayName());
+
+ int XP_TOTAL = P.experienceTotal;
+ Utils.LOG_WARNING("Total Xp:" + XP_TOTAL);
+ ChunkCoordinates X = P.getPlayerCoordinates();
+ Utils.LOG_WARNING("Player Location: "+X);
+ ChunkCoordinates Y = null;
+ Utils.LOG_WARNING("Bed Location: "+Y);
+ try {
+ if (P.getBedLocation(0).equals(null)){
+ Y = W.getSpawnPoint();
+ Utils.LOG_WARNING("Spawn Location: "+Y);
+ }
+ else if (!P.getBedLocation(0).equals(null)){
+ Y = P.getBedLocation(0);
+ Utils.LOG_WARNING("Bed Location: "+Y);
+ }
+ else {
+ Y = W.getSpawnPoint();
+ Utils.LOG_WARNING("Spawn Location: "+Y);
+ }
+ }
+ catch(NullPointerException e) {
+ Utils.messagePlayer(P, "You do not have a spawn, so...");
+ }
+ if (Y == null || Y.equals(null)) {
+ Y = W.getSpawnPoint();
+ Utils.LOG_WARNING("Spawn Location: "+Y);
+ }
+
+ int x1 = X.posX;
+ Utils.LOG_WARNING("X1: "+x1);
+ int x2 = Y.posX;
+ Utils.LOG_WARNING("X2: "+x2);
+ int y1 = X.posY;
+ Utils.LOG_WARNING("Y1: "+y1);
+ int y2 = Y.posY;
+ Utils.LOG_WARNING("Y2: "+y2);
+ int z1 = X.posZ;
+ Utils.LOG_WARNING("Z1: "+z1);
+ int z2 = Y.posZ;
+ Utils.LOG_WARNING("Z2: "+z2);
+
+
+ double d = Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)+(z2-z1)*(z2-z1));
+ String xpCost = String.valueOf((int)(d*0.15));
+
+ Utils.LOG_WARNING("d:" + d);
+ Utils.LOG_WARNING("-----------------------------------------");
+ Utils.LOG_WARNING("Actual math formulae");
+ Utils.LOG_WARNING(String.valueOf(d));
+ Utils.LOG_WARNING("-----------------------------------------");
+ Utils.LOG_WARNING("Xp Cost based on answer B.");
+ Utils.LOG_WARNING(String.valueOf(d*0.15) + " | " + String.valueOf(xpCost));
+ Utils.LOG_WARNING("-----------------------------------------");
+ Utils.LOG_WARNING("Xp Total");
+ Utils.LOG_WARNING(String.valueOf(XP_TOTAL));
+ Utils.LOG_WARNING("-----------------------------------------");
+
+
+
+ if ((XP_TOTAL-Float.valueOf(xpCost)) > 0){
+ EntityXPOrb E = new EntityXPOrb(W, P.posX, P.posY + 1.62D - (double) P.yOffset, P.posZ, 1);
+ //E.moveTowards((double) Y.posX + 0.5D, (int) Y.posY + 3, (double) Y.posZ + 0.5D);
+ E.setVelocity((double) Y.posX + 0.5D, (int) Y.posY + 0.1, (double) Y.posZ + 0.5D);
+ W.spawnEntityInWorld(E);
+ W.playAuxSFXAtEntity((EntityPlayer) null, 1002, (int) P.posX, (int) P.posY, (int) P.posZ, 0);
+ P.setPositionAndUpdate(x2, y2+1, z2);
+
+ //gregtech.api.util.GT_Utility.sendChatToPlayer(P, "Movement | X:"+x2+" | Y:"+y2+" | Z:"+z2);
+ gregtech.api.util.GT_Utility.sendChatToPlayer(P, "Distance Traveled | "+String.valueOf((int)(d)) + " Blocks & " + xpCost + "xp");
+ gregtech.api.util.GT_Utility.sendChatToPlayer(P, "You suddenly feel at home.");
+ P.experienceTotal = (int) (XP_TOTAL-Float.valueOf(xpCost));
+ if (!xpCost.equals("0") && Float.valueOf(xpCost) > 0){
+ gregtech.api.util.GT_Utility.sendChatToPlayer(P, "...At the loss of "+xpCost+" xp.");
+ }
+ else if (xpCost.equals("0")){
+ gregtech.api.util.GT_Utility.sendChatToPlayer(P, "...At the loss of very little xp.");
+ }
+ else {
+ gregtech.api.util.GT_Utility.sendChatToPlayer(P, "Something went wrong with the math, have this one on the house. :)");
+ }
+ }
+
+ else {
+ gregtech.api.util.GT_Utility.sendChatToPlayer(P, "You don't feel you're able to do this yet.");
+ }
+
+ }
+ }
+
+ @Override
+ public boolean canCommandSenderUseCommand(ICommandSender var1)
+ {
+ return true;
+
+ }
+
+ @Override
+ public List<?> addTabCompletionOptions(ICommandSender var1, String[] var2)
+ {
+ // TODO Auto-generated method stub
+
+ return null;
+
+ }
+
+ @Override
+ public boolean isUsernameIndex(String[] var1, int var2)
+ {
+ // TODO Auto-generated method stub
+
+ return false;
+
+ }
+
+ public boolean playerUsesCommand(World W, EntityPlayer P, int cost)
+ {
+
+
+ return true;
+ }
+
+}
+
diff --git a/src/Java/gtPlusPlus/core/commands/CommandUtils.java b/src/Java/gtPlusPlus/core/commands/CommandUtils.java
new file mode 100644
index 0000000000..32e7a75370
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/commands/CommandUtils.java
@@ -0,0 +1,20 @@
+package gtPlusPlus.core.commands;
+
+import net.minecraft.command.ICommandSender;
+import net.minecraft.entity.player.EntityPlayer;
+
+public class CommandUtils {
+
+ public EntityPlayer getPlayer(ICommandSender icommandsender){
+ EntityPlayer player;
+
+ if(icommandsender instanceof EntityPlayer){
+ player = (EntityPlayer)icommandsender;
+ return player;
+ }
+ else {
+ return null;
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java
new file mode 100644
index 0000000000..f3ed741bf0
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java
@@ -0,0 +1,132 @@
+package gtPlusPlus.core.common;
+
+import static gtPlusPlus.core.lib.CORE.DEBUG;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.handler.COMPAT_HANDLER;
+import gtPlusPlus.core.handler.COMPAT_IntermodStaging;
+import gtPlusPlus.core.handler.GuiHandler;
+import gtPlusPlus.core.handler.events.PickaxeBlockBreakEventHandler;
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.recipe.RECIPE_CONSTANTS;
+import gtPlusPlus.core.tileentities.ModTileEntities;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.debug.DEBUG_INIT;
+import gtPlusPlus.core.util.player.PlayerCache;
+import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
+
+import java.util.Iterator;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.oredict.OreDictionary;
+import cpw.mods.fml.common.FMLCommonHandler;
+import cpw.mods.fml.common.event.FMLInitializationEvent;
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import cpw.mods.fml.common.event.FMLServerStartingEvent;
+
+public class CommonProxy {
+
+ public CommonProxy(){
+ //Should Register Gregtech Materials I've Made
+ MinecraftForge.EVENT_BUS.register(this);
+ FMLCommonHandler.instance().bus().register(this);
+ if (LoadedMods.Gregtech){
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ Utils.LOG_INFO("We're using Gregtech 5.09 Experimental.");
+ }
+ else {
+ Utils.LOG_INFO("We're using Gregtech 5.08 or an equivalent fork.");
+ }
+ }
+ if (LoadedMods.Gregtech){
+ for (String tOreName : OreDictionary.getOreNames()) {
+ ItemStack tOreStack;
+ for (Iterator i$ = OreDictionary.getOres(tOreName).iterator(); i$.hasNext(); Meta_GT_Proxy.registerOre(new OreDictionary.OreRegisterEvent(tOreName, tOreStack))) {
+ Utils.LOG_INFO("Iterating Material");
+ tOreStack = (ItemStack) i$.next();
+ }
+ }
+ new Meta_GT_Proxy();
+ }
+ }
+
+ public void preInit(FMLPreInitializationEvent e) {
+ Utils.LOG_INFO("Doing some house cleaning.");
+ LoadedMods.checkLoaded();
+ Utils.LOG_INFO("Making sure we're ready to party!");
+
+
+ if (!DEBUG){
+ Utils.LOG_WARNING("Development mode not enabled.");
+ }
+ else if (DEBUG){
+ Utils.LOG_INFO("Development mode enabled.");
+ }
+ else {
+ Utils.LOG_WARNING("Development mode not set.");
+ }
+ AddToCreativeTab.initialiseTabs();
+ COMPAT_IntermodStaging.preInit();
+ //Apparently I should do this here. Might put it in Init for a test.
+ //Growthcraft_Handler.run();
+ }
+
+ public void init(FMLInitializationEvent e) {
+ //Debug Loading
+ if (CORE.DEBUG){
+ DEBUG_INIT.registerHandlers();
+ }
+ ModItems.init();
+ ModBlocks.init();
+ RECIPE_CONSTANTS.initialise();
+ MinecraftForge.EVENT_BUS.register(new PickaxeBlockBreakEventHandler());
+
+ //Compat Handling
+ COMPAT_HANDLER.registerMyModsOreDictEntries();
+ COMPAT_HANDLER.registerGregtechMachines();
+ COMPAT_HANDLER.intermodOreDictionarySupport();
+ COMPAT_IntermodStaging.init();
+ }
+
+ public void postInit(FMLPostInitializationEvent e) {
+ Utils.LOG_INFO("Cleaning up, doing postInit.");
+ PlayerCache.initCache();
+ //Compat Handling
+ COMPAT_HANDLER.InitialiseHandlerThenAddRecipes();
+ COMPAT_HANDLER.RemoveRecipesFromOtherMods();
+ COMPAT_HANDLER.startLoadingGregAPIBasedRecipes();
+ COMPAT_IntermodStaging.postInit();
+ }
+
+
+ public void serverStarting(FMLServerStartingEvent e)
+ {
+ COMPAT_HANDLER.InitialiseLateHandlerThenAddRecipes();
+ }
+
+ public void registerNetworkStuff(){
+ GuiHandler.init();
+ }
+
+ public void registerTileEntities(){
+ ModTileEntities.init();
+ }
+
+ public void registerRenderThings() {
+
+ }
+
+ @SuppressWarnings("static-method")
+ public int addArmor(String armor) {
+ return 0;
+ }
+
+ public void generateMysteriousParticles(Entity theEntity) { }
+
+
+}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java
new file mode 100644
index 0000000000..7f4aa0541a
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_BigReactors.java
@@ -0,0 +1,19 @@
+package gtPlusPlus.core.common.compat;
+
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.item.ModItems;
+import net.minecraft.item.ItemStack;
+
+public class COMPAT_BigReactors {
+
+ public static void OreDict(){
+ run();
+ }
+
+ private static final void run(){
+ GT_OreDictUnificator.registerOre("plateBlutonium", new ItemStack(ModItems.itemPlateBlutonium));
+ GT_OreDictUnificator.registerOre("plateCyanite", new ItemStack(ModItems.itemPlateCyanite));
+ GT_OreDictUnificator.registerOre("plateLudicrite", new ItemStack(ModItems.itemPlateLudicrite));
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java
new file mode 100644
index 0000000000..efa86f0009
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_CompactWindmills.java
@@ -0,0 +1,171 @@
+package gtPlusPlus.core.common.compat;
+
+import static gtPlusPlus.core.handler.COMPAT_HANDLER.AddRecipeQueue;
+import static gtPlusPlus.core.handler.COMPAT_HANDLER.RemoveRecipeQueue;
+import gtPlusPlus.core.recipe.ShapedRecipeObject;
+import gtPlusPlus.core.util.item.UtilsItems;
+import net.minecraft.item.ItemStack;
+
+
+
+public class COMPAT_CompactWindmills {
+
+ //Change IC2 Upgrades
+ public static ItemStack kineticWind = UtilsItems.simpleMetaStack("IC2:blockKineticGenerator", 0, 1);
+ public static ItemStack shaftIron = UtilsItems.simpleMetaStack("IC2:itemRecipePart", 11, 1);
+ public static ItemStack cableCopper = UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 1367, 1);
+ public static String plateRubber = "ore:plateRubber";
+
+ //Machine Casings
+ public static ItemStack elvCasing = UtilsItems.simpleMetaStack("gregtech:gt.blockcasings", 0, 1);
+ public static ItemStack lvCasing = UtilsItems.simpleMetaStack("gregtech:gt.blockcasings", 1, 1);
+ public static ItemStack mvCasing = UtilsItems.simpleMetaStack("gregtech:gt.blockcasings", 2, 1);
+ public static ItemStack hvCasing = UtilsItems.simpleMetaStack("gregtech:gt.blockcasings", 3, 1);
+ public static ItemStack evCasing = UtilsItems.simpleMetaStack("gregtech:gt.blockcasings", 4, 1);
+ public static ItemStack ivCasing = UtilsItems.simpleMetaStack("gregtech:gt.blockcasings", 5, 1);
+
+ //GT Transformers
+ public static ItemStack elvTransformer = UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 20, 1);
+ public static ItemStack lvTransformer = UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 21, 1);
+ public static ItemStack mvTransformer = UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 22, 1);
+ public static ItemStack hvTransformer = UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 23, 1);
+ public static ItemStack evTransformer = UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 24, 1);
+
+ //Compact Windmills
+ public static ItemStack elvWindmill = UtilsItems.simpleMetaStack("CompactWindmills:blockCompactWindmill", 0, 1);
+ public static ItemStack lvWindmill = UtilsItems.simpleMetaStack("CompactWindmills:blockCompactWindmill", 1, 1);
+ public static ItemStack mvWindmill = UtilsItems.simpleMetaStack("CompactWindmills:blockCompactWindmill", 2, 1);
+ public static ItemStack hvWindmill = UtilsItems.simpleMetaStack("CompactWindmills:blockCompactWindmill", 3, 1);
+ public static ItemStack evWindmill = UtilsItems.simpleMetaStack("CompactWindmills:blockCompactWindmill", 4, 1);
+
+ //Compact Rotors
+ public static ItemStack rotor2 = UtilsItems.getItemStack("CompactWindmills:WOOL", 1);
+ public static ItemStack rotor1 = UtilsItems.getItemStack("CompactWindmills:WOOD", 1);
+ public static ItemStack rotor3 = UtilsItems.getItemStack("CompactWindmills:ALLOY", 1);
+ public static ItemStack rotor4 = UtilsItems.getItemStack("CompactWindmills:CARBON", 1);
+ public static ItemStack rotor5 = UtilsItems.getItemStack("CompactWindmills:IRIDIUM", 1);
+
+ //IC2 Rotors
+ public static ItemStack rotorIC1 = UtilsItems.getItemStack("IC2:itemwoodrotor", 1);
+ public static ItemStack rotorIC2 = UtilsItems.getItemStack("IC2:itemironrotor", 1);
+ public static ItemStack rotorIC3 = UtilsItems.getItemStack("IC2:itemsteelrotor", 1);
+ public static ItemStack rotorIC4 = UtilsItems.getItemStack("IC2:itemwcarbonrotor", 1);
+ public static ItemStack rotorBlade1 = UtilsItems.simpleMetaStack("IC2:itemRecipePart", 7, 1);
+ public static ItemStack rotorBlade2 = UtilsItems.simpleMetaStack("IC2:itemRecipePart", 8, 1);
+ public static ItemStack rotorBlade3 = UtilsItems.simpleMetaStack("IC2:itemRecipePart", 10, 1);
+ public static ItemStack rotorBlade4 = UtilsItems.simpleMetaStack("IC2:itemRecipePart", 9, 1);
+
+ //Plates
+ public static String plateTier1 = "ore:plateMagnalium";
+ public static String plateTier2 = "ore:plateStainlessSteel";
+ public static String plateTier3 = "ore:plateTitanium";
+ public static String plateTier4 = "ore:plateTungstenSteel";
+ public static String plateTier5 = "ore:plateNichrome";
+ public static String plateCarbon = "ore:plateAlloyCarbon";
+ public static String plateAlloy = "ore:plateAlloyAdvanced";
+
+ //Circuits
+ public static String circuitTier1 = "ore:circuitGood";
+ public static String circuitTier2 = "ore:circuitAdvanced";
+ public static String circuitTier3 = "ore:circuitData";
+ public static String circuitTier4 = "ore:circuitElite";
+ public static String circuitTier5 = "ore:circuitMaster";
+
+ //Wooden Rotor
+ public static ShapedRecipeObject Wooden_Rotor = new ShapedRecipeObject(
+ rotorBlade1, "ore:plateAnyIron", "ore:plateAnyIron",
+ "ore:screwAluminium", rotorIC1, "ore:screwAluminium",
+ rotorBlade1, "plateAnyIron", rotorBlade1,
+ rotor1);
+ //Alloy Rotor
+ public static ShapedRecipeObject Alloy_Rotor = new ShapedRecipeObject(
+ plateAlloy, plateAlloy, plateAlloy,
+ plateAlloy, rotorIC3, plateAlloy,
+ plateAlloy,plateAlloy, plateAlloy,
+ rotor3);
+ //Carbon Rotor
+ public static ShapedRecipeObject Carbon_Rotor = new ShapedRecipeObject(
+ plateCarbon, rotorBlade4, plateCarbon,
+ rotorBlade4, rotor3, rotorBlade4,
+ plateCarbon, rotorBlade4, plateCarbon,
+ rotor4);
+
+ //Kinetic Wind Turbine
+ public static ShapedRecipeObject KWT = new ShapedRecipeObject(
+ plateCarbon, shaftIron, plateCarbon,
+ cableCopper, mvCasing, cableCopper,
+ plateRubber, plateCarbon, plateRubber,
+ kineticWind);
+
+ //ELV Windmill
+ public static ShapedRecipeObject WM_ELV = new ShapedRecipeObject(
+
+ circuitTier1, elvTransformer, circuitTier1,
+ plateTier1, lvCasing, plateTier1,
+ plateTier1, rotor1, plateTier1,
+ elvWindmill);
+
+
+ //LV Windmill
+ public static ShapedRecipeObject WM_LV = new ShapedRecipeObject(
+ circuitTier2, lvTransformer, circuitTier2,
+ plateTier2, mvCasing, plateTier2,
+ plateTier2, rotor2, plateTier2,
+ lvWindmill);
+
+ //MV Windmill
+ public static ShapedRecipeObject WM_MV = new ShapedRecipeObject(
+ circuitTier3, mvTransformer, circuitTier3,
+ plateTier3, hvCasing, plateTier3,
+ plateTier3, rotor3, plateTier3,
+ mvWindmill);
+
+ //HV Windmill
+ public static ShapedRecipeObject WM_HV = new ShapedRecipeObject(
+ circuitTier4, hvTransformer, circuitTier4,
+ plateTier4, evCasing, plateTier4,
+ plateTier4, rotor4, plateTier4,
+ hvWindmill);
+
+ //EV Windmill
+ public static ShapedRecipeObject WM_EV = new ShapedRecipeObject(
+ circuitTier5, evTransformer, circuitTier5,
+ plateTier5, ivCasing, plateTier5,
+ plateTier5, rotor5, plateTier5,
+ evWindmill);
+
+ public static void OreDict(){
+ run();
+ }
+
+ private static final void run(){
+ //RemoveRecipeQueue.add("CompactWindmills:WOOL");
+ //RemoveRecipeQueue.add("CompactWindmills:WOOD");
+ //RemoveRecipeQueue.add("CompactWindmills:ALLOY");
+ //RemoveRecipeQueue.add("CompactWindmills:CARBON");
+ //RemoveRecipeQueue.add("CompactWindmills:IRIDIUM");
+
+ //Remove Recipes
+ RemoveRecipeQueue.add(kineticWind);
+ RemoveRecipeQueue.add(elvWindmill);
+ RemoveRecipeQueue.add(lvWindmill);
+ RemoveRecipeQueue.add(mvWindmill);
+ RemoveRecipeQueue.add(hvWindmill);
+ RemoveRecipeQueue.add(evWindmill);
+ RemoveRecipeQueue.add(rotor1);
+ RemoveRecipeQueue.add(rotor3);
+ RemoveRecipeQueue.add(rotor4);
+
+ //Add Recipes
+ AddRecipeQueue.add(Wooden_Rotor);
+ AddRecipeQueue.add(Alloy_Rotor);
+ AddRecipeQueue.add(Carbon_Rotor);
+ AddRecipeQueue.add(KWT);
+ AddRecipeQueue.add(WM_ELV);
+ AddRecipeQueue.add(WM_LV);
+ AddRecipeQueue.add(WM_MV);
+ AddRecipeQueue.add(WM_HV);
+ AddRecipeQueue.add(WM_EV);
+
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java
new file mode 100644
index 0000000000..d538b2df3d
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_EnderIO.java
@@ -0,0 +1,26 @@
+package gtPlusPlus.core.common.compat;
+
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.util.item.UtilsItems;
+import net.minecraft.item.ItemStack;
+
+public class COMPAT_EnderIO {
+
+ public static void OreDict(){
+ run();
+ }
+
+ private static final void run(){
+ UtilsItems.getItemForOreDict("EnderIO:itemAlloy", "ingotVibrantAlloy", "Vibrant Alloy Ingot", 2);
+ GT_OreDictUnificator.registerOre("plateConductiveIron", new ItemStack(ModItems.itemPlateConductiveIron));
+ GT_OreDictUnificator.registerOre("plateDarkSteel", new ItemStack(ModItems.itemPlateDarkSteel));
+ GT_OreDictUnificator.registerOre("plateElectricalSteel", new ItemStack(ModItems.itemPlateElectricalSteel));
+ GT_OreDictUnificator.registerOre("plateEnergeticAlloy", new ItemStack(ModItems.itemPlateEnergeticAlloy));
+ GT_OreDictUnificator.registerOre("platePulsatingIron", new ItemStack(ModItems.itemPlatePulsatingIron));
+ GT_OreDictUnificator.registerOre("plateRedstoneAlloy", new ItemStack(ModItems.itemPlateRedstoneAlloy));
+ GT_OreDictUnificator.registerOre("plateSoularium", new ItemStack(ModItems.itemPlateSoularium));
+ GT_OreDictUnificator.registerOre("plateVibrantAlloy", new ItemStack(ModItems.itemPlateVibrantAlloy));
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java
new file mode 100644
index 0000000000..c77f1475b9
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_ExtraUtils.java
@@ -0,0 +1,33 @@
+package gtPlusPlus.core.common.compat;
+
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.lib.CORE.configSwitches;
+import gtPlusPlus.core.recipe.RECIPES_Tools;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+import net.minecraft.item.ItemStack;
+
+public class COMPAT_ExtraUtils {
+
+ public static void OreDict(){
+ RECIPES_Tools.RECIPE_DivisionSigil = new ItemStack(UtilsItems.getItem("ExtraUtilities:divisionSigil"));
+ run();
+
+ }
+
+ private static final void run(){
+ UtilsItems.getItemForOreDict("ExtraUtilities:bedrockiumIngot", "ingotBedrockium", "Bedrockium Ingot", 0);
+ GT_OreDictUnificator.registerOre("plateBedrockium", new ItemStack(ModItems.itemPlateBedrockium));
+
+ if (configSwitches.enableAlternativeDivisionSigilRecipe){
+ //Division Sigil
+ UtilsRecipe.recipeBuilder(
+ "plateNetherStar", "gemIridium", "plateNetherStar",
+ "plateIridium", RECIPES_Tools.craftingToolHardHammer, "plateIridium",
+ "plateNetherStar", "gemIridium", "plateNetherStar",
+ RECIPES_Tools.RECIPE_DivisionSigil);
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_IC2.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_IC2.java
new file mode 100644
index 0000000000..14ec5dfd4d
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_IC2.java
@@ -0,0 +1,62 @@
+package gtPlusPlus.core.common.compat;
+
+
+import static gtPlusPlus.core.handler.COMPAT_HANDLER.RemoveRecipeQueue;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.lib.CORE.configSwitches;
+import gtPlusPlus.core.recipe.ShapedRecipeObject;
+import gtPlusPlus.core.util.item.UtilsItems;
+import net.minecraft.item.ItemStack;
+
+
+public class COMPAT_IC2 {
+
+ private static ItemStack itemCropnalyzer = UtilsItems.simpleMetaStack("IC2:itemCropnalyzer", 0, 1);
+ private static ItemStack itemSolarHelmet = UtilsItems.simpleMetaStack("IC2:itemSolarHelmet", 0, 1);
+
+ public static ShapedRecipeObject Cropnalyzer = new ShapedRecipeObject(
+ "ore:cableGt02Copper", "ore:cableGt02Copper", null,
+ "minecraft:redstone", "ore:blockGlass", "minecraft:redstone",
+ "minecraft:redstone", "ore:circuitBasic", "minecraft:redstone",
+ itemCropnalyzer);
+ public static ShapedRecipeObject SolarHelmet = new ShapedRecipeObject(
+ "ore:plateIron", "ore:plateIron", "ore:plateIron",
+ "ore:plateIron", "gregtech:gt.metaitem.01:32750", "ore:plateIron",
+ "ore:craftingWireCopper", "ore:craftingWireCopper", "ore:craftingWireCopper",
+ itemSolarHelmet);
+
+
+
+ public static void OreDict(){
+ //Get ItemStacks for results
+ /*itemCropnalyzer = UtilsItems.getItemStack("IC2:itemCropnalyzer", 1);
+ itemSolarHelmet = UtilsItems.getItemStack("IC2:itemSolarHelmet", 1); */
+ run();
+ }
+
+ private static final void run(){
+
+ if (configSwitches.disableIC2Recipes){
+
+
+
+ if (LoadedMods.Gregtech){
+ //Fuck these right off.
+ RemoveRecipeQueue.add("IC2:itemCable");
+ RemoveRecipeQueue.add("IC2:itemCable:1");
+ RemoveRecipeQueue.add("IC2:itemCable:2");
+ RemoveRecipeQueue.add("IC2:itemCable:3");
+ RemoveRecipeQueue.add("IC2:itemCable:5");
+ RemoveRecipeQueue.add("IC2:itemCable:6");
+ RemoveRecipeQueue.add("IC2:itemCable:10");
+ RemoveRecipeQueue.add("IC2:itemCable:13");
+ //RemoveRecipeQueue.add(itemCropnalyzer);
+ //RemoveRecipeQueue.add(itemSolarHelmet);
+
+ //AddRecipeQueue.add(Cropnalyzer);
+ //AddRecipeQueue.add(SolarHelmet);
+ }
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java
new file mode 100644
index 0000000000..3a996ed849
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_MorePlanets.java
@@ -0,0 +1,37 @@
+package gtPlusPlus.core.common.compat;
+
+import gtPlusPlus.core.util.item.UtilsItems;
+
+public class COMPAT_MorePlanets {
+
+
+ public static void OreDict(){
+ run();
+ }
+
+ private final static void run(){
+ //Metals
+ UtilsItems.getItemForOreDict("MorePlanet:kapteyn-b_item", "ingotFrozenIron", "Frozen Iron Ingot", 0);
+ UtilsItems.getItemForOreDict("MorePlanet:kapteyn-b_item", "ingotAnyIron", "Frozen Iron Ingot", 0);
+ UtilsItems.getItemForOreDict("MorePlanet:polongnius_item", "ingotPalladium", "Palladium Ingot", 5);
+ UtilsItems.getItemForOreDict("MorePlanet:fronos_item", "ingotIridium", "Iridium Ingot", 3);
+ UtilsItems.getItemForOreDict("MorePlanet:nibiru_item", "ingotNorium", "Norium Ingot", 1);
+ UtilsItems.getItemForOreDict("MorePlanet:venus_item", "ingotLead", "Lead Ingot", 0);
+ UtilsItems.getItemForOreDict("MorePlanet:diona_item", "ingotQuontonium", "Quontonium Ingot", 0);
+ UtilsItems.getItemForOreDict("MorePlanet:diona_item", "ingotFronisium", "Fronisium Ingot", 1);
+ UtilsItems.getItemForOreDict("MorePlanet:sirius-b_item", "ingotSulfur", "Sulfur Ingot", 3);
+ UtilsItems.getItemForOreDict("MorePlanet:koentus_item", "ingotKoentusMeteoricIron", "Koentus Meteoric Iron Ingot", 4);
+ UtilsItems.getItemForOreDict("MorePlanet:mercury_item", "ingotMetallic", "Metallic Ingot", 2);
+ UtilsItems.getItemForOreDict("MorePlanet:polongnius_item", "ingotPolongiusMeteoricIron", "Polongius Meteoric Iron Ingot", 4);
+ UtilsItems.getItemForOreDict("MorePlanet:mercury_item", "ingotMeteoricSteel", "Meteoric Steel Ingot", 3);
+ UtilsItems.getItemForOreDict("MorePlanet:sirius-b_item", "dustSulfur", "Sulfur Dust", 2);
+
+ //Gems
+ UtilsItems.getItemForOreDict("MorePlanet:fronos_item", "gemBlackDiamond", "Black Diamond Gem", 2);
+ UtilsItems.getItemForOreDict("MorePlanet:koentus_item", "gemWhiteCrystal", "White Crystal", 0);
+ UtilsItems.getItemForOreDict("MorePlanet:nibiru_item", "gemRedCrystal", "Red Crystal", 0);
+ UtilsItems.getItemForOreDict("MorePlanet:pluto_item", "gemXeonius", "Xeonius Gem", 0);
+ UtilsItems.getItemForOreDict("MorePlanet:kapteyn-b_item", "gemUranium", "Uranium Gem", 1);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_PneumaticCraft.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_PneumaticCraft.java
new file mode 100644
index 0000000000..d471535e81
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_PneumaticCraft.java
@@ -0,0 +1,17 @@
+package gtPlusPlus.core.common.compat;
+
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.item.ModItems;
+import net.minecraft.item.ItemStack;
+
+public class COMPAT_PneumaticCraft {
+
+ public static void OreDict(){
+ run();
+ }
+
+ private static final void run(){
+ GT_OreDictUnificator.registerOre("plateCompressedIron", new ItemStack(ModItems.itemPlateCompressedIron));
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_RFTools.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_RFTools.java
new file mode 100644
index 0000000000..4db8006a89
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_RFTools.java
@@ -0,0 +1,18 @@
+package gtPlusPlus.core.common.compat;
+
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.item.ModItems;
+import net.minecraft.item.ItemStack;
+
+public class COMPAT_RFTools {
+
+ public static void OreDict(){
+ run();
+ }
+
+ private static final void run(){
+ GT_OreDictUnificator.registerOre("plateDimensionShard", new ItemStack(ModItems.itemPlateDimensionShard));
+
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_SimplyJetpacks.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_SimplyJetpacks.java
new file mode 100644
index 0000000000..6d7f08b55d
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_SimplyJetpacks.java
@@ -0,0 +1,18 @@
+package gtPlusPlus.core.common.compat;
+
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.item.ModItems;
+import net.minecraft.item.ItemStack;
+
+public class COMPAT_SimplyJetpacks {
+
+ public static void OreDict(){
+ run();
+ }
+
+ private static final void run(){
+ GT_OreDictUnificator.registerOre("plateEnrichedSoularium", new ItemStack(ModItems.itemPlateEnrichedSoularium));
+
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java b/src/Java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java
new file mode 100644
index 0000000000..87fde9fa96
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/common/compat/COMPAT_Thaumcraft.java
@@ -0,0 +1,47 @@
+package gtPlusPlus.core.common.compat;
+
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.lib.CORE.configSwitches;
+import gtPlusPlus.core.util.item.UtilsItems;
+import net.minecraft.item.ItemStack;
+
+public class COMPAT_Thaumcraft {
+
+ public static void OreDict(){
+ UtilsItems.getItemForOreDict("Thaumcraft:ItemResource", "ingotVoidMetal", "Void Metal Ingot", 16);
+ GT_OreDictUnificator.registerOre("plateVoidMetal", new ItemStack(ModItems.itemPlateVoidMetal));
+ if (configSwitches.enableThaumcraftShardUnification){
+ run();
+ }
+ }
+
+ private static final void run(){
+
+ for(int i=0; i<=6; i++){
+ //Utils.LOG_INFO(""+i);
+ UtilsItems.getItemForOreDict("Thaumcraft:ItemShard", "shardAny", "TC Shard "+i, i);
+ GT_OreDictUnificator.registerOre("shardAny", UtilsItems.getItemStack("Thaumcraft:ItemShard:"+i, 1));
+ UtilsItems.getItemForOreDict("Thaumcraft:ItemShard", "gemInfusedAnything", "TC Shard "+i, i);
+ GT_OreDictUnificator.registerOre("gemInfusedAnything", UtilsItems.getItemStack("Thaumcraft:ItemShard:"+i, 1));
+ //System.out.println("TC Shard registration count is: "+i);
+ }
+
+ if (LoadedMods.ForbiddenMagic){
+ for(int i=0; i<=6; i++){
+ //Utils.LOG_INFO(""+i);
+ UtilsItems.getItemForOreDict("ForbiddenMagic:NetherShard", "shardAny", "FM Shard "+i, i);
+ GT_OreDictUnificator.registerOre("shardAny", UtilsItems.getItemStack("ForbiddenMagic:NetherShard:"+i, 1));
+ UtilsItems.getItemForOreDict("ForbiddenMagic:NetherShard", "gemInfusedAnything", "FM Shard "+i, i);
+ GT_OreDictUnificator.registerOre("gemInfusedAnything", UtilsItems.getItemStack("ForbiddenMagic:NetherShard:"+i, 1));
+ //System.out.println("TC Shard registration count is: "+i);
+ }
+ UtilsItems.getItemForOreDict("ForbiddenMagic:GluttonyShard", "shardAny", "FM Gluttony Shard", 0);
+ GT_OreDictUnificator.registerOre("shardAny", UtilsItems.getItemStack("ForbiddenMagic:GluttonyShard", 1));
+ UtilsItems.getItemForOreDict("ForbiddenMagic:GluttonyShard", "gemInfusedAnything", "FM Gluttony Shard", 0);
+ GT_OreDictUnificator.registerOre("gemInfusedAnything", UtilsItems.getItemStack("ForbiddenMagic:GluttonyShard", 1));
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/container/Container_BackpackBase.java b/src/Java/gtPlusPlus/core/container/Container_BackpackBase.java
new file mode 100644
index 0000000000..f156f6dcaf
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/container/Container_BackpackBase.java
@@ -0,0 +1,206 @@
+package gtPlusPlus.core.container;
+
+import gtPlusPlus.core.inventories.BaseInventoryBackpack;
+import gtPlusPlus.core.slots.SlotItemBackpackInv;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class Container_BackpackBase extends Container
+{
+ /** The Item Inventory for this Container, only needed if you want to reference isUseableByPlayer */
+ public final BaseInventoryBackpack inventory;
+
+ /** Using these will make transferStackInSlot easier to understand and implement
+ * INV_START is the index of the first slot in the Player's Inventory, so our
+ * BaseInventoryBackpack's number of slots (e.g. 5 slots is array indices 0-4, so start at 5)
+ * Notice how we don't have to remember how many slots we made? We can just use
+ * BaseInventoryBackpack.INV_SIZE and if we ever change it, the Container updates automatically. */
+ private static final int INV_START = BaseInventoryBackpack.INV_SIZE, INV_END = INV_START+26,
+ HOTBAR_START = INV_END+1, HOTBAR_END = HOTBAR_START+8;
+
+ // If you're planning to add armor slots, put those first like this:
+ // ARMOR_START = BaseInventoryBackpack.INV_SIZE, ARMOR_END = ARMOR_START+3,
+ // INV_START = ARMOR_END+1, and then carry on like above.
+
+ public Container_BackpackBase(EntityPlayer par1Player, InventoryPlayer inventoryPlayer, BaseInventoryBackpack inventoryItem)
+ {
+ this.inventory = inventoryItem;
+
+ int i;
+
+ // ITEM INVENTORY - you'll need to adjust the slot locations to match your texture file
+ // I have them set vertically in columns of 4 to the right of the player model
+ for (i = 0; i < BaseInventoryBackpack.INV_SIZE; ++i)
+ {
+ // You can make a custom Slot if you need different behavior,
+ // such as only certain item types can be put into this slot
+ // We made a custom slot to prevent our inventory-storing item
+ // from being stored within itself, but if you want to allow that and
+ // you followed my advice at the end of the above step, then you
+ // could get away with using the vanilla Slot class
+ this.addSlotToContainer(new SlotItemBackpackInv(this.inventory, i, 80 + (18 * (int)(i/4)), 8 + (18*(i%4))));
+ }
+
+ // If you want, you can add ARMOR SLOTS here as well, but you need to
+ // make a public version of SlotArmor. I won't be doing that in this tutorial.
+ /*
+ for (i = 0; i < 4; ++i)
+ {
+ // These are the standard positions for survival inventory layout
+ this.addSlotToContainer(new SlotArmor(this.player, inventoryPlayer, inventoryPlayer.getSizeInventory() - 1 - i, 8, 8 + i * 18, i));
+ }
+ */
+
+ // PLAYER INVENTORY - uses default locations for standard inventory texture file
+ for (i = 0; i < 3; ++i)
+ {
+ for (int j = 0; j < 9; ++j)
+ {
+ this.addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
+ }
+ }
+
+ // PLAYER ACTION BAR - uses default locations for standard action bar texture file
+ for (i = 0; i < 9; ++i)
+ {
+ this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142));
+ }
+ }
+
+ @Override
+ public boolean canInteractWith(EntityPlayer entityplayer)
+ {
+ // be sure to return the inventory's isUseableByPlayer method
+ // if you defined special behavior there:
+ return inventory.isUseableByPlayer(entityplayer);
+ }
+
+ /**
+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
+ */
+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int index)
+ {
+ ItemStack itemstack = null;
+ Slot slot = (Slot) this.inventorySlots.get(index);
+
+ if (slot != null && slot.getHasStack())
+ {
+ ItemStack itemstack1 = slot.getStack();
+ itemstack = itemstack1.copy();
+
+ // If item is in our custom Inventory or armor slot
+ if (index < INV_START)
+ {
+ // try to place in player inventory / action bar
+ if (!this.mergeItemStack(itemstack1, INV_START, HOTBAR_END+1, true))
+ {
+ return null;
+ }
+
+ slot.onSlotChange(itemstack1, itemstack);
+ }
+ // Item is in inventory / hotbar, try to place in custom inventory or armor slots
+ else
+ {
+ /*
+ 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 (itemstack1.getItem() instanceof ItemCustom)
+ {
+ // Try to merge into your custom inventory slots
+ // We use 'BaseInventoryBackpack.INV_SIZE' instead of INV_START just in case
+ // you also add armor or other custom slots
+ if (!this.mergeItemStack(itemstack1, 0, BaseInventoryBackpack.INV_SIZE, false))
+ {
+ return null;
+ }
+ }
+ // If you added armor slots, check them here as well:
+ // Item being shift-clicked is armor - try to put in armor slot
+ if (itemstack1.getItem() instanceof ItemArmor)
+ {
+ int type = ((ItemArmor) itemstack1.getItem()).armorType;
+ if (!this.mergeItemStack(itemstack1, ARMOR_START + type, ARMOR_START + type + 1, false))
+ {
+ return null;
+ }
+ }
+ Otherwise, you have basically 2 choices:
+ 1. shift-clicking between player inventory and custom inventory
+ 2. shift-clicking between action bar and inventory
+
+ Be sure to choose only ONE of the following implementations!!!
+ */
+ /**
+ * Implementation number 1: Shift-click into your custom inventory
+ */
+ if (index >= INV_START)
+ {
+ // place in custom inventory
+ if (!this.mergeItemStack(itemstack1, 0, INV_START, false))
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Implementation number 2: Shift-click items between action bar and inventory
+ */
+ // item is in player's inventory, but not in action bar
+ if (index >= INV_START && index < HOTBAR_START)
+ {
+ // place in action bar
+ if (!this.mergeItemStack(itemstack1, HOTBAR_START, HOTBAR_END+1, false))
+ {
+ return null;
+ }
+ }
+ // item in action bar - place in player inventory
+ else if (index >= HOTBAR_START && index < HOTBAR_END+1)
+ {
+ if (!this.mergeItemStack(itemstack1, INV_START, INV_END+1, false))
+ {
+ return null;
+ }
+ }
+ }
+
+ if (itemstack1.stackSize == 0)
+ {
+ slot.putStack((ItemStack) null);
+ }
+ else
+ {
+ slot.onSlotChanged();
+ }
+
+ if (itemstack1.stackSize == itemstack.stackSize)
+ {
+ return null;
+ }
+
+ slot.onPickupFromSlot(par1EntityPlayer, itemstack1);
+ }
+
+ return itemstack;
+ }
+
+ /**
+ * You should override this method to prevent the player from moving the stack that
+ * opened the inventory, otherwise if the player moves it, the inventory will not
+ * be able to save properly
+ */
+ @Override
+ public ItemStack slotClick(int slot, int button, int flag, EntityPlayer player) {
+ // this will prevent the player from interacting with the item that opened the inventory:
+ if (slot >= 0 && getSlot(slot) != null && getSlot(slot).getStack() == player.getHeldItem()) {
+ return null;
+ }
+ return super.slotClick(slot, button, flag, player);
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/container/Container_Charger.java b/src/Java/gtPlusPlus/core/container/Container_Charger.java
new file mode 100644
index 0000000000..4b6c43ada6
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/container/Container_Charger.java
@@ -0,0 +1,81 @@
+package gtPlusPlus.core.container;
+
+import gtPlusPlus.core.tileentities.machines.TileEntityCharger;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class Container_Charger extends Container
+{
+ private TileEntityCharger te;
+
+ public static final int INPUT_1 = 0;
+
+ private int slotID = 0;
+
+ public Container_Charger(TileEntityCharger te, EntityPlayer player)
+ {
+ this.te = te;
+
+ //Fuel Slot A
+ addSlotToContainer(new Slot(te, slotID++, 80, 53));
+
+
+
+ //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++)
+ {
+ addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
+ }
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw)
+ {
+ ItemStack stack = null;
+ Slot slot = (Slot)inventorySlots.get(slotRaw);
+
+ if (slot != null && slot.getHasStack())
+ {
+ ItemStack stackInSlot = slot.getStack();
+ stack = stackInSlot.copy();
+
+ if (slotRaw < 3 * 9)
+ {
+ if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true))
+ {
+ return null;
+ }
+ }
+ else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false))
+ {
+ return null;
+ }
+
+ if (stackInSlot.stackSize == 0)
+ {
+ slot.putStack((ItemStack)null);
+ }
+ 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/core/container/Container_NHG.java b/src/Java/gtPlusPlus/core/container/Container_NHG.java
new file mode 100644
index 0000000000..64a84ce680
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/container/Container_NHG.java
@@ -0,0 +1,104 @@
+package gtPlusPlus.core.container;
+
+import gtPlusPlus.core.tileentities.machines.TileEntityNHG;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.Slot;
+import net.minecraft.inventory.SlotFurnace;
+import net.minecraft.item.ItemStack;
+
+public class Container_NHG extends Container
+{
+ private TileEntityNHG te;
+
+ public static final int INPUT_1 = 0, INPUT_2 = 1, INPUT_3 = 2,
+ INPUT_4 = 3, INPUT_5 = 4, INPUT_6 = 5,
+ INPUT_7 = 6, INPUT_8 = 7, INPUT_9 = 8,
+ INPUT_10 = 9, INPUT_11 = 10, INPUT_12 = 11,
+ INPUT_13 = 12, INPUT_14 = 13, INPUT_15 = 14,
+ INPUT_16 = 15, INPUT_17 = 16, INPUT_18 = 17,
+ OUTPUT = 18;
+
+ private int slotID = 0;
+
+ public Container_NHG(TileEntityNHG te, EntityPlayer player)
+ {
+ this.te = te;
+
+
+ //Fuel Rods A
+ for (int i = 0; i < 3; i++)
+ {
+ for (int j = 0; j < 3; j++)
+ {
+ addSlotToContainer(new Slot(te, slotID++, 8 + j * 18, 17 + i * 18));
+ }
+ }
+ //Fuel Rods B
+ for (int i = 0; i < 3; i++)
+ {
+ for (int j = 0; j < 3; j++)
+ {
+ addSlotToContainer(new Slot(te, slotID++, 116 + j * 18, 17 + i * 18));
+ }
+ }
+
+ //Output
+ addSlotToContainer(new SlotFurnace(player, te, OUTPUT, 80, 53));
+
+ //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++)
+ {
+ addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
+ }
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw)
+ {
+ ItemStack stack = null;
+ Slot slot = (Slot)inventorySlots.get(slotRaw);
+
+ if (slot != null && slot.getHasStack())
+ {
+ ItemStack stackInSlot = slot.getStack();
+ stack = stackInSlot.copy();
+
+ if (slotRaw < 3 * 9)
+ {
+ if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true))
+ {
+ return null;
+ }
+ }
+ else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false))
+ {
+ return null;
+ }
+
+ if (stackInSlot.stackSize == 0)
+ {
+ slot.putStack((ItemStack)null);
+ }
+ 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/core/creative/AddToCreativeTab.java b/src/Java/gtPlusPlus/core/creative/AddToCreativeTab.java
new file mode 100644
index 0000000000..31613f2b85
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/creative/AddToCreativeTab.java
@@ -0,0 +1,31 @@
+package gtPlusPlus.core.creative;
+
+import gtPlusPlus.core.creative.tabs.MiscUtilCreativeTabBlock;
+import gtPlusPlus.core.creative.tabs.MiscUtilCreativeTabMachines;
+import gtPlusPlus.core.creative.tabs.MiscUtilCreativeTabMisc;
+import gtPlusPlus.core.creative.tabs.MiscUtilCreativeTabOther;
+import gtPlusPlus.core.creative.tabs.MiscUtilCreativeTabTools;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.creativetab.CreativeTabs;
+
+public class AddToCreativeTab {
+
+ public static CreativeTabs tabBlock;
+ public static CreativeTabs tabMisc;
+ public static CreativeTabs tabCombat;
+ public static CreativeTabs tabTools;
+ public static CreativeTabs tabMachines;
+ public static CreativeTabs tabOther;
+
+ public static void initialiseTabs(){
+ tabBlock = new MiscUtilCreativeTabBlock("MiscUtilBlockTab");
+ tabMisc = new MiscUtilCreativeTabMisc("MiscUtilMiscTab");
+ tabTools = new MiscUtilCreativeTabTools("MiscUtilToolsTab");
+ tabMachines = new MiscUtilCreativeTabMachines("MiscUtilMachineTab");
+ tabOther = new MiscUtilCreativeTabOther("MiscUtilOtherTab");
+
+ if (CORE.DEBUG){
+ //tabCombat = new MiscUtilCreativeTabCombat("MiscUtilCombatTab");
+ }
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java
new file mode 100644
index 0000000000..1220fb1af8
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabBlock.java
@@ -0,0 +1,18 @@
+package gtPlusPlus.core.creative.tabs;
+
+import gtPlusPlus.core.block.ModBlocks;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+
+public class MiscUtilCreativeTabBlock extends CreativeTabs {
+
+ public MiscUtilCreativeTabBlock(String lable) {
+ super(lable);
+ }
+
+ @Override
+ public Item getTabIconItem() {
+ return Item.getItemFromBlock(ModBlocks.MatterFabricatorEffectBlock);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java
new file mode 100644
index 0000000000..932f80ed7f
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMachines.java
@@ -0,0 +1,19 @@
+package gtPlusPlus.core.creative.tabs;
+
+import gtPlusPlus.core.item.ModItems;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+
+public class MiscUtilCreativeTabMachines extends CreativeTabs {
+
+
+ public MiscUtilCreativeTabMachines(String lable) {
+ super(lable);
+ }
+
+ @Override
+ public Item getTabIconItem() {
+ return ModItems.itemPLACEHOLDER_Circuit;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java
new file mode 100644
index 0000000000..619803e6e1
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabMisc.java
@@ -0,0 +1,18 @@
+package gtPlusPlus.core.creative.tabs;
+
+import gtPlusPlus.core.item.ModItems;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+
+public class MiscUtilCreativeTabMisc extends CreativeTabs {
+
+ public MiscUtilCreativeTabMisc(String lable) {
+ super(lable);
+ }
+
+ @Override
+ public Item getTabIconItem() {
+ return ModItems.itemFoodCurriedSausages;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java
new file mode 100644
index 0000000000..6b7c55fcb8
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabOther.java
@@ -0,0 +1,18 @@
+package gtPlusPlus.core.creative.tabs;
+
+import gtPlusPlus.core.item.ModItems;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+
+public class MiscUtilCreativeTabOther extends CreativeTabs {
+
+ public MiscUtilCreativeTabOther(String lable) {
+ super(lable);
+ }
+
+ @Override
+ public Item getTabIconItem() {
+ return ModItems.backpack_Green;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java
new file mode 100644
index 0000000000..fe61ea6f11
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/creative/tabs/MiscUtilCreativeTabTools.java
@@ -0,0 +1,18 @@
+package gtPlusPlus.core.creative.tabs;
+
+import gtPlusPlus.core.item.ModItems;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+
+public class MiscUtilCreativeTabTools extends CreativeTabs {
+
+ public MiscUtilCreativeTabTools(String lable) {
+ super(lable);
+ }
+
+ @Override
+ public Item getTabIconItem() {
+ return ModItems.itemStaballoyAxe;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/entity/EntityTeleportFX.java b/src/Java/gtPlusPlus/core/entity/EntityTeleportFX.java
new file mode 100644
index 0000000000..eff516c289
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/entity/EntityTeleportFX.java
@@ -0,0 +1,236 @@
+package gtPlusPlus.core.entity;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class EntityTeleportFX extends Entity
+{
+ /** 'x' location the eye should float towards. */
+ private double targetX;
+ /** 'y' location the eye should float towards. */
+ private double targetY;
+ /** 'z' location the eye should float towards. */
+ private double targetZ;
+ private int despawnTimer;
+ private boolean shatterOrDrop;
+ private static final String __OBFID = "CL_00001716";
+
+ public EntityTeleportFX(World p_i1757_1_)
+ {
+ super(p_i1757_1_);
+ this.setSize(0.25F, 0.25F);
+ }
+
+ protected void entityInit() {}
+
+ /**
+ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge
+ * length * 64 * renderDistanceWeight Args: distance
+ */
+ @SideOnly(Side.CLIENT)
+ public boolean isInRangeToRenderDist(double p_70112_1_)
+ {
+ double d1 = this.boundingBox.getAverageEdgeLength() * 4.0D;
+ d1 *= 64.0D;
+ return p_70112_1_ < d1 * d1;
+ }
+
+ public EntityTeleportFX(World p_i1758_1_, double p_i1758_2_, double p_i1758_4_, double p_i1758_6_)
+ {
+ super(p_i1758_1_);
+ this.despawnTimer = 0;
+ this.setSize(0.25F, 0.25F);
+ this.setPosition(p_i1758_2_, p_i1758_4_, p_i1758_6_);
+ this.yOffset = 0.0F;
+ }
+
+ /**
+ * The location the eye should float/move towards. Currently used for moving towards the nearest stronghold. Args:
+ * strongholdX, strongholdY, strongholdZ
+ */
+ public void moveTowards(double p_70220_1_, int p_70220_3_, double p_70220_4_)
+ {
+ double d2 = p_70220_1_ - this.posX;
+ double d3 = p_70220_4_ - this.posZ;
+ float f = MathHelper.sqrt_double(d2 * d2 + d3 * d3);
+
+ if (f > 12.0F)
+ {
+ this.targetX = this.posX + d2 / (double)f * 12.0D;
+ this.targetZ = this.posZ + d3 / (double)f * 12.0D;
+ this.targetY = this.posY + 8.0D;
+ }
+ else
+ {
+ this.targetX = p_70220_1_;
+ this.targetY = (double)p_70220_3_;
+ this.targetZ = p_70220_4_;
+ }
+
+ this.despawnTimer = 0;
+ this.shatterOrDrop = this.rand.nextInt(5) > 0;
+ }
+
+ /**
+ * Sets the velocity to the args. Args: x, y, z
+ */
+ @SideOnly(Side.CLIENT)
+ public void setVelocity(double p_70016_1_, double p_70016_3_, double p_70016_5_)
+ {
+ this.motionX = p_70016_1_;
+ this.motionY = p_70016_3_;
+ this.motionZ = p_70016_5_;
+
+ if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
+ {
+ float f = MathHelper.sqrt_double(p_70016_1_ * p_70016_1_ + p_70016_5_ * p_70016_5_);
+ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(p_70016_1_, p_70016_5_) * 180.0D / Math.PI);
+ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(p_70016_3_, (double)f) * 180.0D / Math.PI);
+ }
+ }
+
+ /**
+ * Called to update the entity's position/logic.
+ */
+ public void onUpdate()
+ {
+ this.lastTickPosX = this.posX;
+ this.lastTickPosY = this.posY;
+ this.lastTickPosZ = this.posZ;
+ super.onUpdate();
+ this.posX += this.motionX;
+ this.posY += this.motionY;
+ this.posZ += this.motionZ;
+ float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
+ this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
+
+ for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)f) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
+ {
+ ;
+ }
+
+ while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
+ {
+ this.prevRotationPitch += 360.0F;
+ }
+
+ while (this.rotationYaw - this.prevRotationYaw < -180.0F)
+ {
+ this.prevRotationYaw -= 360.0F;
+ }
+
+ while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
+ {
+ this.prevRotationYaw += 360.0F;
+ }
+
+ this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
+ this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
+
+ if (!this.worldObj.isRemote)
+ {
+ double d0 = this.targetX - this.posX;
+ double d1 = this.targetZ - this.posZ;
+ float f1 = (float)Math.sqrt(d0 * d0 + d1 * d1);
+ float f2 = (float)Math.atan2(d1, d0);
+ double d2 = (double)f + (double)(f1 - f) * 0.0025D;
+
+ if (f1 < 1.0F)
+ {
+ d2 *= 0.8D;
+ this.motionY *= 0.8D;
+ }
+
+ this.motionX = Math.cos((double)f2) * d2;
+ this.motionZ = Math.sin((double)f2) * d2;
+
+ if (this.posY < this.targetY)
+ {
+ this.motionY += (1.0D - this.motionY) * 0.014999999664723873D;
+ }
+ else
+ {
+ this.motionY += (-1.0D - this.motionY) * 0.014999999664723873D;
+ }
+ }
+
+ float f3 = 0.25F;
+
+ if (this.isInWater())
+ {
+ for (int i = 0; i < 4; ++i)
+ {
+ this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ);
+ }
+ }
+ else
+ {
+ this.worldObj.spawnParticle("portal", this.posX - this.motionX * (double)f3 + this.rand.nextDouble() * 0.6D - 0.3D, this.posY - this.motionY * (double)f3 - 0.5D, this.posZ - this.motionZ * (double)f3 + this.rand.nextDouble() * 0.6D - 0.3D, this.motionX, this.motionY, this.motionZ);
+ }
+
+ if (!this.worldObj.isRemote)
+ {
+ this.setPosition(this.posX, this.posY, this.posZ);
+ ++this.despawnTimer;
+
+ if (this.despawnTimer > 80 && !this.worldObj.isRemote)
+ {
+ this.setDead();
+
+ if (this.shatterOrDrop)
+ {
+ this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Items.ender_eye)));
+ }
+ else
+ {
+ this.worldObj.playAuxSFX(2003, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0);
+ }
+ }
+ }
+ }
+
+ /**
+ * (abstract) Protected helper method to write subclass entity data to NBT.
+ */
+ public void writeEntityToNBT(NBTTagCompound p_70014_1_) {}
+
+ /**
+ * (abstract) Protected helper method to read subclass entity data from NBT.
+ */
+ public void readEntityFromNBT(NBTTagCompound p_70037_1_) {}
+
+ @SideOnly(Side.CLIENT)
+ public float getShadowSize()
+ {
+ return 0.0F;
+ }
+
+ /**
+ * Gets how bright this entity is.
+ */
+ public float getBrightness(float p_70013_1_)
+ {
+ return 1.0F;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public int getBrightnessForRender(float p_70070_1_)
+ {
+ return 15728880;
+ }
+
+ /**
+ * If returns false, the item will not inflict any damage against entities.
+ */
+ public boolean canAttackWithItem()
+ {
+ return false;
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java b/src/Java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java
new file mode 100644
index 0000000000..b3531ceb3e
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/gui/beta/Gui_ID_Registry.java
@@ -0,0 +1,56 @@
+package gtPlusPlus.core.gui.beta;
+
+import gtPlusPlus.core.interfaces.IGuiManagerMiscUtils;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class Gui_ID_Registry
+{
+ private static final Map<Class<? extends IGuiManagerMiscUtils>, MU_GuiId> classMap = new HashMap();
+ private static final Map<Integer, MU_GuiId> idMap = new HashMap();
+ private static int nextId = 0;
+
+ static
+ {
+ //registerGuiHandlers(Gui_Types.Tile, Arrays.asList(new Class[] {TileAlveary.class}));
+ //registerGuiHandlers(MU_GuiType.Item, Arrays.asList(new Class[] { ItemBackpack.class, ItemBackpackNaturalist.class, ItemBeealyzer.class, ItemCatalogue.class, ItemFlutterlyzer.class, ItemHabitatLocator.class, ItemImprinter.class, ItemInfuser.class, ItemLetter.class, ItemSolderingIron.class, ItemTreealyzer.class }));
+ //registerGuiHandlers(MU_GuiType.Entity, Arrays.asList(new Class[] { EntityMinecartApiary.class, EntityMinecartBeehouse.class }));
+ }
+
+ private static void registerGuiHandlers(Gui_Types MU_GuiType, List<Class<? extends IGuiManagerMiscUtils>> guiHandlerClasses)
+ {
+ for (Class<? extends IGuiManagerMiscUtils> tileGuiHandlerClass : guiHandlerClasses)
+ {
+ MU_GuiId guiId = new MU_GuiId(nextId++, MU_GuiType, tileGuiHandlerClass);
+ classMap.put(tileGuiHandlerClass, guiId);
+ idMap.put(Integer.valueOf(guiId.getId()), guiId);
+ }
+ }
+
+ public static MU_GuiId getGuiIdForGuiHandler(IGuiManagerMiscUtils guiHandler)
+ {
+ Class<? extends IGuiManagerMiscUtils> guiHandlerClass = guiHandler.getClass();
+ MU_GuiId guiId = (MU_GuiId)classMap.get(guiHandlerClass);
+ if (guiId == null) {
+ for (Map.Entry<Class<? extends IGuiManagerMiscUtils>, MU_GuiId> classGuiIdEntry : classMap.entrySet()) {
+ if (((Class)classGuiIdEntry.getKey()).isAssignableFrom(guiHandlerClass))
+ {
+ guiId = (MU_GuiId)classGuiIdEntry.getValue();
+ break;
+ }
+ }
+ }
+ if (guiId == null) {
+ throw new IllegalStateException("No gui ID for gui handler: " + guiHandler);
+ }
+ return guiId;
+ }
+
+ public static MU_GuiId getGuiId(int id)
+ {
+ return (MU_GuiId)idMap.get(Integer.valueOf(id));
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/gui/beta/Gui_Types.java b/src/Java/gtPlusPlus/core/gui/beta/Gui_Types.java
new file mode 100644
index 0000000000..428cae93d5
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/gui/beta/Gui_Types.java
@@ -0,0 +1,8 @@
+package gtPlusPlus.core.gui.beta;
+
+public enum Gui_Types
+ {
+ Item, Tile, Entity;
+
+ private Gui_Types() {}
+ } \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/gui/beta/MU_GuiId.java b/src/Java/gtPlusPlus/core/gui/beta/MU_GuiId.java
new file mode 100644
index 0000000000..7d17870743
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/gui/beta/MU_GuiId.java
@@ -0,0 +1,32 @@
+package gtPlusPlus.core.gui.beta;
+import gtPlusPlus.core.interfaces.IGuiManagerMiscUtils;
+
+public class MU_GuiId
+ {
+ private final int id;
+ private final Gui_Types MU_GuiType;
+ private final Class<? extends IGuiManagerMiscUtils> guiHandlerClass;
+
+ MU_GuiId(int id, Gui_Types MU_GuiType, Class<? extends IGuiManagerMiscUtils> guiHandlerClass)
+ {
+ this.id = id;
+ this.MU_GuiType = MU_GuiType;
+ this.guiHandlerClass = guiHandlerClass;
+ }
+
+ public Gui_Types getGuiType()
+ {
+ return this.MU_GuiType;
+ }
+
+ public Class<? extends IGuiManagerMiscUtils> getGuiHandlerClass()
+ {
+ return this.guiHandlerClass;
+ }
+
+ public int getId()
+ {
+ return this.id;
+ }
+ }
+
diff --git a/src/Java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java b/src/Java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java
new file mode 100644
index 0000000000..9f1b775fb0
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/gui/item/GuiBaseBackpack.java
@@ -0,0 +1,122 @@
+package gtPlusPlus.core.gui.item;
+
+import gtPlusPlus.core.container.Container_BackpackBase;
+import gtPlusPlus.core.inventories.BaseInventoryBackpack;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.RenderHelper;
+import net.minecraft.client.renderer.entity.RenderManager;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.util.ResourceLocation;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+import com.sun.org.apache.xml.internal.security.utils.I18n;
+
+public class GuiBaseBackpack extends GuiContainer
+{
+ /** x and y size of the inventory window in pixels. Defined as float, passed as int
+ * These are used for drawing the player model. */
+ private float xSize_lo;
+ private float ySize_lo;
+
+ /** The FontRenderer used by GuiScreen */
+ protected FontRenderer fontRenderer;
+
+ /** ResourceLocation takes 2 parameters: ModId, path to texture at the location:
+ * "src/minecraft/assets/modid/"
+ *
+ * I have provided a sample texture file that works with this tutorial. Download it
+ * from Forge_Tutorials/textures/gui/
+ */
+ private static final ResourceLocation iconLocation = new ResourceLocation(CORE.MODID, "textures/gui/itemBackpack.png");
+
+ /** The inventory to render on screen */
+ private final BaseInventoryBackpack inventory;
+
+ public GuiBaseBackpack(Container_BackpackBase containerItem)
+ {
+ super(containerItem);
+ this.inventory = containerItem.inventory;
+ }
+
+ /**
+ * Draws the screen and all the components in it.
+ */
+ @Override
+ public void drawScreen(int par1, int par2, float par3)
+ {
+ super.drawScreen(par1, par2, par3);
+ this.xSize_lo = (float)par1;
+ this.ySize_lo = (float)par2;
+ }
+
+ /**
+ * Draw the foreground layer for the GuiContainer (everything in front of the items)
+ */
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2)
+ {
+ String s = this.inventory.hasCustomInventoryName() ? this.inventory.getInventoryName() : I18n.translate(this.inventory.getInventoryName());
+ //this.fontRenderer.drawString(s, this.xSize / 2 - this.fontRenderer.getStringWidth(s) / 2, 0, 4210752);
+ //this.fontRenderer.drawString(I18n.translate("container.inventory"), 26, this.ySize - 96 + 4, 4210752);
+ }
+
+ /**
+ * Draw the background layer for the GuiContainer (everything behind the items)
+ */
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
+ {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.getTextureManager().bindTexture(iconLocation);
+ int k = (this.width - this.xSize) / 2;
+ int l = (this.height - this.ySize) / 2;
+ this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
+ int i1;
+ drawPlayerModel(k + 51, l + 75, 30, (float)(k + 51) - this.xSize_lo, (float)(l + 75 - 50) - this.ySize_lo, this.mc.thePlayer);
+ }
+
+ /**
+ * This renders the player model in standard inventory position (in later versions of Minecraft / Forge, you can
+ * simply call GuiInventory.drawEntityOnScreen directly instead of copying this code)
+ */
+ public static void drawPlayerModel(int x, int y, int scale, float yaw, float pitch, EntityLivingBase entity) {
+ GL11.glEnable(GL11.GL_COLOR_MATERIAL);
+ GL11.glPushMatrix();
+ GL11.glTranslatef(x, y, 50.0F);
+ GL11.glScalef(-scale, scale, scale);
+ GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
+ float f2 = entity.renderYawOffset;
+ float f3 = entity.rotationYaw;
+ float f4 = entity.rotationPitch;
+ float f5 = entity.prevRotationYawHead;
+ float f6 = entity.rotationYawHead;
+ GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
+ RenderHelper.enableStandardItemLighting();
+ GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(-((float) Math.atan(pitch / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F);
+ entity.renderYawOffset = (float) Math.atan(yaw / 40.0F) * 20.0F;
+ entity.rotationYaw = (float) Math.atan(yaw / 40.0F) * 40.0F;
+ entity.rotationPitch = -((float) Math.atan(pitch / 40.0F)) * 20.0F;
+ entity.rotationYawHead = entity.rotationYaw;
+ entity.prevRotationYawHead = entity.rotationYaw;
+ GL11.glTranslatef(0.0F, entity.yOffset, 0.0F);
+ RenderManager.instance.playerViewY = 180.0F;
+ RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
+ entity.renderYawOffset = f2;
+ entity.rotationYaw = f3;
+ entity.rotationPitch = f4;
+ entity.prevRotationYawHead = f5;
+ entity.rotationYawHead = f6;
+ GL11.glPopMatrix();
+ RenderHelper.disableStandardItemLighting();
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/gui/machine/GUI_Charger.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_Charger.java
new file mode 100644
index 0000000000..c1f687c554
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_Charger.java
@@ -0,0 +1,50 @@
+package gtPlusPlus.core.gui.machine;
+
+import gtPlusPlus.core.container.Container_Charger;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.machines.TileEntityCharger;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.client.resources.I18n;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.util.ResourceLocation;
+
+import org.lwjgl.opengl.GL11;
+
+public class GUI_Charger extends GuiContainer
+{
+ private ResourceLocation texture = new ResourceLocation(CORE.MODID, "textures/gui/machine_Charger.png");
+
+ private InventoryPlayer inventory;
+ private TileEntityCharger te;
+
+ public GUI_Charger(TileEntityCharger te, EntityPlayer player)
+ {
+ super(new Container_Charger(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(te.getInventoryName()), (xSize / 2) - (fontRendererObj.getStringWidth(I18n.format(te.getInventoryName())) / 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/core/gui/machine/GUI_NHG.java b/src/Java/gtPlusPlus/core/gui/machine/GUI_NHG.java
new file mode 100644
index 0000000000..09b2ee93d8
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/gui/machine/GUI_NHG.java
@@ -0,0 +1,50 @@
+package gtPlusPlus.core.gui.machine;
+
+import gtPlusPlus.core.container.Container_NHG;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.machines.TileEntityNHG;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.client.resources.I18n;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.util.ResourceLocation;
+
+import org.lwjgl.opengl.GL11;
+
+public class GUI_NHG extends GuiContainer
+{
+ private ResourceLocation texture = new ResourceLocation(CORE.MODID, "textures/gui/helium_collector_gui_12.png");
+
+ private InventoryPlayer inventory;
+ private TileEntityNHG te;
+
+ public GUI_NHG(TileEntityNHG te, EntityPlayer player)
+ {
+ super(new Container_NHG(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(te.getInventoryName()), (xSize / 2) - (fontRendererObj.getStringWidth(I18n.format(te.getInventoryName())) / 2), 6, 4210752, false);
+ //fontRendererObj.drawString(I18n.format(inventory.getInventoryName()), 8, ySize - 96 + 2, 4210752);
+ fontRendererObj.drawString(I18n.format("CoreTemp:"+te.getCoreTemp()+"K"), 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/core/handler/COMPAT_HANDLER.java b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
new file mode 100644
index 0000000000..92003cbcad
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
@@ -0,0 +1,155 @@
+package gtPlusPlus.core.handler;
+
+import static gtPlusPlus.core.lib.LoadedMods.Gregtech;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.common.compat.COMPAT_BigReactors;
+import gtPlusPlus.core.common.compat.COMPAT_CompactWindmills;
+import gtPlusPlus.core.common.compat.COMPAT_EnderIO;
+import gtPlusPlus.core.common.compat.COMPAT_ExtraUtils;
+import gtPlusPlus.core.common.compat.COMPAT_IC2;
+import gtPlusPlus.core.common.compat.COMPAT_MorePlanets;
+import gtPlusPlus.core.common.compat.COMPAT_PneumaticCraft;
+import gtPlusPlus.core.common.compat.COMPAT_RFTools;
+import gtPlusPlus.core.common.compat.COMPAT_SimplyJetpacks;
+import gtPlusPlus.core.common.compat.COMPAT_Thaumcraft;
+import gtPlusPlus.core.handler.Recipes.LateRegistrationHandler;
+import gtPlusPlus.core.handler.Recipes.RegistrationHandler;
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.recipe.RECIPES_GREGTECH;
+import gtPlusPlus.core.recipe.RECIPES_LaserEngraver;
+import gtPlusPlus.core.recipe.ShapedRecipeObject;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechDehydrator;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechEnergyBuffer;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialCentrifuge;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialCokeOven;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialElectrolyzer;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMacerator;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialMassFabricator;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialPlatePress;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIndustrialWiremill;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechIronBlastFurnace;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechPowerSubStation;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechRocketFuelGenerator;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSafeBlock;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSolarGenerators;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSteamCondenser;
+import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechSuperConductionPoint;
+
+import java.util.LinkedList;
+import java.util.Queue;
+
+import net.minecraft.item.ItemStack;
+
+public class COMPAT_HANDLER {
+
+ public static Queue<Object> RemoveRecipeQueue = new LinkedList<Object>();
+ public static Queue<ShapedRecipeObject> AddRecipeQueue = new LinkedList<ShapedRecipeObject>();
+ public static Boolean areInitItemsLoaded = false;
+
+
+ public static void registerMyModsOreDictEntries(){
+
+ Utils.LOG_INFO("Registering Materials with OreDict.");
+ //In-house
+
+ //tools
+ GT_OreDictUnificator.registerOre("craftingToolSandHammer", new ItemStack(ModItems.itemSandstoneHammer));
+ GT_OreDictUnificator.registerOre("ingotBloodSteel", new ItemStack(ModItems.itemIngotBloodSteel));
+ GT_OreDictUnificator.registerOre("ingotStaballoy", new ItemStack(ModItems.itemIngotStaballoy));
+
+ //Plates
+ GT_OreDictUnificator.registerOre("plateBloodSteel", new ItemStack(ModItems.itemPlateBloodSteel));
+ GT_OreDictUnificator.registerOre("plateStaballoy", new ItemStack(ModItems.itemPlateStaballoy));
+
+ //Blocks
+ //GT_OreDictUnificator.registerOre("blockStaballoy", new ItemStack(Item.getItemFromBlock(ModBlocks.blockStaballoy)));
+ //OreDictionary.registerOre("blockBloodSteel", new ItemStack(ModBlocks.blockBloodSteel));
+
+
+ for(int i=1; i<=10; i++){
+ GT_OreDictUnificator.registerOre("bufferCore_"+CORE.VOLTAGES[i-1], new ItemStack(UtilsItems.getItem("miscutils:item.itemBufferCore"+i)));
+ }
+ }
+
+ public static void registerGregtechMachines() {
+ if (Gregtech) {
+ new RECIPES_LaserEngraver();
+ GregtechEnergyBuffer.run();
+ GregtechSteamCondenser.run();
+ GregtechSafeBlock.run();
+ GregtechSuperConductionPoint.run();
+ GregtechIronBlastFurnace.run();
+ GregtechIndustrialCentrifuge.run();
+ GregtechIndustrialCokeOven.run();
+ GregtechIndustrialPlatePress.run();
+ GregtechRocketFuelGenerator.run();
+ GregtechIndustrialElectrolyzer.run();
+ GregtechIndustrialMacerator.run();
+ GregtechIndustrialWiremill.run();
+ GregtechIndustrialMassFabricator.run();
+ //GregtechIndustrialSinter.run();
+ GregtechSolarGenerators.run();
+ GregtechPowerSubStation.run();
+ GregtechDehydrator.run();
+ }
+
+ }
+
+ //InterMod
+ public static void intermodOreDictionarySupport(){
+
+ if (LoadedMods.Big_Reactors){
+ COMPAT_BigReactors.OreDict();
+ }
+ if (LoadedMods.EnderIO){
+ COMPAT_EnderIO.OreDict();
+ }
+ if (LoadedMods.MorePlanets){
+ COMPAT_MorePlanets.OreDict();
+ }
+ if (LoadedMods.Simply_Jetpacks){
+ COMPAT_SimplyJetpacks.OreDict();
+ }
+ if (LoadedMods.RFTools){
+ COMPAT_RFTools.OreDict();
+ }
+ if (LoadedMods.Thaumcraft){
+ COMPAT_Thaumcraft.OreDict();
+ }
+ if (LoadedMods.Extra_Utils){
+ COMPAT_ExtraUtils.OreDict();
+ }
+ if (LoadedMods.PneumaticCraft){
+ COMPAT_PneumaticCraft.OreDict();
+ }
+ if (LoadedMods.CompactWindmills){
+ COMPAT_CompactWindmills.OreDict();
+ }
+ if (LoadedMods.IndustrialCraft2){
+ COMPAT_IC2.OreDict();
+ }
+ }
+
+ public static void RemoveRecipesFromOtherMods(){
+ //Removal of Recipes
+ for(Object item : RemoveRecipeQueue){
+ UtilsRecipe.removeCraftingRecipe(item);
+ }
+ }
+
+ public static void InitialiseHandlerThenAddRecipes(){
+ RegistrationHandler.run();
+ }
+ public static void InitialiseLateHandlerThenAddRecipes(){
+ LateRegistrationHandler.run();
+ }
+
+ public static void startLoadingGregAPIBasedRecipes(){
+ RECIPES_GREGTECH.run();
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java b/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java
new file mode 100644
index 0000000000..97b7369134
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java
@@ -0,0 +1,41 @@
+package gtPlusPlus.core.handler;
+
+import gtPlusPlus.xmod.forestry.HANDLER_FR;
+import gtPlusPlus.xmod.gregtech.HANDLER_GT;
+import gtPlusPlus.xmod.growthcraft.HANDLER_GC;
+import gtPlusPlus.xmod.ic2.HANDLER_IC2;
+import gtPlusPlus.xmod.psychedelicraft.HANDLER_Psych;
+import gtPlusPlus.xmod.thermalfoundation.HANDLER_TF;
+
+public class COMPAT_IntermodStaging {
+
+ public static void preInit(){
+ HANDLER_GT.preInit();
+ HANDLER_GC.preInit();
+ HANDLER_TF.preInit();
+ HANDLER_FR.preInit();
+ HANDLER_Psych.preInit();
+ HANDLER_IC2.preInit();
+
+ }
+
+ public static void init(){
+ HANDLER_GT.init();
+ HANDLER_GC.init();
+ HANDLER_TF.init();
+ HANDLER_FR.Init();
+ HANDLER_Psych.init();
+ HANDLER_IC2.init();
+ }
+
+ public static void postInit(){
+ HANDLER_GT.postInit();
+ HANDLER_GC.postInit();
+ HANDLER_TF.postInit();
+ HANDLER_FR.postInit();
+ HANDLER_Psych.postInit();
+ HANDLER_IC2.postInit();
+ }
+
+
+}
diff --git a/src/Java/gtPlusPlus/core/handler/CraftingManager.java b/src/Java/gtPlusPlus/core/handler/CraftingManager.java
new file mode 100644
index 0000000000..bd0f114b1a
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/handler/CraftingManager.java
@@ -0,0 +1,17 @@
+package gtPlusPlus.core.handler;
+
+public class CraftingManager {
+
+ public static void mainRegistry() {
+ addCraftingRecipies();
+ addSmeltingRecipies();
+ }
+
+ public static void addCraftingRecipies() {
+
+ }
+
+ public static void addSmeltingRecipies() {
+
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/handler/GuiHandler.java b/src/Java/gtPlusPlus/core/handler/GuiHandler.java
new file mode 100644
index 0000000000..7c9c7a7625
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/handler/GuiHandler.java
@@ -0,0 +1,128 @@
+package gtPlusPlus.core.handler;
+
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.core.container.Container_BackpackBase;
+import gtPlusPlus.core.gui.beta.Gui_ID_Registry;
+import gtPlusPlus.core.gui.beta.MU_GuiId;
+import gtPlusPlus.core.gui.item.GuiBaseBackpack;
+import gtPlusPlus.core.interfaces.IGuiManager;
+import gtPlusPlus.core.inventories.BaseInventoryBackpack;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.forestry.bees.alveary.TileAlvearyFrameHousing;
+import gtPlusPlus.xmod.forestry.bees.alveary.gui.CONTAINER_FrameHousing;
+import gtPlusPlus.xmod.forestry.bees.alveary.gui.GUI_FrameHousing;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ChunkCoordinates;
+import net.minecraft.world.World;
+import cpw.mods.fml.common.network.IGuiHandler;
+import cpw.mods.fml.common.network.NetworkRegistry;
+
+public class GuiHandler implements IGuiHandler {
+
+ public static final int GUI1 = 0; //Frame Alveary
+ public static final int GUI2 = 1; //RTG
+ public static final int GUI3 = 2; //BackpackHandler
+ public static final int GUI4 = 3; //
+ public static final int GUI5 = 4; //
+ public static final int GUI6 = 5; //
+ public static final int GUI7 = 6; //
+ public static final int GUI8 = 7; //
+
+
+
+ public static void init(){
+
+ Utils.LOG_INFO("Registering GUIs.");
+ NetworkRegistry.INSTANCE.registerGuiHandler(GTplusplus.instance, new GuiHandler());
+ //Register GuiHandler
+ //NetworkRegistry.INSTANCE.registerGuiHandler(GTplusplus.instance, new GuiHandler());
+ }
+
+
+ @Override //ContainerModTileEntity
+ public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
+ TileEntity te = world.getTileEntity(x, y, z);
+
+ if (te != null){
+ if (ID == GUI1){
+ if (CORE.configSwitches.enableCustomAlvearyBlocks){
+ return new CONTAINER_FrameHousing((TileAlvearyFrameHousing)te, player);
+ }
+ }
+ else if (ID == GUI2){
+ //return new CONTAINER_RTG(player, (TileEntityRTG)te);
+ }
+
+
+ }
+
+ if (ID == GUI3)
+ {
+ // Use the player's held item to create the inventory
+ return new Container_BackpackBase(player, player.inventory, new BaseInventoryBackpack(player.getHeldItem()));
+ }
+ return null;
+ }
+
+ @Override //GuiModTileEntity
+ public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
+ Utils.LOG_WARNING("getClientGuiElement Called by: "+player+", in world: "+player.dimension+" at x:"+x+", y:"+y+", z:"+z+".");
+ TileEntity te = world.getTileEntity(x, y, z);
+ if (te != null){
+ if (ID == GUI1){
+ if (CORE.configSwitches.enableCustomAlvearyBlocks){
+ Utils.LOG_WARNING("Opening Gui with Id: "+ID+" Alveary Frame Housing");
+ return new GUI_FrameHousing((TileAlvearyFrameHousing) te, player);
+ }
+ }
+ else if (ID == GUI2){
+ Utils.LOG_WARNING("Opening Gui with Id: "+ID+" RTG");
+ //return new GUI_RTG((TileEntityRTG) te.);
+ }
+ }
+
+ if (ID == GUI3)
+ {
+ // We have to cast the new container as our custom class
+ // and pass in currently held item for the inventory
+ return new GuiBaseBackpack((Container_BackpackBase) new Container_BackpackBase(player, player.inventory, new BaseInventoryBackpack(player.getHeldItem())));
+ }
+
+ return null;
+ }
+
+
+
+ //New Methods
+ public static void openGui(EntityPlayer entityplayer, IGuiManager guiHandler)
+ {
+ openGui(entityplayer, guiHandler, (short)0);
+ }
+
+ public static void openGui(EntityPlayer entityplayer, IGuiManager guiHandler, short data)
+ {
+ int guiData = encodeGuiData(guiHandler, data);
+ ChunkCoordinates coordinates = guiHandler.getCoordinates();
+ entityplayer.openGui(GTplusplus.instance, guiData, entityplayer.worldObj, coordinates.posX, coordinates.posY, coordinates.posZ);
+ }
+
+ private static int encodeGuiData(IGuiManager guiHandler, short data)
+ {
+ MU_GuiId guiId = Gui_ID_Registry.getGuiIdForGuiHandler(guiHandler);
+ return data << 16 | guiId.getId();
+ }
+
+ private static MU_GuiId decodeGuiID(int guiData)
+ {
+ int guiId = guiData & 0xFF;
+ return Gui_ID_Registry.getGuiId(guiId);
+ }
+
+ private static short decodeGuiData(int guiId)
+ {
+ return (short)(guiId >> 16);
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java b/src/Java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java
new file mode 100644
index 0000000000..7d739bdca3
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/handler/Recipes/LateRegistrationHandler.java
@@ -0,0 +1,28 @@
+package gtPlusPlus.core.handler.Recipes;
+
+import gtPlusPlus.core.handler.COMPAT_HANDLER;
+import gtPlusPlus.core.recipe.ShapedRecipeObject;
+import gtPlusPlus.core.util.Utils;
+
+public class LateRegistrationHandler {
+
+ public static int recipesSuccess = 0;
+ public static int recipesFailed = 0;
+
+ public static void run(){
+ init();
+ }
+
+ private final static void init(){
+ for(ShapedRecipeObject item : COMPAT_HANDLER.AddRecipeQueue){
+ item.buildRecipe();
+ }
+ try {
+ Thread.sleep(10);
+ } catch (InterruptedException e) {
+ Utils.LOG_INFO(e.toString());
+ }
+ Utils.LOG_INFO("Late Recipes Loaded: "+recipesSuccess+" Failed: "+recipesFailed);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java b/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
new file mode 100644
index 0000000000..affb56566d
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/handler/Recipes/RegistrationHandler.java
@@ -0,0 +1,32 @@
+package gtPlusPlus.core.handler.Recipes;
+
+import gtPlusPlus.core.handler.COMPAT_HANDLER;
+import gtPlusPlus.core.recipe.RECIPES_MachineComponents;
+import gtPlusPlus.core.recipe.RECIPES_Machines;
+import gtPlusPlus.core.recipe.RECIPES_Shapeless;
+import gtPlusPlus.core.recipe.RECIPES_Tools;
+import gtPlusPlus.core.recipe.RECIPE_Batteries;
+import gtPlusPlus.core.util.Utils;
+
+public class RegistrationHandler {
+
+ public static int recipesSuccess = 0;
+ public static int recipesFailed = 0;
+
+ public static void run(){
+ init();
+ }
+
+ private final static void init(){
+ RECIPES_Tools.RECIPES_LOAD();
+ RECIPES_Machines.RECIPES_LOAD();
+ RECIPES_Shapeless.RECIPES_LOAD();
+ RECIPES_MachineComponents.RECIPES_LOAD();
+ RECIPE_Batteries.RECIPES_LOAD();
+ //RECIPES_MTWRAPPER.run();
+ Utils.LOG_INFO("Loaded: "+recipesSuccess+" Failed: "+recipesFailed);
+ COMPAT_HANDLER.areInitItemsLoaded = true;
+ //Utils.LOG_INFO("MT Loaded: "+RECIPES_MTWRAPPER.MT_RECIPES_LOADED+" MT Failed: "+RECIPES_MTWRAPPER.MT_RECIPES_FAILED);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java
new file mode 100644
index 0000000000..9cf0cb8bb7
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/handler/events/LoginEventHandler.java
@@ -0,0 +1,84 @@
+package gtPlusPlus.core.handler.events;
+
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.player.PlayerCache;
+
+import java.util.UUID;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import cpw.mods.fml.common.gameevent.PlayerEvent;
+
+public class LoginEventHandler {
+
+ public String localPlayersName;
+ public UUID localPlayersUUID;
+ private EntityPlayer localPlayerRef;
+
+ @SubscribeEvent
+ public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) {
+
+ this.localPlayerRef = event.player;
+ this.localPlayersName = event.player.getDisplayName();
+ this.localPlayersUUID = event.player.getUniqueID();
+
+ try {
+
+
+ if (localPlayerRef instanceof EntityPlayerMP && localPlayerRef != null){
+
+ //Populates player cache
+ if (!localPlayerRef.worldObj.isRemote){
+ PlayerCache.appendParamChanges(localPlayersName, localPlayersUUID.toString());
+ }
+
+
+ /*if (localPlayerRef.getCommandSenderName().toLowerCase().equalsIgnoreCase("ImQ009") || localPlayerRef.getCommandSenderName().toLowerCase().contains("player")){
+ Utils.LOG_INFO("Spawning a new Santa Thread.");
+ Thread t = new Thread() {
+ UUID threadHandlerIDthing = localPlayersUUID;
+ @Override
+ public void run() {
+ while(true && Minecraft.getMinecraft().getIntegratedServer() != null) {
+ try {
+ if(localPlayerRef == null){
+ localPlayerRef = Utils.getPlayerOnServerFromUUID(threadHandlerIDthing);
+ }
+
+
+ //ImQ009 is a legend.
+ if (localPlayerRef.getCommandSenderName().toLowerCase().equalsIgnoreCase("ImQ009")){
+ Utils.messagePlayer(localPlayerRef, "Enjoy some complimentary Raisin Bread.");
+ localPlayerRef.inventory.addItemStackToInventory(UtilsItems.getSimpleStack(ModItems.itemIngotRaisinBread, MathUtils.randInt(1, 5)));
+ }
+
+
+ if (localPlayerRef.getCommandSenderName().toLowerCase().contains("player")){
+ Utils.messagePlayer(localPlayerRef, "Enjoy some complimentary Raisin Bread.");
+ localPlayerRef.inventory.addItemStackToInventory(UtilsItems.getSimpleStack(ModItems.itemIngotRaisinBread, MathUtils.randInt(1, 5)));
+ }
+ Thread.sleep(1000*60*MathUtils.randInt(15, 90));
+ } catch (InterruptedException ie) {
+ Utils.LOG_INFO("Santa Mode Disabled.");
+ }
+ }
+
+ Utils.LOG_INFO("Thread Stopped. Handler Closed.");
+
+ }
+ };
+ //t.start();
+
+
+ }*/
+
+
+ }
+ } catch (Throwable errr){
+ Utils.LOG_INFO("Login Handler encountered an error.");
+
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java b/src/Java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java
new file mode 100644
index 0000000000..a7c689a79a
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/handler/events/PickaxeBlockBreakEventHandler.java
@@ -0,0 +1,71 @@
+package gtPlusPlus.core.handler.events;
+
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.metatileentity.BaseMetaPipeEntity;
+import gregtech.api.metatileentity.BaseMetaTileEntity;
+import gregtech.api.metatileentity.BaseTileEntity;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines.GregtechMetaSafeBlockBase;
+
+import java.util.UUID;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraftforge.event.entity.player.PlayerInteractEvent;
+import net.minecraftforge.event.world.BlockEvent.BreakEvent;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+
+public class PickaxeBlockBreakEventHandler {
+ @SubscribeEvent
+ public void onBreakBlock(BreakEvent event) {
+ try{
+ TileEntity entity = event.world.getTileEntity(event.x, event.y, event.z);
+ if (entity != null && !entity.equals(null)){
+ EntityPlayer playerInternal = event.getPlayer();
+ Utils.LOG_WARNING(entity.getClass().getSimpleName());
+ if (entity.getClass().getSimpleName().equals("")){
+
+ }
+ if (entity instanceof BaseTileEntity && !(entity instanceof BaseMetaPipeEntity)){
+ IMetaTileEntity X = ((BaseMetaTileEntity)entity).getMetaTileEntity();
+ Block ThisBlock = X.getBaseMetaTileEntity().getBlock(event.x, event.y, event.z);
+ if (X instanceof GregtechMetaSafeBlockBase){
+
+ UUID ownerUUID = ((GregtechMetaSafeBlockBase)X).ownerUUID;
+ UUID accessorUUID = playerInternal.getUniqueID();
+ Utils.LOG_WARNING("Owner UUID: "+ownerUUID);
+ Utils.LOG_WARNING("Accessor UUID: "+accessorUUID);
+
+ if (((GregtechMetaSafeBlockBase)X).bUnbreakable){
+
+ Utils.LOG_INFO("UUID info. Accessor: "+accessorUUID + " | Owner: "+ownerUUID);
+
+ if (accessorUUID == ownerUUID){
+ Utils.messagePlayer(playerInternal, "Since you own this block, it has been destroyed.");
+ event.setCanceled(false);
+ }
+ else {
+ event.setCanceled(true);
+ Utils.messagePlayer(playerInternal, "Since you do not own this block, it has not been destroyed.");
+ }
+ //
+ }
+ }
+ }
+ }
+
+ }
+ catch (NullPointerException e) {
+ System.out.print("Caught a NullPointerException involving Safe Blocks. Cause: "+e.getCause());
+ }
+ }
+
+
+ @SubscribeEvent
+ public void onPlayerInteraction(PlayerInteractEvent aEvent) {
+ if (aEvent.entityPlayer != null && aEvent.entityPlayer.worldObj != null && aEvent.action != null && aEvent.world.provider != null && !aEvent.entityPlayer.worldObj.isRemote && aEvent.action != null && aEvent.action != PlayerInteractEvent.Action.RIGHT_CLICK_AIR) {
+ //Utils.LOG_ERROR("Test");
+ }
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java b/src/Java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java
new file mode 100644
index 0000000000..3e126d4463
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/handler/events/UnbreakableBlockManager.java
@@ -0,0 +1,138 @@
+package gtPlusPlus.core.handler.events;
+
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.metatileentity.BaseMetaPipeEntity;
+import gregtech.api.metatileentity.BaseMetaTileEntity;
+import gregtech.api.metatileentity.BaseTileEntity;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaSafeBlock;
+import net.minecraft.block.Block;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+
+public class UnbreakableBlockManager{
+
+ private static boolean hasRun = false;
+
+ public final BaseMetaTileEntity getmTileEntity() {
+ return mTileEntity;
+ }
+
+
+ public final void setmTileEntity(BaseMetaTileEntity mTileEntity/*, EntityPlayer aPlayer*/) {
+ UnbreakableBlockManager.mTileEntity = mTileEntity;
+ if (!hasRun){
+ hasRun = true;
+ makeIndestructible(/*aPlayer*/);
+ }
+ else {
+ Utils.LOG_WARNING("Why do you run twice?");
+ }
+ }
+
+
+ //BaseMetaTileEntity
+ //GregtechMetaSafeBlock
+ private static BaseMetaTileEntity mTileEntity = null;
+
+
+ private void makeIndestructible(/*EntityPlayer aPlayer*/){
+
+
+ Utils.LOG_WARNING("Initializing the code to set this TE to -1 hardness and make it indestructible.");
+ int X = ((BaseMetaTileEntity)mTileEntity).xCoord; //(GregtechMetaSafeBlock) this.mTileEntity.getXCoord();
+ int Y = ((BaseMetaTileEntity)mTileEntity).yCoord;
+ int Z = ((BaseMetaTileEntity)mTileEntity).zCoord;
+ Utils.LOG_WARNING("Grabbing TileEntity @ [x,y,z] |"+X+"|"+Y+"|"+Z+"|");
+
+
+
+ try{
+ GregtechMetaSafeBlock MetaSafeBlock = ((GregtechMetaSafeBlock) this.mTileEntity.getMetaTileEntity());
+ TileEntity BaseMetaTileEntity = ((BaseMetaTileEntity)mTileEntity).getTileEntity(X, Y, Z);
+ //MetaSafeBlockBase.
+ World TE_WORLD = MetaSafeBlock.getBaseMetaTileEntity().getWorld();
+ Utils.LOG_WARNING("Checking new State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
+ TileEntity entity = BaseMetaTileEntity;
+ innerInvincible(MetaSafeBlock, entity, TE_WORLD, /*aPlayer,*/ X, Y, Z);
+ }
+ catch (NullPointerException e) {
+ System.out.print("Caught a NullPointerException involving Safe Blocks. Cause: ");
+ e.printStackTrace();
+ }
+ }
+
+
+ private static void innerInvincible(GregtechMetaSafeBlock MetaSafeBlock, TileEntity entity, World TE_WORLD, /*EntityPlayer aPlayer,*/ int X, int Y, int Z){
+ if (entity != null && !entity.equals(null)){
+ Utils.LOG_WARNING("Checking new State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
+ Utils.LOG_WARNING("Grabbed TE: "+entity.toString());
+
+
+
+
+ if (entity instanceof BaseTileEntity && !(entity instanceof BaseMetaPipeEntity)){
+ IMetaTileEntity I = ((BaseMetaTileEntity)entity).getMetaTileEntity();
+ Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
+ Utils.LOG_WARNING("I Details: "+I.getMetaName()+" | "+I.getTileEntityBaseType()+" | "+I.toString());
+
+
+
+
+
+ if (I instanceof GregtechMetaSafeBlock){
+ Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
+
+ Block ThisBlock = I.getBaseMetaTileEntity().getBlock(X, Y, Z);
+ Utils.LOG_WARNING("Block Details: "+ThisBlock.toString());
+
+
+ if (((GregtechMetaSafeBlock)I).bUnbreakable){
+ ThisBlock.setHardness(Integer.MAX_VALUE);
+ //ThisBlock.setResistance(18000000.0F);
+ ThisBlock.setResistance(-1);
+ ThisBlock.setBlockUnbreakable();
+ Utils.LOG_WARNING("Changing State of Flag. Old Value="+MetaSafeBlock.bUnbreakable+" Expected Value=true");
+ MetaSafeBlock.bUnbreakable = true;
+ //entity.markDirty();
+ Utils.LOG_WARNING("Checking new State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
+ Utils.LOG_ERROR("New Indestructible Flag enabled.");
+ //GT_Utility.sendChatToPlayer(aPlayer, "Block is now unbreakable.");
+ }
+
+
+
+
+ else {
+ ThisBlock.setHardness(1);
+ ThisBlock.setResistance(1.0F);
+ Utils.LOG_WARNING("Changing State of Flag. Old Value="+MetaSafeBlock.bUnbreakable+" Expected Value=false");
+ MetaSafeBlock.bUnbreakable = false;
+ //entity.markDirty();
+ Utils.LOG_WARNING("Checking new State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
+ Utils.LOG_ERROR("New Indestructible Flag disabled.");
+ //GT_Utility.sendChatToPlayer(aPlayer, "Block is now breakable.");
+ }
+
+ //entity.markDirty();
+
+ Utils.LOG_WARNING("Block Hardness: "+ThisBlock.getBlockHardness(TE_WORLD, X, Y, Z));
+ Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
+ hasRun = false;
+
+ }
+ else {
+ Utils.LOG_WARNING("I is not an instanceof MetaSafeBlockBase");
+ Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
+ }
+ } else {
+ Utils.LOG_WARNING("TE is not an instanceof BaseTileEntity or may be a pipe.");
+ Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
+ }
+ }else {
+ Utils.LOG_WARNING("Did not grab a TE instance to make a block instance from.");
+ Utils.LOG_WARNING("Checking State of Flag[nUnbreakable]. Value="+MetaSafeBlock.bUnbreakable);
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/interfaces/IGuiManager.java b/src/Java/gtPlusPlus/core/interfaces/IGuiManager.java
new file mode 100644
index 0000000000..1d0ad9ed87
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/interfaces/IGuiManager.java
@@ -0,0 +1,16 @@
+package gtPlusPlus.core.interfaces;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.util.ChunkCoordinates;
+import net.minecraft.world.World;
+
+public abstract interface IGuiManager extends IGuiManagerMiscUtils{
+
+ public abstract ChunkCoordinates getCoordinates();
+
+ public abstract World getWorld();
+
+ public abstract Object getGui(EntityPlayer paramEntityPlayer, int paramInt);
+
+ public abstract Object getContainer(EntityPlayer paramEntityPlayer, int paramInt);
+}
diff --git a/src/Java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java b/src/Java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java
new file mode 100644
index 0000000000..cf46c67a54
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/interfaces/IGuiManagerMiscUtils.java
@@ -0,0 +1,3 @@
+package gtPlusPlus.core.interfaces;
+
+public abstract interface IGuiManagerMiscUtils {} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java b/src/Java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java
new file mode 100644
index 0000000000..59fe8aa4fa
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/inventories/BaseInventoryBackpack.java
@@ -0,0 +1,241 @@
+package gtPlusPlus.core.inventories;
+
+import gtPlusPlus.core.item.base.BaseItemBackpack;
+
+import java.util.UUID;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraftforge.common.util.Constants;
+
+public class BaseInventoryBackpack implements IInventory{
+
+ private String name = "Inventory Item";
+
+ /** Provides NBT Tag Compound to reference */
+ private final ItemStack invItem;
+
+ /** Defining your inventory size this way is handy */
+ public static final int INV_SIZE = 8;
+
+ /** Inventory's size must be same as number of slots you add to the Container class */
+ private ItemStack[] inventory = new ItemStack[INV_SIZE];
+
+ // declaration of variable:
+ protected String uniqueID;
+
+ /**
+ * @param itemstack - the ItemStack to which this inventory belongs
+ */
+ public BaseInventoryBackpack(ItemStack stack)
+ {
+ invItem = stack;
+
+ /** initialize variable within the constructor: */
+ uniqueID = "";
+
+ if (!stack.hasTagCompound())
+ {
+ stack.setTagCompound(new NBTTagCompound());
+ // no tag compound means the itemstack does not yet have a UUID, so assign one:
+ uniqueID = UUID.randomUUID().toString();
+ }
+
+ // Create a new NBT Tag Compound if one doesn't already exist, or you will crash
+ if (!stack.hasTagCompound()) {
+ stack.setTagCompound(new NBTTagCompound());
+ }
+ // note that it's okay to use stack instead of invItem right there
+ // both reference the same memory location, so whatever you change using
+ // either reference will change in the other
+
+ // Read the inventory contents from NBT
+ readFromNBT(stack.getTagCompound());
+ }
+ @Override
+ public int getSizeInventory()
+ {
+ return inventory.length;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int slot)
+ {
+ return inventory[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(int slot, int amount)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ if(stack != null)
+ {
+ if(stack.stackSize > amount)
+ {
+ stack = stack.splitStack(amount);
+ // Don't forget this line or your inventory will not be saved!
+ markDirty();
+ }
+ else
+ {
+ // this method also calls markDirty, so we don't need to call it again
+ setInventorySlotContents(slot, null);
+ }
+ }
+ return stack;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(int slot)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ @Override
+ public void setInventorySlotContents(int slot, ItemStack stack)
+ {
+ inventory[slot] = stack;
+
+ if (stack != null && stack.stackSize > getInventoryStackLimit())
+ {
+ stack.stackSize = getInventoryStackLimit();
+ }
+
+ // Don't forget this line or your inventory will not be saved!
+ markDirty();
+ }
+
+ // 1.7.2+ renamed to getInventoryName
+ @Override
+ public String getInventoryName()
+ {
+ return name;
+ }
+
+ // 1.7.2+ renamed to hasCustomInventoryName
+ @Override
+ public boolean hasCustomInventoryName()
+ {
+ return name.length() > 0;
+ }
+
+ @Override
+ public int getInventoryStackLimit()
+ {
+ return 64;
+ }
+
+ /**
+ * This is the method that will handle saving the inventory contents, as it is called (or should be called!)
+ * anytime the inventory changes. Perfect. Much better than using onUpdate in an Item, as this will also
+ * let you change things in your inventory without ever opening a Gui, if you want.
+ */
+ // 1.7.2+ renamed to markDirty
+ @Override
+ public void markDirty()
+ {
+ for (int i = 0; i < getSizeInventory(); ++i)
+ {
+ if (getStackInSlot(i) != null && getStackInSlot(i).stackSize == 0) {
+ inventory[i] = null;
+ }
+ }
+
+ // This line here does the work:
+ writeToNBT(invItem.getTagCompound());
+ }
+
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer entityplayer)
+ {
+ return true;
+ }
+
+ // 1.7.2+ renamed to openInventory(EntityPlayer player)
+ @Override
+ public void openInventory() {}
+
+ // 1.7.2+ renamed to closeInventory(EntityPlayer player)
+ @Override
+ public void closeInventory() {}
+
+ /**
+ * This method doesn't seem to do what it claims to do, as
+ * items can still be left-clicked and placed in the inventory
+ * even when this returns false
+ */
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack itemstack)
+ {
+ // Don't want to be able to store the inventory item within itself
+ // Bad things will happen, like losing your inventory
+ // Actually, this needs a custom Slot to work
+ return !(itemstack.getItem() instanceof BaseItemBackpack);
+ }
+
+ /**
+ * A custom method to read our inventory from an ItemStack's NBT compound
+ */
+ public void readFromNBT(NBTTagCompound compound)
+ {
+ // Gets the custom taglist we wrote to this compound, if any
+ // 1.7.2+ change to compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND);
+ NBTTagList items = compound.getTagList("ItemInventory", Constants.NBT.TAG_COMPOUND);
+
+ if ("".equals(uniqueID))
+ {
+ // try to read unique ID from NBT
+ uniqueID = compound.getString("uniqueID");
+ // if it's still "", assign a new one:
+ if ("".equals(uniqueID))
+ {
+ uniqueID = UUID.randomUUID().toString();
+ }
+ }
+
+ for (int i = 0; i < items.tagCount(); ++i)
+ {
+ // 1.7.2+ change to items.getCompoundTagAt(i)
+ NBTTagCompound item = (NBTTagCompound) items.getCompoundTagAt(i);
+ int slot = item.getInteger("Slot");
+
+ // Just double-checking that the saved slot index is within our inventory array bounds
+ if (slot >= 0 && slot < getSizeInventory()) {
+ inventory[slot] = ItemStack.loadItemStackFromNBT(item);
+ }
+ }
+ }
+
+ /**
+ * A custom method to write our inventory to an ItemStack's NBT compound
+ */
+ public void writeToNBT(NBTTagCompound tagcompound)
+ {
+ // Create a new NBT Tag List to store itemstacks as NBT Tags
+ NBTTagList items = new NBTTagList();
+
+ for (int i = 0; i < getSizeInventory(); ++i)
+ {
+ // Only write stacks that contain items
+ if (getStackInSlot(i) != null)
+ {
+ // Make a new NBT Tag Compound to write the itemstack and slot index to
+ NBTTagCompound item = new NBTTagCompound();
+ item.setInteger("Slot", i);
+ // Writes the itemstack in slot(i) to the Tag Compound we just made
+ getStackInSlot(i).writeToNBT(item);
+
+ // add the tag compound to our tag list
+ items.appendTag(item);
+ }
+ }
+ tagcompound.setString("uniqueID", this.uniqueID);
+ // Add the TagList to the ItemStack's Tag Compound with the name "ItemInventory"
+ tagcompound.setTag("ItemInventory", items);
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/ModItems.java b/src/Java/gtPlusPlus/core/item/ModItems.java
new file mode 100644
index 0000000000..3ceaf84228
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/ModItems.java
@@ -0,0 +1,488 @@
+package gtPlusPlus.core.item;
+import static gtPlusPlus.core.creative.AddToCreativeTab.tabMachines;
+import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc;
+import static gtPlusPlus.core.lib.CORE.LOAD_ALL_CONTENT;
+import gregtech.api.enums.Materials;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.BaseItemBackpack;
+import gtPlusPlus.core.item.base.CoreItem;
+import gtPlusPlus.core.item.base.bolts.BaseItemBolt;
+import gtPlusPlus.core.item.base.foods.BaseItemFood;
+import gtPlusPlus.core.item.base.foods.BaseItemHotFood;
+import gtPlusPlus.core.item.base.gears.BaseItemGear;
+import gtPlusPlus.core.item.base.ingots.BaseItemIngot;
+import gtPlusPlus.core.item.base.ingots.BaseItemIngotHot;
+import gtPlusPlus.core.item.base.plates.BaseItemPlate;
+import gtPlusPlus.core.item.base.rings.BaseItemRing;
+import gtPlusPlus.core.item.base.rods.BaseItemRod;
+import gtPlusPlus.core.item.base.rotors.BaseItemRotor;
+import gtPlusPlus.core.item.base.screws.BaseItemScrew;
+import gtPlusPlus.core.item.effects.RarityUncommon;
+import gtPlusPlus.core.item.general.BufferCore;
+import gtPlusPlus.core.item.general.ItemCloakingDevice;
+import gtPlusPlus.core.item.general.ItemHealingDevice;
+import gtPlusPlus.core.item.general.RF2EU_Battery;
+import gtPlusPlus.core.item.general.fuelrods.FuelRod_Base;
+import gtPlusPlus.core.item.init.ItemsFoods;
+import gtPlusPlus.core.item.tool.misc.SandstoneHammer;
+import gtPlusPlus.core.item.tool.staballoy.MultiPickaxeBase;
+import gtPlusPlus.core.item.tool.staballoy.StaballoyAxe;
+import gtPlusPlus.core.item.tool.staballoy.StaballoyPickaxe;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.lib.MaterialInfo;
+import gtPlusPlus.core.lib.CORE.configSwitches;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.debug.DEBUG_INIT;
+import gtPlusPlus.core.util.item.UtilsItems;
+import net.minecraft.item.Item;
+import net.minecraft.item.Item.ToolMaterial;
+import net.minecraft.item.ItemFood;
+import net.minecraftforge.common.util.EnumHelper;
+import cpw.mods.fml.common.registry.GameRegistry;
+public final class ModItems {
+
+ public static ToolMaterial STABALLOY = EnumHelper.addToolMaterial("Staballoy", 3, 2500, 7, 1.0F, 18);
+
+ public static Item AAA_Broken;
+
+ public static Item itemDebugShapeSpawner;
+
+ public static Item itemBaseSpawnEgg;
+
+
+ //Tantaloy60(789, TextureSet.SET_DULL, 8.0F, 5120, 3, 1 | 2 | 16 | 32 | 64 | 128, 213, 231, 237, 0, "Tantaloy 60", 0, 0, 3035, 2200, true, false, 1, 2, 1, Dyes.dyeLightGray, 2, Arrays.asList(new MaterialStack(Tungsten, 1), new MaterialStack(Tantalum, 9)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 8), new TC_AspectStack(TC_Aspects.STRONTIO, 3))),
+ //Tantaloy61(790, TextureSet.SET_DULL, 7.0F, 5120, 2, 1 | 2 | 16 | 32 | 64 | 128, 193, 211, 217, 0, "Tantaloy 61", 0, 0, 3015, 2150, true, false, 1, 2, 1, Dyes.dyeLightGray, 2, Arrays.asList(new MaterialStack(Tungsten, 1), new MaterialStack(Tantalum, 9), new MaterialStack(Titanium, 1)), Arrays.asList(new TC_AspectStack(TC_Aspects.METALLUM, 8), new TC_AspectStack(TC_Aspects.STRONTIO, 3))),
+
+
+ //EnderIO
+ public static Item itemPlateSoularium;
+ public static Item itemPlateRedstoneAlloy;
+ public static Item itemPlateElectricalSteel;
+ public static Item itemPlatePulsatingIron;
+ public static Item itemPlateEnergeticAlloy;
+ public static Item itemPlateVibrantAlloy;
+ public static Item itemPlateConductiveIron;
+ public static Item itemPlateDarkSteel;
+ //Big Reactors
+ public static Item itemPlateBlutonium;
+ public static Item itemPlateCyanite;
+ public static Item itemPlateLudicrite;
+ //Thaumcraft
+ public static Item itemPlateVoidMetal;
+ //ExtraUtils
+ public static Item itemPlateBedrockium;
+ //Pneumaticraft
+ public static Item itemPlateCompressedIron;
+ //SimplyJetpacks
+ public static Item itemPlateEnrichedSoularium;
+ //rfTools
+ public static Item itemPlateDimensionShard;
+ //Blood Steel Items
+ public static Item itemIngotBloodSteel;
+ public static Item itemPlateBloodSteel;
+ //Staballoy
+ public static Item itemStaballoyPickaxe;
+ public static Item itemStaballoyAxe;
+ public static Item itemPlateStaballoy;
+ public static Item itemIngotStaballoy;
+ public static Item itemDustStaballoy;
+ public static Item itemDustTinyStaballoy;
+ public static Item itemDustSmallStaballoy;
+ public static Item itemDustBloodSteel;
+ public static Item itemDustTinyBloodSteel;
+ public static Item itemDustSmallBloodSteel;
+ //Tools
+ public static Item itemSandstoneHammer;
+ //Machine Related
+ public static Item itemBufferCore0;
+ //Material related
+ public static Item itemStickyRubber;
+ public static Item itemIngotBatteryAlloy;
+ public static Item itemPlateBatteryAlloy;
+ public static Item itemHeliumBlob;
+ public static Item itemPLACEHOLDER_Circuit;
+
+ public static Item FuelRod_Empty;
+ public static Item FuelRod_Thorium;
+ public static Item FuelRod_Uranium;
+ public static Item FuelRod_Plutonium;
+
+ public static Item itemBedLocator_Base;
+ public static Item itemBaseItemWithCharge;
+
+ public static Item itemHotIngotStaballoy;
+
+ public static Item itemIngotRaisinBread;
+ public static Item itemHotIngotRaisinBread;
+
+ public static BaseItemIngot itemIngotTantalloy60;
+ public static BaseItemIngotHot itemHotIngotTantalloy60;
+ public static BaseItemPlate itemPlateTantalloy60;
+ public static BaseItemIngot itemIngotTantalloy61;
+ public static BaseItemIngotHot itemHotIngotTantalloy61;
+ public static BaseItemPlate itemPlateTantalloy61;
+
+ public static ItemFood itemFoodRaisinToast;
+ public static BaseItemHotFood itemHotFoodRaisinToast;
+ public static BaseItemFood itemFoodCurriedSausages;
+ public static BaseItemHotFood itemHotFoodCurriedSausages;
+
+ public static Item itemDustTantalloy60;
+ public static Item itemDustSmallTantalloy60;
+ public static Item itemDustTinyTantalloy60;
+
+ public static Item itemDustTantalloy61;
+ public static Item itemDustSmallTantalloy61;
+ public static Item itemDustTinyTantalloy61;
+
+ public static BaseItemGear itemGearStaballoy;
+ public static BaseItemGear itemGearBloodSteel;
+ public static BaseItemGear itemGearTantalloy60;
+ public static BaseItemGear itemGearTantalloy61;
+
+ public static BaseItemRotor itemRotorStaballoy;
+ public static BaseItemRotor itemRotorBloodSteel;
+ public static BaseItemRotor itemRotorTantalloy60;
+ public static BaseItemRotor itemRotorTantalloy61;
+
+ public static BaseItemRod itemRodStaballoy;
+ public static BaseItemRod itemRodBloodSteel;
+ public static BaseItemRod itemRodTantalloy60;
+ public static BaseItemRod itemRodTantalloy61;
+
+ public static BaseItemScrew itemScrewStaballoy;
+ public static BaseItemScrew itemScrewBloodSteel;
+ public static BaseItemScrew itemScrewTantalloy60;
+ public static BaseItemScrew itemScrewTantalloy61;
+
+ public static BaseItemRing itemRingStaballoy;
+ public static BaseItemRing itemRingBloodSteel;
+ public static BaseItemRing itemRingTantalloy60;
+ public static BaseItemRing itemRingTantalloy61;
+
+ public static BaseItemBolt itemBoltStaballoy;
+ public static BaseItemBolt itemBoltBloodSteel;
+ public static BaseItemBolt itemBoltTantalloy60;
+ public static BaseItemBolt itemBoltTantalloy61;
+
+ public static Item RfEuBattery;
+ public static Item itemPersonalCloakingDevice;
+ public static Item itemPersonalCloakingDeviceCharged;
+ public static Item itemPersonalHealingDevice;
+
+ public static MultiPickaxeBase MP_Iron;
+ public static MultiPickaxeBase MP_Gold;
+ public static MultiPickaxeBase MP_Diamond;
+ public static MultiPickaxeBase MP_Wood;
+ public static MultiPickaxeBase MP_Stone;
+ public static MultiPickaxeBase MP_Quartz;
+ public static MultiPickaxeBase MP_Obsidian;
+ public static MultiPickaxeBase MP_Redstone;
+
+
+ public static BaseItemBackpack backpack_Red;
+ public static BaseItemBackpack backpack_Green;
+ public static BaseItemBackpack backpack_Blue;
+ public static BaseItemBackpack backpack_Yellow;
+ public static BaseItemBackpack backpack_Purple;
+ public static BaseItemBackpack backpack_Cyan;
+
+
+ public static BaseItemBackpack backpack_Maroon;
+ public static BaseItemBackpack backpack_Olive;
+ public static BaseItemBackpack backpack_DarkGreen;
+ public static BaseItemBackpack backpack_DarkPurple;
+ public static BaseItemBackpack backpack_Teal;
+ public static BaseItemBackpack backpack_Navy;
+
+
+ public static BaseItemBackpack backpack_Silver;
+ public static BaseItemBackpack backpack_Gray;
+ public static BaseItemBackpack backpack_Black;
+ public static BaseItemBackpack backpack_White;
+
+
+ //@SuppressWarnings("unused")
+ public static final void init(){
+
+ AAA_Broken = new BaseItemIngot("AAA_Broken", "Errors - Tell Alkalus", Utils.rgbtoHexValue(128, 128, 128), 0);
+
+ //Debug Loading
+ if (CORE.DEBUG){
+ DEBUG_INIT.registerItems();
+ }
+
+
+ //Make some backpacks
+ //Primary colours
+ backpack_Red = new BaseItemBackpack("backpackRed", Utils.rgbtoHexValue(200, 0, 0));
+ backpack_Green = new BaseItemBackpack("backpackGreen", Utils.rgbtoHexValue(0, 200, 0));
+ backpack_Blue = new BaseItemBackpack("backpackBlue", Utils.rgbtoHexValue(0, 0, 200));
+ //Secondary Colours
+ backpack_Yellow = new BaseItemBackpack("backpackYellow", Utils.rgbtoHexValue(200, 200, 0));
+ backpack_Purple = new BaseItemBackpack("backpackPurple", Utils.rgbtoHexValue(200, 0, 200));
+ backpack_Cyan = new BaseItemBackpack("backpackCyan", Utils.rgbtoHexValue(0, 200, 200));
+ //Tertiary Colours
+ backpack_Maroon = new BaseItemBackpack("backpackMaroon", Utils.rgbtoHexValue(128, 0, 0));
+ backpack_Olive = new BaseItemBackpack("backpackOlive", Utils.rgbtoHexValue(128, 128, 0));
+ backpack_DarkGreen = new BaseItemBackpack("backpackDarkGreen", Utils.rgbtoHexValue(0, 128, 0));
+ backpack_DarkPurple = new BaseItemBackpack("backpackDarkPurple", Utils.rgbtoHexValue(128, 0, 128));
+ backpack_Teal = new BaseItemBackpack("backpackTeal", Utils.rgbtoHexValue(0, 128, 128));
+ backpack_Navy = new BaseItemBackpack("backpackNavy", Utils.rgbtoHexValue(0, 0, 128));
+ //Shades
+ backpack_Silver = new BaseItemBackpack("backpackSilver", Utils.rgbtoHexValue(192, 192, 192));
+ backpack_Gray = new BaseItemBackpack("backpackGray", Utils.rgbtoHexValue(128, 128, 128));
+ backpack_Black = new BaseItemBackpack("backpackBlack", Utils.rgbtoHexValue(20, 20, 20));
+ backpack_White = new BaseItemBackpack("backpackWhite", Utils.rgbtoHexValue(240, 240, 240));
+
+
+ /*ItemsIngots.load();
+ ItemsPlates.load();
+ ItemsDusts.load();
+ ItemsRods.load();
+ ItemsGears.load();
+ ItemsRotors.load();
+ ItemsRings.load();
+ ItemsBolts.load();
+ ItemsScrews.load();*/
+
+
+ //Start meta Item Generation
+ ItemsFoods.load();
+
+ UtilsItems.generateItemsFromMaterial("EnergyCrystal", "Energy Crystal", 8, MaterialInfo.ENERGYCRYSTAL, Utils.rgbtoHexValue(228, 225, 0), true);
+ UtilsItems.generateItemsFromMaterial("BloodSteel", "Blood Steel", 3, MaterialInfo.BLOODSTEEL, Utils.rgbtoHexValue(142, 28, 0), false);
+ UtilsItems.generateItemsFromMaterial("Staballoy", "Staballoy", 6, MaterialInfo.STABALLOY, Utils.rgbtoHexValue(68, 75, 66), true);
+ UtilsItems.generateItemsFromMaterial("Tantalloy60", "Tantalloy-60", 5, MaterialInfo.TANTALLOY60, Utils.rgbtoHexValue(68, 75, 166), true);
+ UtilsItems.generateItemsFromMaterial("Tantalloy61", "Tantalloy-61", 6, MaterialInfo.TANTALLOY61, Utils.rgbtoHexValue(122, 135, 196), true);
+ UtilsItems.generateItemsFromMaterial("Bedrockium", "Bedrockium", 9, MaterialInfo.BEDROCKIUM, Utils.rgbtoHexValue(32, 32, 32), false);
+ UtilsItems.generateItemsFromMaterial("Quantum", "Quantum", 10, MaterialInfo.QUANTUM, Utils.rgbtoHexValue(128, 128, 128), true);
+
+
+ UtilsItems.generateItemsFromMaterial("Inconel625", "Inconel-625", 4, MaterialInfo.INCONEL625, Utils.rgbtoHexValue(128, 200, 128), true); //Inconel 625: Acid resistant, good weldability. The LCF version is typically used in bellows.
+ UtilsItems.generateItemsFromMaterial("Inconel690", "Inconel-690", 6, MaterialInfo.INCONEL690, Utils.rgbtoHexValue(118, 220, 138), true); //Inconel 690: Low cobalt content for nuclear applications, and low resistivity.
+ UtilsItems.generateItemsFromMaterial("Inconel792", "Inconel-792", 5, MaterialInfo.INCONEL792, Utils.rgbtoHexValue(108, 240, 118), true); //Inconel 792: Increased aluminium content for improved high temperature corrosion properties, used especially in gas turbines.
+
+
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ UtilsItems.generateItemsFromMaterial("TungstenCarbide", "Tungsten Carbide", 5, MaterialInfo.TUNGSTENCARBIDE, Utils.rgbtoHexValue(44, 44, 44), true);
+ }
+ UtilsItems.generateItemsFromMaterial("SiliconCarbide", "Silicon Carbide", 4, MaterialInfo.SILICONCARBIDE, Utils.rgbtoHexValue(32, 32, 32), false);
+ UtilsItems.generateItemsFromMaterial("Zeron100", "Zeron-100", 8, MaterialInfo.ZERON100, Utils.rgbtoHexValue(180, 180, 20), true);
+ UtilsItems.generateItemsFromMaterial("MaragingSteel250", "Maraging Steel 250", 4, MaterialInfo.MARAGING250, Utils.rgbtoHexValue(140, 140, 140), true);
+ UtilsItems.generateItemsFromMaterial("MaragingSteel300", "Maraging Steel 300", 5, MaterialInfo.MARAGING300, Utils.rgbtoHexValue(150, 150, 150), true);
+ UtilsItems.generateItemsFromMaterial("MaragingSteel350", "Maraging Steel 350", 6, MaterialInfo.MARAGING350, Utils.rgbtoHexValue(160, 160, 160), true);
+ UtilsItems.generateItemsFromMaterial("Stellite", "Stellite", 7, MaterialInfo.STELLITE, Utils.rgbtoHexValue(129, 75, 120), true);
+ UtilsItems.generateItemsFromMaterial("Talonite", "Talonite", 8, MaterialInfo.TALONITE, Utils.rgbtoHexValue(228, 75, 120), false);
+
+ UtilsItems.generateItemsFromMaterial("Tumbaga", "Tumbaga", 2, MaterialInfo.TUMBAGA, Utils.rgbtoHexValue(255,178,15), false); //Tumbaga was the name given by Spaniards to a non-specific alloy of gold and copper
+ UtilsItems.generateItemsFromMaterial("Potin", "Potin", 4, MaterialInfo.POTIN, Utils.rgbtoHexValue(201,151,129), false); //Potin is traditionally an alloy of bronze, tin and lead, with varying quantities of each possible
+
+
+ UtilsItems.generateItemsFromMaterial("HastelloyW", "Hastelloy-W", 6, MaterialInfo.HASTELLOY_W, Utils.rgbtoHexValue(218, 165, 32), false);
+ UtilsItems.generateItemsFromMaterial("HastelloyX", "Hastelloy-X", 6, MaterialInfo.HASTELLOY_X, Utils.rgbtoHexValue(255, 193, 37), false);
+ UtilsItems.generateItemsFromMaterial("HastelloyC276", "Hastelloy-C276", 7, MaterialInfo.HASTELLOY_C276, Utils.rgbtoHexValue(238, 180, 34), true);
+ UtilsItems.generateItemsFromMaterial("HastelloyN", "Hastelloy-N", 8, MaterialInfo.HASTELLOY_N, Utils.rgbtoHexValue(155, 223, 237), true);
+
+ UtilsItems.generateItemsFromMaterial("Incoloy020", "Incoloy-020", 7, MaterialInfo.INCOLOY020, Utils.rgbtoHexValue(81, 81, 81), false);
+ UtilsItems.generateItemsFromMaterial("IncoloyDS", "Incoloy-DS", 7, MaterialInfo.INCOLOYDS, Utils.rgbtoHexValue(91, 91, 91), false);
+ UtilsItems.generateItemsFromMaterial("IncoloyMA956", "Incoloy-MA956", 8, MaterialInfo.INCOLOYMA956, Utils.rgbtoHexValue(101, 101, 101), true);
+
+
+ UtilsItems.generateItemsFromMaterial("Zirconium", "Zirconium", 6, MaterialInfo.ZIRCONIUM, Utils.rgbtoHexValue(255, 250, 205), false);
+ UtilsItems.generateItemsFromMaterial("ZirconiumCarbide", "Zirconium Carbide", 7, MaterialInfo.ZIRCONIUMCARBIDE, Utils.rgbtoHexValue(222, 202, 180), true);
+ UtilsItems.generateItemsFromMaterial("TantalumCarbide", "Tantalum Carbide", 7, MaterialInfo.TANTALUMCARBIDE, Utils.rgbtoHexValue(139, 136, 120), true);
+ UtilsItems.generateItemsFromMaterial("NiobiumCarbide", "Niobium Carbide", 6, MaterialInfo.NIOMBIUMCARBIDE, Utils.rgbtoHexValue(205, 197, 191), true);
+
+
+ //Uranium-233if
+ UtilsItems.generateItemsFromMaterial("Uranium233", "Uranium 233", 4, MaterialInfo.INCONEL792, Utils.rgbtoHexValue(73, 220, 83), false); //Uranium-233 is a fissile isotope of uranium that is bred from thorium-232 as part of the thorium fuel cycle.
+
+ MP_Wood = new MultiPickaxeBase("Wooden Multipick", ToolMaterial.WOOD, ToolMaterial.WOOD.getMaxUses(), Utils.rgbtoHexValue(139,90,43));
+ MP_Stone = new MultiPickaxeBase("Cobblestone Multipick", ToolMaterial.STONE, ToolMaterial.STONE.getMaxUses(), Utils.rgbtoHexValue(161,161,161));
+ MP_Iron = new MultiPickaxeBase("Iron Multipick", ToolMaterial.IRON, ToolMaterial.IRON.getMaxUses(), Utils.rgbtoHexValue(110,123,139));
+ MP_Gold = new MultiPickaxeBase("Gold Multipick", ToolMaterial.GOLD, ToolMaterial.GOLD.getMaxUses(), Utils.rgbtoHexValue(238,221,130));
+ MP_Diamond = new MultiPickaxeBase("Diamond Multipick", ToolMaterial.EMERALD, ToolMaterial.EMERALD.getMaxUses(), Utils.rgbtoHexValue(191,239,255));
+
+ MP_Redstone = UtilsItems.generateMultiPick(Materials.Redstone);
+ MP_Obsidian = UtilsItems.generateMultiPick(Materials.Obsidian);
+ MP_Obsidian = UtilsItems.generateMultiPick(Materials.Abyssal);
+ MP_Obsidian = UtilsItems.generateMultiPick(Materials.NetherStar);
+ MP_Obsidian = UtilsItems.generateMultiPick(Materials.Neutronium);
+
+ //EnderIO Resources
+ if (LoadedMods.EnderIO || LOAD_ALL_CONTENT){
+ Utils.LOG_INFO("EnderIO Found - Loading Resources.");
+ //Item Init
+ itemPlateSoularium = new Item().setUnlocalizedName("itemPlateSoularium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateSoularium");
+ itemPlateRedstoneAlloy = new Item().setUnlocalizedName("itemPlateRedstoneAlloy").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateRedstoneAlloy");
+ itemPlateElectricalSteel = new Item().setUnlocalizedName("itemPlateElectricalSteel").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateElectricalSteel");
+ itemPlatePulsatingIron = new Item().setUnlocalizedName("itemPlatePulsatingIron").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlatePulsatingIron");
+ itemPlateEnergeticAlloy = new Item().setUnlocalizedName("itemPlateEnergeticAlloy").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateEnergeticAlloy");
+ itemPlateVibrantAlloy = new Item().setUnlocalizedName("itemPlateVibrantAlloy").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateVibrantAlloy");
+ itemPlateConductiveIron = new Item().setUnlocalizedName("itemPlateConductiveIron").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateConductiveIron");
+ itemPlateDarkSteel = new Item().setUnlocalizedName("itemPlateDarkSteel").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateDarkSteel");
+ //Registry
+ GameRegistry.registerItem(itemPlateSoularium, "itemPlateSoularium");
+ GameRegistry.registerItem(itemPlateRedstoneAlloy, "itemPlateRedstoneAlloy");
+ GameRegistry.registerItem(itemPlateElectricalSteel, "itemPlateElectricalSteel");
+ GameRegistry.registerItem(itemPlatePulsatingIron, "itemPlatePulsatingIron");
+ GameRegistry.registerItem(itemPlateEnergeticAlloy, "itemPlateEnergeticAlloy");
+ GameRegistry.registerItem(itemPlateVibrantAlloy, "itemPlateVibrantAlloy");
+ GameRegistry.registerItem(itemPlateConductiveIron, "itemPlateConductiveIron");
+ GameRegistry.registerItem(itemPlateDarkSteel, "itemPlateDarkSteel");
+ }
+ else {
+ Utils.LOG_WARNING("EnderIO not Found - Skipping Resources.");
+ }
+ //Big Reactors
+ if (LoadedMods.Big_Reactors|| LOAD_ALL_CONTENT){
+ Utils.LOG_INFO("BigReactors Found - Loading Resources.");
+ //Item Init
+ itemPlateBlutonium = new Item().setUnlocalizedName("itemPlateBlutonium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateBlutonium");
+ itemPlateCyanite = new Item().setUnlocalizedName("itemPlateCyanite").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateCyanite");
+ itemPlateLudicrite = new Item().setUnlocalizedName("itemPlateLudicrite").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateLudicrite");
+ //Registry
+ GameRegistry.registerItem(itemPlateBlutonium, "itemPlateBlutonium");
+ GameRegistry.registerItem(itemPlateCyanite, "itemPlateCyanite");
+ GameRegistry.registerItem(itemPlateLudicrite, "itemPlateLudicrite");
+ }
+ else {
+ Utils.LOG_WARNING("BigReactors not Found - Skipping Resources.");
+ }
+ //Thaumcraft
+ if (LoadedMods.Thaumcraft|| LOAD_ALL_CONTENT){
+ Utils.LOG_INFO("Thaumcraft Found - Loading Resources.");
+ //Item Init
+ try {
+ itemPlateVoidMetal = new Item().setUnlocalizedName("itemPlateVoidMetal").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateVoidMetal");
+ } catch (NullPointerException e){
+ e.getClass();
+ }
+ //Registry
+ GameRegistry.registerItem(itemPlateVoidMetal, "itemPlateVoidMetal");
+ }
+ else {
+ Utils.LOG_WARNING("Thaumcraft not Found - Skipping Resources.");
+ }
+ //ExtraUtils
+ if (LoadedMods.Extra_Utils|| LOAD_ALL_CONTENT){
+ Utils.LOG_INFO("ExtraUtilities Found - Loading Resources.");
+ //Item Init
+ try {
+ //itemPlateBedrockium = new Item().setUnlocalizedName("itemPlateBedrockium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateBedrockium");
+ } catch (NullPointerException e){
+ e.getClass();
+ }
+ //Registry
+ //GameRegistry.registerItem(itemPlateBedrockium, "itemPlateBedrockium");
+ }
+ else {
+ Utils.LOG_WARNING("ExtraUtilities not Found - Skipping Resources.");
+ }
+ //Pneumaticraft
+ if (LoadedMods.PneumaticCraft|| LOAD_ALL_CONTENT){
+ Utils.LOG_INFO("PneumaticCraft Found - Loading Resources.");
+ //Item Init
+ itemPlateCompressedIron = new Item().setUnlocalizedName("itemPlateCompressedIron").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateCompressedIron");
+ //Registry
+ GameRegistry.registerItem(itemPlateCompressedIron, "itemPlateCompressedIron");
+ }
+ else {
+ Utils.LOG_WARNING("PneumaticCraft not Found - Skipping Resources.");
+ }
+ //Simply Jetpacks
+ if (LoadedMods.Simply_Jetpacks|| LOAD_ALL_CONTENT){
+ Utils.LOG_INFO("SimplyJetpacks Found - Loading Resources.");
+ //Item Init
+ itemPlateEnrichedSoularium = new RarityUncommon().setUnlocalizedName("itemPlateEnrichedSoularium").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateSoularium");
+ //Registry
+ GameRegistry.registerItem(itemPlateEnrichedSoularium, "itemPlateEnrichedSoularium");
+ }
+ else {
+ Utils.LOG_WARNING("SimplyJetpacks not Found - Skipping Resources.");
+ }
+ //rfTools
+ if (LoadedMods.RFTools|| LOAD_ALL_CONTENT){
+ Utils.LOG_INFO("rfTools Found - Loading Resources.");
+ //Item Init
+ itemPlateDimensionShard = new Item().setUnlocalizedName("itemPlateDimensionShard").setCreativeTab(AddToCreativeTab.tabMisc).setTextureName(CORE.MODID + ":itemPlateDimensionShard");
+ //Registry
+ GameRegistry.registerItem(itemPlateDimensionShard, "itemPlateDimensionShard");
+ }
+ else {
+ Utils.LOG_WARNING("rfTools not Found - Skipping Resources.");
+ }
+ //IC2 Exp
+ if (LoadedMods.IndustrialCraft2|| LOAD_ALL_CONTENT){
+ Utils.LOG_INFO("IndustrialCraft2 Found - Loading Resources.");
+ //Item Init
+ FuelRod_Empty = new FuelRod_Base("itemFuelRod_Empty", "Empty", 0, 1000);
+ FuelRod_Thorium = new FuelRod_Base("itemFuelRod_Thorium", "Thorium", 1000, 1000);
+ FuelRod_Uranium = new FuelRod_Base("itemFuelRod_Uranium", "Uranium", 2500, 2500);
+ FuelRod_Plutonium = new FuelRod_Base("itemFuelRod_Plutonium", "Plutonium", 5000, 5000);
+ RfEuBattery = new RF2EU_Battery();
+ itemPersonalCloakingDevice = new ItemCloakingDevice(0);
+ //itemPersonalCloakingDeviceCharged = new ItemCloakingDevice(0).set;
+ itemPersonalHealingDevice = new ItemHealingDevice();
+ //Registry
+ //GameRegistry.registerItem(FuelRod_Empty, "itemFuelRod_Empty");
+ //GameRegistry.registerItem(FuelRod_Thorium, "itemFuelRod_Thorium");
+ //GameRegistry.registerItem(FuelRod_Uranium, "itemFuelRod_Uranium");
+ //GameRegistry.registerItem(FuelRod_Plutonium, "itemFuelRod_Plutonium");
+ }
+ else {
+ Utils.LOG_WARNING("IndustrialCraft2 not Found - Skipping Resources.");
+ }
+
+
+ //Special Item Handling Case
+ if (configSwitches.enableAlternativeBatteryAlloy) {
+ ModItems.itemIngotBatteryAlloy = new BaseItemIngot("itemIngotBatteryAlloy", "Battery Alloy", Utils.rgbtoHexValue(35, 228, 141), 0);
+ ModItems.itemPlateBatteryAlloy = new BaseItemPlate("itemPlateBatteryAlloy", "Battery Alloy", Utils.rgbtoHexValue(35, 228, 141), 2, 0);
+ }
+
+
+ //UtilsItems.generateSpawnEgg("ic2", "boatcarbon", Utils.generateSingularRandomHexValue(), Utils.generateSingularRandomHexValue());
+
+
+
+ /*
+ * Misc Items
+ */
+
+ //Staballoy Equipment
+ itemStaballoyPickaxe = new StaballoyPickaxe("itemStaballoyPickaxe", STABALLOY).setCreativeTab(AddToCreativeTab.tabTools);
+ GameRegistry.registerItem(itemStaballoyPickaxe, itemStaballoyPickaxe.getUnlocalizedName());
+ itemStaballoyAxe = new StaballoyAxe("itemStaballoyAxe", STABALLOY).setCreativeTab(AddToCreativeTab.tabTools);
+ GameRegistry.registerItem(itemStaballoyAxe, itemStaballoyAxe.getUnlocalizedName());
+
+ //Sandstone Hammer
+ itemSandstoneHammer = new SandstoneHammer("itemSandstoneHammer").setCreativeTab(AddToCreativeTab.tabTools);
+ GameRegistry.registerItem(itemSandstoneHammer, itemSandstoneHammer.getUnlocalizedName());
+
+ //Buffer Cores!
+ Item itemBufferCore;
+ for(int i=1; i<=10; i++){
+ //Utils.LOG_INFO(""+i);
+ itemBufferCore = new BufferCore("itemBufferCore", i).setCreativeTab(AddToCreativeTab.tabMachines);
+ GameRegistry.registerItem(itemBufferCore, itemBufferCore.getUnlocalizedName()+i);
+ //System.out.println("Buffer Core registration count is: "+i);
+ }
+
+ itemStickyRubber = new Item().setUnlocalizedName("itemStickyRubber").setCreativeTab(tabMachines).setTextureName(CORE.MODID + ":itemStickyRubber");
+ GameRegistry.registerItem(itemStickyRubber, "itemStickyRubber");
+ GT_OreDictUnificator.registerOre("ingotRubber", UtilsItems.getItemStack(CORE.MODID+":itemStickyRubber", 1));
+
+ itemHeliumBlob = new CoreItem("itemHeliumBlob", tabMisc).setTextureName(CORE.MODID + ":itemHeliumBlob");
+ //GameRegistry.registerItem(itemHeliumBlob, "itemHeliumBlob");
+
+ itemPLACEHOLDER_Circuit = new Item().setUnlocalizedName("itemPLACEHOLDER_Circuit").setTextureName(CORE.MODID + ":itemPLACEHOLDER_Circuit");
+ GameRegistry.registerItem(itemPLACEHOLDER_Circuit, "itemPLACEHOLDER_Circuit");
+
+ //ItemBlockGtFrameBox = new ItemBlockGtFrameBox(ModBlocks.blockGtFrameSet1);
+ //GameRegistry.registerItem(ItemBlockGtFrameBox, "itemGtFrameBoxSet1");
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemBackpack.java b/src/Java/gtPlusPlus/core/item/base/BaseItemBackpack.java
new file mode 100644
index 0000000000..316f922639
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemBackpack.java
@@ -0,0 +1,89 @@
+package gtPlusPlus.core.item.base;
+
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.handler.GuiHandler;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.math.MathUtils;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class BaseItemBackpack extends Item{
+
+ protected final int colourValue;
+ protected final String unlocalName;
+
+
+ public BaseItemBackpack(String unlocalizedName, int colour){
+ this.unlocalName = unlocalizedName;
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + "itemBackpack");
+ this.colourValue = colour;
+ GameRegistry.registerItem(this, unlocalizedName);
+ GT_OreDictUnificator.registerOre("storageBackpack", UtilsItems.getSimpleStack(this));
+ setMaxStackSize(1);
+ setCreativeTab(AddToCreativeTab.tabOther);
+ }
+
+ // Without this method, your inventory will NOT work!!!
+ @Override
+ public int getMaxItemUseDuration(ItemStack stack) {
+ return 1; // return any value greater than zero
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player)
+ {
+ if (!world.isRemote)
+ {
+ // If player not sneaking, open the inventory gui
+ if (!player.isSneaking()) {
+ player.openGui(GTplusplus.instance, GuiHandler.GUI3, world, 0, 0, 0);
+ }
+
+ // Otherwise, stealthily place some diamonds in there for a nice surprise next time you open it up :)
+ else {
+ // Utils.LOG_INFO("Player is Sneaking, giving them sneaky diamonds.");
+ // new BaseInventoryBackpack(player.getHeldItem()).setInventorySlotContents(0, new ItemStack(Items.diamond,4));
+ }
+ }
+
+ return itemstack;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colourValue == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colourValue;
+
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+ //Name Formatting.
+ String temp = unlocalName.replace("backpack", "");
+ //Lets find the colour.
+ if (temp.toLowerCase().contains("dark")){
+ temp = unlocalName.substring(12, unlocalName.length());
+ temp = "Dark "+ temp;
+ }
+ return (temp+" Backpack");
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister iconRegister)
+ {
+ this.itemIcon = iconRegister.registerIcon(CORE.MODID + ":" + "itemBackpack");
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemGeneric.java b/src/Java/gtPlusPlus/core/item/base/BaseItemGeneric.java
new file mode 100644
index 0000000000..a6cc29497e
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemGeneric.java
@@ -0,0 +1,30 @@
+package gtPlusPlus.core.item.base;
+
+import gtPlusPlus.core.lib.CORE;
+
+import java.util.List;
+
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+
+public class BaseItemGeneric extends Item
+{
+ public BaseItemGeneric(String unlocalizedName, CreativeTabs c, int stackSize, int maxDmg)
+ {
+ setUnlocalizedName(CORE.MODID + "_" + unlocalizedName);
+ setTextureName(CORE.MODID + ":" + unlocalizedName);
+ setCreativeTab(c);
+ setMaxStackSize(stackSize);
+ setMaxDamage(maxDmg);
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add(EnumChatFormatting.GOLD+"");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemWithCharge.java b/src/Java/gtPlusPlus/core/item/base/BaseItemWithCharge.java
new file mode 100644
index 0000000000..c793776e37
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemWithCharge.java
@@ -0,0 +1,75 @@
+package gtPlusPlus.core.item.base;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+
+import java.util.List;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+
+public class BaseItemWithCharge extends Item{
+
+ public int int_Charge = 0;
+ public int int_Max_Charge = 0;
+
+ public BaseItemWithCharge(String unlocalizedName, int constructor_Charge, int constructor_Max_Charge) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ this.int_Charge = constructor_Charge;
+ this.int_Max_Charge = constructor_Max_Charge;
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ int NBT_Charge = int_Charge;
+ int NBT_Max_Charge = int_Max_Charge;
+ if (stack.stackTagCompound != null) {
+ NBT_Charge = stack.stackTagCompound.getInteger("charge_Current");
+ NBT_Max_Charge = stack.stackTagCompound.getInteger("charge_Max");
+ String tempX = String.valueOf(NBT_Charge);
+ String tempY = String.valueOf(NBT_Max_Charge);
+ String formattedX = EnumChatFormatting.RED+tempX+EnumChatFormatting.GRAY;
+ String formattedY = EnumChatFormatting.DARK_RED+tempY+EnumChatFormatting.GRAY;
+ list.add(EnumChatFormatting.GRAY+"Charge:"+formattedX+"/"+formattedY+".");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+ }
+
+ //Ticking and NBT Handling
+ /* Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
+ * update it's contents.
+ *
+ * public int fuelRemaining = 0;
+ public int maximumFuel = 0;
+ public String fuelType = "";
+ public float heat = 0;
+ public float maxHeat = 5000;
+ *
+ */
+ @Override
+ public void onCreated(ItemStack itemStack, World world, EntityPlayer player) {
+
+ }
+
+ @Override
+ public void onUpdate(ItemStack itemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
+
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer par3Entity) {
+ itemStack.stackTagCompound = new NBTTagCompound();
+ return super.onItemRightClick(itemStack, world, par3Entity);
+ }
+
+
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/BaseItemWithDamageValue.java b/src/Java/gtPlusPlus/core/item/base/BaseItemWithDamageValue.java
new file mode 100644
index 0000000000..ec052ef1f9
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/BaseItemWithDamageValue.java
@@ -0,0 +1,29 @@
+package gtPlusPlus.core.item.base;
+
+import gtPlusPlus.core.lib.CORE;
+
+import java.util.List;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+
+public class BaseItemWithDamageValue extends Item{
+ public BaseItemWithDamageValue(String unlocalizedName) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setMaxDamage(100);
+ }
+ @Override
+ public void setDamage(ItemStack stack, int damage) {
+ super.setDamage(stack, damage);
+ }
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add(EnumChatFormatting.GOLD+"");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java b/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java
new file mode 100644
index 0000000000..9407689cfc
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/BasicSpawnEgg.java
@@ -0,0 +1,259 @@
+package gtPlusPlus.core.item.base;
+
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.util.Utils;
+
+import java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockLiquid;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityList;
+import net.minecraft.entity.EntityLiving;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.IEntityLivingData;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemMonsterPlacer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.Facing;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.MathHelper;
+import net.minecraft.util.MovingObjectPosition;
+import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+
+
+public class BasicSpawnEgg extends ItemMonsterPlacer
+{
+ @SideOnly(Side.CLIENT)
+ private IIcon theIcon;
+ protected int colorBase = 0x000000;
+ protected int colorSpots = 0xFFFFFF;
+ protected String entityMODID = "";
+ protected String entityToSpawnName = "";
+ protected String entityToSpawnNameFull = "";
+ protected EntityLiving entityToSpawn = null;
+
+ public BasicSpawnEgg(){
+ super();
+ }
+
+ public BasicSpawnEgg(String MODID, String parEntityToSpawnName, int parPrimaryColor, int parSecondaryColor){
+ setHasSubtypes(false);
+ maxStackSize = 64;
+ setCreativeTab(AddToCreativeTab.tabOther);
+ setEntityToSpawnName(parEntityToSpawnName);
+ colorBase = parPrimaryColor;
+ colorSpots = parSecondaryColor;
+ entityMODID = MODID;
+
+ // DEBUG
+ Utils.LOG_WARNING("Spawn egg constructor for "+entityToSpawnName);
+ }
+
+ /**
+ * Callback for item usage. If the item does something special on right clicking,
+
+ * he will have one of those. Return
+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS
+ */
+ @Override
+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10){
+ if (par3World.isRemote)
+ {
+ return true;
+ }
+ Block block = par3World.getBlock(par4, par5, par6);
+ par4 += Facing.offsetsXForSide[par7];
+ par5 += Facing.offsetsYForSide[par7];
+ par6 += Facing.offsetsZForSide[par7];
+ double d0 = 0.0D;
+
+ if (par7 == 1 && block.getRenderType() == 11)
+ {
+ d0 = 0.5D;
+ }
+
+ Entity entity = spawnEntity(par3World, par4 + 0.5D, par5 + d0, par6 + 0.5D);
+
+ if (entity != null)
+ {
+ if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName())
+ {
+ ((EntityLiving)entity).setCustomNameTag(par1ItemStack.getDisplayName());
+ }
+
+ if (!par2EntityPlayer.capabilities.isCreativeMode)
+ {
+ --par1ItemStack.stackSize;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Called whenever this item is equipped and the right mouse button is pressed.
+
+ *Args: itemStack, world, entityPlayer
+ */
+ @Override
+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer){
+ if (par2World.isRemote)
+ {
+ return par1ItemStack;
+ }
+ MovingObjectPosition movingobjectposition = getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true);
+
+ if (movingobjectposition == null)
+ {
+ return par1ItemStack;
+ }
+ if (movingobjectposition.typeOfHit == MovingObjectPosition
+
+ .MovingObjectType.BLOCK)
+
+ {
+ int i = movingobjectposition.blockX;
+ int j = movingobjectposition.blockY;
+ int k = movingobjectposition.blockZ;
+
+ if (!par2World.canMineBlock(par3EntityPlayer, i, j, k))
+ {
+ return par1ItemStack;
+ }
+
+ if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, par1ItemStack))
+ {
+ return par1ItemStack;
+ }
+
+ if (par2World.getBlock(i, j, k) instanceof BlockLiquid)
+ {
+ Entity entity = spawnEntity(par2World, i, j, k);
+
+ if (entity != null)
+ {
+ if (entity instanceof EntityLivingBase && par1ItemStack.hasDisplayName())
+ {
+ ((EntityLiving)entity).setCustomNameTag(par1ItemStack.getDisplayName());
+ }
+
+ if (!par3EntityPlayer.capabilities.isCreativeMode)
+ {
+ --par1ItemStack.stackSize;
+ }
+ }
+ }
+ }
+
+ return par1ItemStack;
+ }
+
+ /**
+ * Spawns the creature specified by the egg's type in the location specified by
+
+ * the last three parameters.
+ * Parameters: world, entityID, x, y, z.
+ */
+ public Entity spawnEntity(World parWorld, double parX, double parY, double parZ){
+
+ if (!parWorld.isRemote) // never spawn entity on client side
+ {
+ entityToSpawnNameFull = entityMODID+"."+entityToSpawnName;
+ if (EntityList.stringToClassMapping.containsKey(entityToSpawnNameFull))
+ {
+ entityToSpawn = (EntityLiving) EntityList
+
+ .createEntityByName(entityToSpawnNameFull, parWorld);
+ entityToSpawn.setLocationAndAngles(parX, parY, parZ,
+
+ MathHelper.wrapAngleTo180_float(parWorld.rand.nextFloat()
+
+ * 360.0F), 0.0F);
+ parWorld.spawnEntityInWorld(entityToSpawn);
+ entityToSpawn.onSpawnWithEgg((IEntityLivingData)null);
+ entityToSpawn.playLivingSound();
+ }
+ else
+ {
+ //DEBUG
+ Utils.LOG_WARNING("Entity not found "+entityToSpawnName);
+ }
+ }
+
+ return entityToSpawn;
+ }
+
+
+ /**
+ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(Item parItem, CreativeTabs parTab, List parList){
+ parList.add(new ItemStack(parItem, 1, 0));
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getColorFromItemStack(ItemStack par1ItemStack, int parColorType){
+ return (parColorType == 0) ? colorBase : colorSpots;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses(){
+ return true;
+ }
+
+ @Override
+ // Doing this override means that there is no localization for language
+ // unless you specifically check for localization here and convert
+ public String getItemStackDisplayName(ItemStack par1ItemStack){
+ return "Spawn "+entityToSpawnName;
+ }
+
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister par1IconRegister){
+ super.registerIcons(par1IconRegister);
+ theIcon = par1IconRegister.registerIcon(getIconString() + "_overlay");
+ }
+
+ /**
+ * Gets an icon index based on an item's damage value and the given render pass
+ */
+ @Override
+ @SideOnly(Side.CLIENT)
+ public IIcon getIconFromDamageForRenderPass(int parDamageVal, int parRenderPass){
+ return parRenderPass > 0 ? theIcon : super.getIconFromDamageForRenderPass(parDamageVal, parRenderPass);
+ }
+
+ public void setColors(int parColorBase, int parColorSpots){
+ colorBase = parColorBase;
+ colorSpots = parColorSpots;
+ }
+
+ public int getColorBase(){
+ return colorBase;
+ }
+
+ public int getColorSpots(){
+ return colorSpots;
+ }
+
+ public void setEntityToSpawnName(String parEntityToSpawnName){
+ entityToSpawnName = parEntityToSpawnName;
+ entityToSpawnNameFull = entityMODID+"."+entityToSpawnName;
+ }
+
+}
+
diff --git a/src/Java/gtPlusPlus/core/item/base/CoreItem.java b/src/Java/gtPlusPlus/core/item/base/CoreItem.java
new file mode 100644
index 0000000000..b77b2d336e
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/CoreItem.java
@@ -0,0 +1,118 @@
+package gtPlusPlus.core.item.base;
+
+import gtPlusPlus.core.lib.CORE;
+
+import java.util.List;
+
+import net.minecraft.creativetab.CreativeTabs;
+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;
+
+public class CoreItem extends Item
+{
+
+ private final EnumRarity rarity;
+ private final EnumChatFormatting descColour;
+ private final String itemDescription;
+ private final boolean hasEffect;
+
+ //0
+ /*
+ * Name, Tab - 64 Stack, 0 Dmg
+ */
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab)
+ {
+ this(unlocalizedName, creativeTab, 64, 0); //Calls 3
+ }
+ //1
+ /*
+ * Name, Tab, Stack - 0 Dmg
+ */
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize)
+ {
+ this(unlocalizedName, creativeTab, stackSize, 0); //Calls 3
+ }
+ //2
+ /*
+ * Name, Tab, Stack, Description - 0 Dmg
+ */
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize, String description)
+ {
+ this(unlocalizedName, creativeTab, stackSize, 0, description); //Calls 4
+ }
+ //3
+ /*
+ * Name, Tab, Stack, Dmg - Description
+ */
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize, int maxDmg)
+ {
+ this(unlocalizedName, creativeTab, stackSize, maxDmg, ""); //Calls 4
+ }
+ //4 //Not Rare + basic tooltip
+ /*
+ * Name, Tab, Stack, Dmg, Description
+ */
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize, int maxDmg, String description)
+ {
+ this(unlocalizedName, creativeTab, stackSize, maxDmg, description, EnumRarity.common, EnumChatFormatting.GRAY, false); //Calls 4.5
+ }
+ //4.5
+ /*
+ * Name, Tab, Stack, Dmg, Description, Text Colour - Common
+ */
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize, int maxDmg, String description, EnumChatFormatting colour)
+ {
+ this(unlocalizedName, creativeTab, stackSize, maxDmg, description, EnumRarity.common, colour, false); //Calls 5
+ }
+
+ //4.75
+ /*
+ * Name, Tab, Stack, Dmg, Description, Rarity - Gray text
+ */
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize, int maxDmg, String description, EnumRarity rarity)
+ {
+ this(unlocalizedName, creativeTab, stackSize, maxDmg, description, rarity, EnumChatFormatting.GRAY, false); //Calls 5
+ }
+
+ //5
+ /*
+ * Name, Tab, Stack, Dmg, Description, Rarity, Text Colour, Effect
+ */
+ public CoreItem(String unlocalizedName, CreativeTabs creativeTab, int stackSize, int maxDmg, String description, EnumRarity regRarity, EnumChatFormatting colour, boolean Effect)
+ {
+ setUnlocalizedName(unlocalizedName);
+ setTextureName(CORE.MODID + ":" + unlocalizedName);
+ setCreativeTab(creativeTab);
+ setMaxStackSize(stackSize);
+ setMaxDamage(maxDmg);
+ this.rarity = regRarity;
+ this.itemDescription = description;
+ this.descColour = colour;
+ this.hasEffect = Effect;
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add(descColour+itemDescription);
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack par1ItemStack){
+ return rarity;
+ }
+
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack){
+ return hasEffect;
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java b/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java
new file mode 100644
index 0000000000..0f56730177
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/bolts/BaseItemBolt.java
@@ -0,0 +1,82 @@
+package gtPlusPlus.core.item.base.bolts;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.math.MathUtils;
+
+import java.util.List;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class BaseItemBolt extends Item{
+
+ protected int colour;
+ protected String materialName;
+ protected String unlocalName;
+ private int mTier;
+
+ public BaseItemBolt(String unlocalizedName, String materialName, int colour, int tier) {
+ setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(unlocalizedName);
+ this.unlocalName = unlocalizedName;
+ this.setMaxStackSize(64);
+ this.setTextureName(CORE.MODID + ":" + "itemBolt");
+ this.colour = colour;
+ this.mTier = tier;
+ this.materialName = materialName;
+ GameRegistry.registerItem(this, unlocalizedName);
+ GT_OreDictUnificator.registerOre(unlocalName.replace("itemB", "b"), UtilsItems.getSimpleStack(this));
+ addExtruderRecipe();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return (materialName+ " Bolt");
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (materialName != null && materialName != "" && !materialName.equals("")){
+ list.add(EnumChatFormatting.GRAY+"A small Bolt, constructed from " + materialName + ".");
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public final String getMaterialName() {
+ return materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colour;
+
+ }
+
+ private void addExtruderRecipe(){
+ Utils.LOG_WARNING("Adding recipe for "+materialName+" Bolts");
+ String tempIngot = unlocalName.replace("itemBolt", "ingot");
+ ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1);
+ if (null != tempOutputStack){
+ GT_Values.RA.addExtruderRecipe(tempOutputStack,
+ ItemList.Shape_Extruder_Bolt.get(1),
+ UtilsItems.getSimpleStack(this, 8),
+ 30*mTier*20,
+ 24*mTier);
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
new file mode 100644
index 0000000000..6d12624487
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDust.java
@@ -0,0 +1,352 @@
+package gtPlusPlus.core.item.base.dusts;
+
+import static gtPlusPlus.core.creative.AddToCreativeTab.tabMisc;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.lib.MaterialInfo;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+
+import java.util.List;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class BaseItemDust extends Item{
+
+ protected int colour;
+ protected String materialName;
+ protected String pileType;
+ protected boolean useBlastFurnace;
+ String name = "";
+ private int mTier;
+ private MaterialInfo dustInfo;
+
+ public BaseItemDust(String unlocalizedName, String materialName, MaterialInfo matInfo, int colour, String pileSize, boolean blastFurnaceRequired, int tier, int sRadioactivity) {
+ setUnlocalizedName(unlocalizedName);
+ this.setUnlocalizedName(unlocalizedName);
+ this.setMaxStackSize(64);
+ if (pileSize == "dust" || pileSize == "Dust"){
+ this.setTextureName(CORE.MODID + ":" + "dust");}
+ else{
+ this.setTextureName(CORE.MODID + ":" + "dust"+pileSize);}
+ this.setCreativeTab(tabMisc);
+ this.colour = colour;
+ this.mTier = tier;
+ this.materialName = materialName;
+ this.useBlastFurnace = blastFurnaceRequired;
+ this.dustInfo = matInfo;
+ this.sRadiation = sRadioactivity;
+ GameRegistry.registerItem(this, unlocalizedName);
+
+ String temp = "";
+ Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+getUnlocalizedName());
+ if (getUnlocalizedName().contains("item.")){
+ temp = getUnlocalizedName().replace("item.", "");
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
+ }
+ else {
+ temp = getUnlocalizedName();
+ }
+ if (temp.contains("DustTiny")){
+ temp = temp.replace("itemD", "d");
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
+ }
+ else if (temp.contains("DustSmall")){
+ temp = temp.replace("itemD", "d");
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
+ }
+ else {
+ temp = temp.replace("itemD", "d");
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
+ }
+ if (temp != null && temp != ""){
+ GT_OreDictUnificator.registerOre(temp, UtilsItems.getSimpleStack(this));
+ }
+ addMixerRecipe();
+ addFurnaceRecipe();
+ addMacerationRecipe();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack iStack) {
+
+ if (getUnlocalizedName().contains("DustTiny")){
+ name = "Tiny Pile of "+materialName + " Dust";
+ }
+ else if (getUnlocalizedName().contains("DustSmall")){
+ name = "Small Pile of "+materialName + " Dust";
+ }
+ else {
+ name = materialName + " Dust";
+ }
+ return name;
+ }
+
+ protected final int sRadiation;
+ @Override
+ public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) {
+ Utils.applyRadiationDamageToEntity(sRadiation, world, entityHolding);
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ //if (pileType != null && materialName != null && pileType != "" && materialName != "" && !pileType.equals("") && !materialName.equals("")){
+ if (getUnlocalizedName().contains("DustTiny")){
+ list.add(EnumChatFormatting.GRAY+"A tiny pile of " + materialName + " dust.");
+ }
+ else if (getUnlocalizedName().contains("DustSmall")){
+ list.add(EnumChatFormatting.GRAY+"A small pile of " + materialName + " dust.");
+ }
+ else {
+ list.add(EnumChatFormatting.GRAY+"A pile of " + materialName + " dust.");
+ }
+ if (sRadiation > 0){
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }
+ //}
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public final String getMaterialName() {
+ return materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colour;
+
+ }
+
+
+
+ private void addMixerRecipe(){
+ ItemStack tempStack = UtilsItems.getSimpleStack(this);
+ ItemStack tempOutput = null;
+ ItemStack[] inputStacks = dustInfo.getInputs();
+ ItemStack[] outputStacks = dustInfo.getOutputs();
+ String temp = "";
+ Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+getUnlocalizedName());
+ if (getUnlocalizedName().contains("item.")){
+ temp = getUnlocalizedName().replace("item.", "");
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
+ }
+ else {
+ temp = getUnlocalizedName();
+ }
+ if (temp.contains("DustTiny")){
+ temp = temp.replace("itemDustTiny", "dust");
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
+ }
+ else if (temp.contains("DustSmall")){
+ temp = temp.replace("itemDustSmall", "dust");
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
+ }
+ else {
+ temp = temp.replace("itemD", "d");
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
+ }
+ if (temp != null && temp != ""){
+
+ if (getUnlocalizedName().contains("DustTiny") || getUnlocalizedName().contains("DustSmall")){
+ tempOutput = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1);
+ }
+ else {
+ if (outputStacks[0] != null){
+ Utils.LOG_WARNING("Getting output dusts for mixer recipe. Checking ENUM, got: "+outputStacks[0].toString());
+ tempOutput = outputStacks[0];
+ }
+ else {
+ Utils.LOG_WARNING("Getting output dusts for mixer recipe. Enum check failed, failback item is: "+temp);
+ tempOutput = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1);
+ }
+ }
+
+ }
+
+ if (tempOutput != null){
+ if (getUnlocalizedName().contains("DustTiny")){
+ Utils.LOG_WARNING("Generating a 9 Tiny dust to 1 Dust recipe for "+materialName);
+ UtilsRecipe.addShapelessGregtechRecipe(tempOutput,
+ tempStack, tempStack, tempStack,
+ tempStack, tempStack, tempStack,
+ tempStack, tempStack, tempStack);
+ }
+ else if (getUnlocalizedName().contains("DustSmall")){
+ Utils.LOG_WARNING("Generating a 4 Small dust to 1 Dust recipe for "+materialName);
+ UtilsRecipe.addShapelessGregtechRecipe(tempOutput,
+ tempStack, tempStack, null,
+ tempStack, tempStack, null,
+ null, null, null);
+ }
+ else {
+ Utils.LOG_WARNING("Generating a Dust recipe for "+materialName+" in the mixer.");
+
+
+ int i = 0;
+ if (inputStacks.length >= 2){
+ for (ItemStack is : inputStacks){
+ if (is != null){
+ Utils.LOG_WARNING("Found "+is.getDisplayName()+" as an input for mixer recipe.");
+ if (is.getDisplayName().toLowerCase().contains("tell alkalus")){
+ ItemStack tempStackForAName = inputStacks[i];
+ String[] inputList = dustInfo.getInputItemsAsList();
+ int[] inputSizes = dustInfo.getInputStackSizesAsList();
+ inputStacks[i] = UtilsItems.getItemStackOfAmountFromOreDict(inputList[i], inputSizes[i]);
+ Utils.LOG_WARNING("Swapping input slot "+i+" which contains "+tempStackForAName.getDisplayName()+" with "+inputStacks[i].getDisplayName()+".");
+ }
+
+ }
+
+ else {
+ Utils.LOG_WARNING("Input "+i+" was null.");
+ }
+
+ i++;
+ }
+ }
+
+ GT_Values.RA.addMixerRecipe(
+ inputStacks[0], inputStacks[1],
+ inputStacks[2], inputStacks[3],
+ null, null,
+ tempOutput,
+ 8*mTier*20, 8*mTier*2);
+
+ /*GT_Values.RA.addMixerRecipe(
+ GT_Utility.copyAmount(inputStacks[0].stackSize, new Object[]{inputStacks[0]}), GT_Utility.copyAmount(inputStacks[1].stackSize, new Object[]{inputStacks[1]}),
+ GT_Utility.copyAmount(inputStacks[2].stackSize, new Object[]{inputStacks[2]}), GT_Utility.copyAmount(inputStacks[3].stackSize, new Object[]{inputStacks[3]}),
+ null, null,
+ tempOutput,
+ 8*mTier*20, 8*mTier*2);*/
+
+ }
+ }
+
+ }
+
+ private void addMacerationRecipe(){
+ Utils.LOG_WARNING("Adding recipe for "+materialName+" Dusts");
+
+ String tempIngot = getUnlocalizedName().replace("item.itemDust", "ingot");
+ String tempDust = getUnlocalizedName().replace("item.itemDust", "dust");
+ ItemStack tempInputStack;
+ ItemStack tempOutputStack;
+
+ if (getUnlocalizedName().contains("DustSmall") || getUnlocalizedName().contains("DustTiny")){
+ return;
+ }
+
+ Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+getUnlocalizedName());
+ if (getUnlocalizedName().contains("item.")){
+ tempIngot = getUnlocalizedName().replace("item.", "");
+ Utils.LOG_WARNING("Generating OreDict Name: "+tempIngot);
+ }
+ else {
+ tempIngot = getUnlocalizedName();
+ }
+
+ tempIngot = tempIngot.replace("itemDust", "ingot");
+ Utils.LOG_WARNING("Generating OreDict Name: "+tempIngot);
+ ItemStack[] outputStacks = dustInfo.getOutputs();
+ if (tempIngot != null && tempIngot != ""){
+ tempInputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1);
+ tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempDust, 1);
+ ItemStack tempStackOutput2;
+ int chance = mTier*10/MathUtils.randInt(10, 20);
+ if (outputStacks[1] != null && !outputStacks[1].getUnlocalizedName().toLowerCase().contains("aaa_broken")){
+ tempStackOutput2 = outputStacks[1];
+ tempOutputStack = outputStacks[0];
+ }
+ else {
+ tempStackOutput2 = null;
+ }
+ if (null != tempOutputStack && null != tempInputStack){
+ GT_ModHandler.addPulverisationRecipe(tempInputStack, tempOutputStack.splitStack(1), tempStackOutput2, chance);
+ }
+ }
+ }
+
+ private void addFurnaceRecipe(){
+
+ String temp = "";
+ if (getUnlocalizedName().contains("item.")){
+ temp = getUnlocalizedName().replace("item.", "");
+ }
+ else {
+ temp = getUnlocalizedName();
+ }
+ if (temp.contains("DustTiny") || temp.contains("DustSmall")){
+ return;
+ }
+ temp = temp.replace("itemDust", "ingot");
+ if (temp != null && temp != ""){
+
+ if (this.useBlastFurnace){
+ Utils.LOG_WARNING("Adding recipe for Hot "+materialName+" Ingots in a Blast furnace.");
+ String tempIngot = temp.replace("ingot", "ingotHot");
+ ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1);
+ Utils.LOG_WARNING("This will produce "+tempOutputStack.getDisplayName() + " Debug: "+tempIngot);
+ if (null != tempOutputStack){
+ addBlastFurnaceRecipe(UtilsItems.getSimpleStack(this), null, tempOutputStack, null, 350*mTier);
+ }
+ return;
+ }
+ Utils.LOG_WARNING("Adding recipe for "+materialName+" Ingots in a furnace.");
+ ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1);
+ Utils.LOG_WARNING("This will produce an ingot of "+tempOutputStack.getDisplayName() + " Debug: "+temp);
+ if (null != tempOutputStack){
+ if (mTier < 5){
+ CORE.GT_Recipe.addSmeltingAndAlloySmeltingRecipe(UtilsItems.getSimpleStack(this), tempOutputStack);
+ }
+ else if (mTier >= 5){
+ Utils.LOG_WARNING("Adding recipe for "+materialName+" Ingots in a Blast furnace.");
+ Utils.LOG_WARNING("This will produce "+tempOutputStack.getDisplayName());
+ if (null != tempOutputStack){
+ addBlastFurnaceRecipe(UtilsItems.getSimpleStack(this), null, tempOutputStack, null, 350*mTier);
+ }
+ return;
+ }
+ }
+
+ }
+ }
+
+ private void addBlastFurnaceRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, int tempRequired){
+ //Special Cases
+ /*if (input1.getUnlocalizedName().toLowerCase().contains("tantalloy61")){
+ Utils.LOG_INFO("Adding Special handler for Staballoy-61 in the Blast Furnace");
+ input2 = UtilsItems.getItemStackOfAmountFromOreDict("dustTantalloy60", 2);
+ if (input2 == null){
+ Utils.LOG_INFO("invalid itemstack.");
+ }
+ else {
+ Utils.LOG_INFO("Found "+input2.getDisplayName());
+ }
+ }*/
+ GT_Values.RA.addBlastRecipe(
+ input1,
+ input2,
+ GT_Values.NF, GT_Values.NF,
+ output1,
+ output2,
+ 250*mTier*20,
+ mTier*64,
+ tempRequired);
+
+
+
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java
new file mode 100644
index 0000000000..a49dc58188
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/dusts/BaseItemDustAbstract.java
@@ -0,0 +1,42 @@
+package gtPlusPlus.core.item.base.dusts;
+
+import gtPlusPlus.core.lib.CORE;
+
+import java.util.List;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public abstract class BaseItemDustAbstract extends Item{
+
+ protected int colour = 0;
+ protected String materialName;
+ protected String pileType;
+
+ public BaseItemDustAbstract(String unlocalizedName, String materialName, int colour, String pileSize) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.setMaxStackSize(64);
+ if (pileSize == "dust" || pileSize == "Dust"){
+ this.setTextureName(CORE.MODID + ":" + "dust");
+ }
+ else{
+ this.setTextureName(CORE.MODID + ":" + "dust"+pileSize);
+ }
+ this.setMaxStackSize(64);
+ this.colour = colour;
+ this.materialName = materialName;
+ setUnlocalizedName(unlocalizedName);
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
+
+ @Override
+ public abstract void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool);
+
+ public abstract String getMaterialName();
+
+ @Override
+ public abstract int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF);
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/foods/BaseItemFood.java b/src/Java/gtPlusPlus/core/item/base/foods/BaseItemFood.java
new file mode 100644
index 0000000000..7b0663d9cf
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/foods/BaseItemFood.java
@@ -0,0 +1,47 @@
+package gtPlusPlus.core.item.base.foods;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemFood;
+import net.minecraft.item.ItemStack;
+import net.minecraft.potion.PotionEffect;
+import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class BaseItemFood extends ItemFood {
+
+ private PotionEffect[] effects;
+ protected String localName;
+
+ public BaseItemFood(String unlocalizedName, String localizedName, int healAmount, float saturationModifier, boolean wolvesFavorite, PotionEffect... effects) {
+ super(healAmount, saturationModifier, wolvesFavorite);
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName.replace("Hot", ""));
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.effects = effects;
+ this.localName = localizedName;
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
+
+ @Override
+ protected void onFoodEaten(ItemStack stack, World world, EntityPlayer player) {
+ super.onFoodEaten(stack, world, player);
+
+ for (int i = 0; i < effects.length; i ++) {
+ if (!world.isRemote && effects[i] != null && effects[i].getPotionID() > 0)
+ player.addPotionEffect(new PotionEffect(this.effects[i].getPotionID(),
+ this.effects[i].getDuration(), this.effects[i].getAmplifier(),
+ this.effects[i].getIsAmbient()
+ )
+ );
+ }
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return ("A Serving of "+localName);
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java b/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java
new file mode 100644
index 0000000000..aaad22be9c
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/foods/BaseItemHotFood.java
@@ -0,0 +1,78 @@
+package gtPlusPlus.core.item.base.foods;
+
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.math.MathUtils;
+
+import java.util.List;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.DamageSource;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+
+public class BaseItemHotFood extends BaseItemFood{
+
+ protected String materialName;
+ protected String unlocalName;
+ protected int cooldownTime;
+ protected Item output;
+
+ public BaseItemHotFood(String unlocalizedName, int healAmount, float healSaturation, String foodName, int timeToCoolInSeconds, Item cooledFood) {
+ super(unlocalizedName, "Hot "+foodName, healAmount, healSaturation, false);
+ this.unlocalName = unlocalizedName;
+ this.cooldownTime = timeToCoolInSeconds * 20;
+ this.materialName = foodName;
+ this.output = cooledFood;
+ this.setMaxStackSize(1);
+ }
+
+ @Override
+ public ItemStack onEaten(ItemStack iStack, World world, EntityPlayer player) {
+ return super.onEaten(iStack, world, player);
+ }
+
+ @Override
+ public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) {
+ //Utils.LOG_INFO("Item Damage: "+iStack.getItemDamage()+" Max Damage: "+iStack.getMaxDamage());
+ if (!world.isRemote){
+ if(iStack.getItemDamage() == cooldownTime) {
+ if (entityHolding instanceof EntityPlayer){
+ Utils.LOG_INFO("Foods Done.");
+ ((EntityPlayer) entityHolding).inventory.addItemStackToInventory(UtilsItems.getSimpleStack(output));
+ ((EntityPlayer) entityHolding).inventory.consumeInventoryItem(this);
+ }
+ }else if(iStack.getItemDamage() < cooldownTime){
+ iStack.setItemDamage(iStack.getItemDamage() + 1);
+ }
+ if(MathUtils.divideXintoY(iStack.getItemDamage(), 150)){
+ entityHolding.attackEntityFrom(DamageSource.onFire, 1);
+ }
+
+
+ }
+ super.onUpdate(iStack, world, entityHolding, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (materialName != null && materialName != "" && !materialName.equals("")){
+ list.add(EnumChatFormatting.GRAY+"Warning: "+EnumChatFormatting.RED+"Very hot!"+EnumChatFormatting.GRAY+" Avoid direct handling..");
+ list.add(EnumChatFormatting.GRAY+"This food has "+((cooldownTime-(int) stack.getItemDamage())/20)+" seconds left, until it is cool.");
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public final String getMaterialName() {
+ return materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ return Utils.rgbtoHexValue(230, 96, 96);
+
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java b/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java
new file mode 100644
index 0000000000..ba41625b25
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/gears/BaseItemGear.java
@@ -0,0 +1,82 @@
+package gtPlusPlus.core.item.base.gears;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.math.MathUtils;
+
+import java.util.List;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class BaseItemGear extends Item{
+
+ protected int colour;
+ protected String materialName;
+ protected String unlocalName;
+ private int mTier;
+
+ public BaseItemGear(String unlocalizedName, String materialName, int colour, int tier) {
+ setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(unlocalizedName);
+ this.unlocalName = unlocalizedName;
+ this.setMaxStackSize(64);
+ this.setTextureName(CORE.MODID + ":" + "itemGear");
+ this.colour = colour;
+ this.mTier = tier;
+ this.materialName = materialName;
+ GameRegistry.registerItem(this, unlocalizedName);
+ GT_OreDictUnificator.registerOre(unlocalName.replace("itemG", "g"), UtilsItems.getSimpleStack(this));
+ addExtruderRecipe();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return (materialName+ " Gear");
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (materialName != null && materialName != "" && !materialName.equals("")){
+ list.add(EnumChatFormatting.GRAY+"A large Gear, constructed from " + materialName + ".");
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public final String getMaterialName() {
+ return materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colour;
+
+ }
+
+ private void addExtruderRecipe(){
+ Utils.LOG_WARNING("Adding recipe for "+materialName+" Gears");
+ String tempIngot = unlocalName.replace("itemGear", "ingot");
+ ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 8);
+ if (null != tempOutputStack){
+ GT_Values.RA.addExtruderRecipe(tempOutputStack,
+ ItemList.Shape_Extruder_Gear.get(1),
+ UtilsItems.getSimpleStack(this),
+ 40*mTier*20,
+ 24*mTier);
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java
new file mode 100644
index 0000000000..e193636043
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngot.java
@@ -0,0 +1,118 @@
+package gtPlusPlus.core.item.base.ingots;
+
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.math.MathUtils;
+
+import java.util.List;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class BaseItemIngot extends Item{
+
+ protected int colour;
+ protected String materialName;
+ protected String unlocalName;
+
+ public BaseItemIngot(String unlocalizedName, String materialName, int colour, int sRadioactivity) {
+ setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(unlocalizedName);
+ this.unlocalName = unlocalizedName;
+ this.setMaxStackSize(64);
+ this.setTextureName(CORE.MODID + ":" + "itemIngot");
+ this.setMaxStackSize(64);
+ this.colour = colour;
+ this.materialName = materialName;
+ this.sRadiation = sRadioactivity;
+ GameRegistry.registerItem(this, unlocalizedName);
+ String temp = "";
+ if (unlocalName.contains("itemIngot")){
+ temp = unlocalName.replace("itemI", "i");
+ }
+ else if (unlocalName.contains("itemHotIngot")){
+ temp = unlocalName.replace("itemHotIngot", "ingotHot");
+ }
+ if (temp != null && temp != ""){
+ GT_OreDictUnificator.registerOre(temp, UtilsItems.getSimpleStack(this));
+ }
+ generateCompressorRecipe();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return (materialName+ " Ingot");
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (materialName != null && materialName != "" && !materialName.equals("") && !unlocalName.contains("HotIngot")){
+ list.add(EnumChatFormatting.GRAY+"A solid ingot of " + materialName + ".");
+ }
+ else if (materialName != null && materialName != "" && !materialName.equals("") && unlocalName.toLowerCase().contains("ingothot")){
+ list.add(EnumChatFormatting.GRAY+"Warning: "+EnumChatFormatting.RED+"Very hot! "+EnumChatFormatting.GRAY+" Avoid direct handling..");
+ }
+ if (sRadiation > 0){
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public final String getMaterialName() {
+ return materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colour;
+
+ }
+
+ private void generateCompressorRecipe(){
+ if (unlocalName.contains("itemIngot")){
+ ItemStack tempStack = UtilsItems.getSimpleStack(this, 9);
+ ItemStack tempOutput = null;
+ String temp = getUnlocalizedName().replace("item.itemIngot", "block");
+ Utils.LOG_WARNING("Unlocalized name for OreDict nameGen: "+getUnlocalizedName());
+ if (getUnlocalizedName().contains("item.")){
+ temp = getUnlocalizedName().replace("item.", "");
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
+ }
+ temp = temp.replace("itemIngot", "block");
+ Utils.LOG_WARNING("Generating OreDict Name: "+temp);
+ if (temp != null && temp != ""){
+ tempOutput = UtilsItems.getItemStackOfAmountFromOreDict(temp, 1);
+ if (tempOutput != null){
+ GT_ModHandler.addCompressionRecipe(tempStack, tempOutput);
+ }
+
+ }
+ }
+ else if (unlocalName.contains("itemHotIngot")){
+ return;
+ }
+
+
+ }
+
+
+ protected final int sRadiation;
+ @Override
+ public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) {
+ Utils.applyRadiationDamageToEntity(sRadiation, world, entityHolding);
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java
new file mode 100644
index 0000000000..6fa358f36f
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/ingots/BaseItemIngotHot.java
@@ -0,0 +1,73 @@
+package gtPlusPlus.core.item.base.ingots;
+
+import gregtech.api.enums.GT_Values;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+
+import java.util.List;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.DamageSource;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+
+public class BaseItemIngotHot extends BaseItemIngot{
+
+ private ItemStack outputIngot;
+ private int tickCounter = 0;
+ private int tickCounterMax = 200;
+ private int mTier;
+
+ public BaseItemIngotHot(String unlocalizedName, String materialName, ItemStack coldIngot, int tier) {
+ super(unlocalizedName, materialName, Utils.rgbtoHexValue(225, 225, 225), 0);
+ this.setTextureName(CORE.MODID + ":" + "itemIngotHot");
+ this.outputIngot = coldIngot;
+ this.mTier = tier;
+ generateRecipe();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return ("Hot "+materialName+ " Ingot");
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (materialName != null && materialName != "" && !materialName.equals("")){
+ list.add(EnumChatFormatting.GRAY+"A "+EnumChatFormatting.RED+"burning hot"+EnumChatFormatting.GRAY+" ingot of " + materialName + ".");
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ return Utils.rgbtoHexValue(225, 225, 225);
+ }
+
+ private void generateRecipe(){
+ Utils.LOG_WARNING("Adding Vacuum Freezer recipe for a Hot Ingot of "+materialName+".");
+ GT_Values.RA.addVacuumFreezerRecipe(UtilsItems.getSimpleStack(this), outputIngot.copy(), 60*mTier);
+
+
+ }
+
+ @Override
+ public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) {
+ if (!world.isRemote){
+ if(tickCounter < tickCounterMax){
+ tickCounter++;
+ }
+ else if(tickCounter == tickCounterMax){
+ entityHolding.attackEntityFrom(DamageSource.onFire, 1);
+ tickCounter = 0;
+ }
+ super.onUpdate(iStack, world, entityHolding, p_77663_4_, p_77663_5_);
+ }
+ }
+
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBase.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBase.java
new file mode 100644
index 0000000000..488f9a6f60
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockBase.java
@@ -0,0 +1,22 @@
+package gtPlusPlus.core.item.base.itemblock;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+
+public class ItemBlockBase extends ItemBlock {
+
+ public ItemBlockBase(Block block) {
+ super(block);
+ this.setCreativeTab(AddToCreativeTab.tabBlock);
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack p_82790_1_, int p_82790_2_) {
+
+ return super.getColorFromItemStack(p_82790_1_, p_82790_2_);
+ }
+
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java
new file mode 100644
index 0000000000..04d01c2c97
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java
@@ -0,0 +1,51 @@
+package gtPlusPlus.core.item.base.itemblock;
+
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+
+import java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+
+public class ItemBlockGtBlock extends ItemBlock{
+
+ protected final int blockColour;
+ protected final int sRadiation;
+
+ public ItemBlockGtBlock(Block block) {
+ super(block);
+ this.blockColour = block.getBlockColor();
+ if (block.getLocalizedName().toLowerCase().contains("uranium") || block.getLocalizedName().toLowerCase().contains("plutonium") || block.getLocalizedName().toLowerCase().contains("thorium")){
+ sRadiation = 2;
+ }
+ else {
+ sRadiation = 0;
+ }
+ GT_OreDictUnificator.registerOre("block"+block.getUnlocalizedName().replace("tile.block", "").replace("tile.", "").replace("of", "").replace("Of", "").replace("Block", "").replace("-", "").replace("_", "").replace(" ", ""), UtilsItems.getSimpleStack(this));
+ }
+
+ public int getRenderColor(int aMeta) {
+ return blockColour;
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (sRadiation > 0){
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) {
+ Utils.applyRadiationDamageToEntity(sRadiation, world, entityHolding);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java
new file mode 100644
index 0000000000..c8d791b905
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtFrameBox.java
@@ -0,0 +1,22 @@
+package gtPlusPlus.core.item.base.itemblock;
+
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.util.item.UtilsItems;
+import net.minecraft.block.Block;
+import net.minecraft.item.ItemBlock;
+
+public class ItemBlockGtFrameBox extends ItemBlock{
+
+ protected int blockColour;
+
+ public ItemBlockGtFrameBox(Block block) {
+ super(block);
+ this.blockColour = block.getBlockColor();
+ GT_OreDictUnificator.registerOre("frameGt"+block.getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "").replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""), UtilsItems.getSimpleStack(this));
+ }
+
+ public int getRenderColor(int aMeta) {
+ return blockColour;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java
new file mode 100644
index 0000000000..9d21198033
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/plates/BaseItemPlate.java
@@ -0,0 +1,92 @@
+package gtPlusPlus.core.item.base.plates;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.math.MathUtils;
+
+import java.util.List;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class BaseItemPlate extends Item{
+
+ protected int colour;
+ protected String materialName;
+ protected String unlocalName;
+ private int mTier;
+
+ public BaseItemPlate(String unlocalizedName, String materialName, int colour, int tier, int sRadioactivity) {
+ setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(unlocalizedName);
+ this.unlocalName = unlocalizedName;
+ this.setMaxStackSize(64);
+ this.setTextureName(CORE.MODID + ":" + "itemPlate");
+ this.colour = colour;
+ this.mTier = tier;
+ this.materialName = materialName;
+ this.sRadiation = sRadioactivity;
+ GameRegistry.registerItem(this, unlocalizedName);
+ GT_OreDictUnificator.registerOre(unlocalName.replace("itemP", "p"), UtilsItems.getSimpleStack(this));
+ addBendingRecipe();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return (materialName+ " Plate");
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (materialName != null && materialName != "" && !materialName.equals("")){
+ list.add(EnumChatFormatting.GRAY+"A flat plate of " + materialName + ".");
+ }
+ if (sRadiation > 0){
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public final String getMaterialName() {
+ return materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colour;
+
+ }
+
+ protected final int sRadiation;
+ @Override
+ public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) {
+ Utils.applyRadiationDamageToEntity(sRadiation, world, entityHolding);
+ }
+
+ private void addBendingRecipe(){
+ Utils.LOG_WARNING("Adding recipe for "+materialName+" Plates");
+ String tempIngot = unlocalName.replace("itemPlate", "ingot");
+ ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1);
+ if (null != tempOutputStack){
+ GT_Values.RA.addBenderRecipe(tempOutputStack,
+ UtilsItems.getSimpleStack(this),
+ 14*mTier*20,
+ 64*mTier);
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java b/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java
new file mode 100644
index 0000000000..d5c513c37d
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/rings/BaseItemRing.java
@@ -0,0 +1,82 @@
+package gtPlusPlus.core.item.base.rings;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.math.MathUtils;
+
+import java.util.List;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class BaseItemRing extends Item{
+
+ protected int colour;
+ protected String materialName;
+ protected String unlocalName;
+ private int mTier;
+
+ public BaseItemRing(String unlocalizedName, String materialName, int colour, int tier) {
+ setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(unlocalizedName);
+ this.unlocalName = unlocalizedName;
+ this.setMaxStackSize(64);
+ this.setTextureName(CORE.MODID + ":" + "itemRing");
+ this.colour = colour;
+ this.mTier = tier;
+ this.materialName = materialName;
+ GameRegistry.registerItem(this, unlocalizedName);
+ GT_OreDictUnificator.registerOre(unlocalName.replace("itemR", "r"), UtilsItems.getSimpleStack(this));
+ addExtruderRecipe();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return (materialName+ " Ring");
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (materialName != null && materialName != "" && !materialName.equals("")){
+ list.add(EnumChatFormatting.GRAY+"A " + materialName + " Ring.");
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public final String getMaterialName() {
+ return materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colour;
+
+ }
+
+ private void addExtruderRecipe(){
+ Utils.LOG_WARNING("Adding recipe for "+materialName+" Rings");
+ String tempIngot = unlocalName.replace("itemRing", "ingot");
+ ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1);
+ if (null != tempOutputStack){
+ GT_Values.RA.addExtruderRecipe(tempOutputStack,
+ ItemList.Shape_Extruder_Ring.get(1),
+ UtilsItems.getSimpleStack(this, 4),
+ 12*mTier*20,
+ 24*mTier);
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java
new file mode 100644
index 0000000000..befe7552ec
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRod.java
@@ -0,0 +1,100 @@
+package gtPlusPlus.core.item.base.rods;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+
+import java.util.List;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class BaseItemRod extends Item{
+
+ protected int colour;
+ protected String materialName;
+ protected String unlocalName;
+ private int mTier;
+
+ public BaseItemRod(String unlocalizedName, String materialName, int colour, int tier, int sRadioactivity) {
+ setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(unlocalizedName);
+ this.unlocalName = unlocalizedName;
+ this.setTextureName(CORE.MODID + ":" + "itemRod");
+ this.setMaxStackSize(64);
+ this.colour = colour;
+ this.mTier = tier;
+ this.materialName = materialName;
+ this.sRadiation = sRadioactivity;
+ GameRegistry.registerItem(this, unlocalizedName);
+ GT_OreDictUnificator.registerOre(unlocalName.replace("itemRod", "stick"), UtilsItems.getSimpleStack(this));
+ addExtruderRecipe();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return (materialName+ " Rod");
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (materialName != null && materialName != "" && !materialName.equals("")){
+ list.add(EnumChatFormatting.GRAY+"A 40cm Rod of " + materialName + ".");
+ }
+ if (sRadiation > 0){
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public final String getMaterialName() {
+ return materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colour;
+
+ }
+
+ protected final int sRadiation;
+ @Override
+ public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) {
+ Utils.applyRadiationDamageToEntity(sRadiation, world, entityHolding);
+ }
+
+ private void addExtruderRecipe(){
+ Utils.LOG_WARNING("Adding recipe for "+materialName+" Rods");
+ String tempIngot = unlocalName.replace("itemRod", "ingot");
+ ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1);
+ if (null != tempOutputStack){
+ GT_Values.RA.addExtruderRecipe(tempOutputStack,
+ ItemList.Shape_Extruder_Rod.get(1),
+ UtilsItems.getSimpleStack(this, 2),
+ 12*mTier*20, 24*mTier);
+ }
+ ItemStack rods = UtilsItems.getSimpleStack(this, 1);
+ UtilsRecipe.addShapedGregtechRecipe(
+ rods, rods, rods,
+ rods, "craftingToolWrench", rods,
+ rods, rods, rods,
+ UtilsItems.getItemStackOfAmountFromOreDict(unlocalName.replace("itemRod", "frameGt"), 2));
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java
new file mode 100644
index 0000000000..4e157d22b1
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/rods/BaseItemRodLong.java
@@ -0,0 +1,99 @@
+package gtPlusPlus.core.item.base.rods;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+
+import java.util.List;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class BaseItemRodLong extends Item{
+
+ protected int colour;
+ protected String materialName;
+ protected String unlocalName;
+ private int mTier;
+
+ public BaseItemRodLong(String unlocalizedName, String materialName, int colour, int tier, int sRadioactivity) {
+ setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(unlocalizedName);
+ this.unlocalName = unlocalizedName;
+ this.setTextureName(CORE.MODID + ":" + "itemRodLong");
+ this.setMaxStackSize(64);
+ this.colour = colour;
+ this.mTier = tier;
+ this.materialName = materialName;
+ this.sRadiation = sRadioactivity;
+ GameRegistry.registerItem(this, unlocalizedName);
+ GT_OreDictUnificator.registerOre(unlocalName.replace("itemRod", "stick"), UtilsItems.getSimpleStack(this));
+ addExtruderRecipe();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return ("Long "+materialName+ " Rod");
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (materialName != null && materialName != "" && !materialName.equals("")){
+ list.add(EnumChatFormatting.GRAY+"A 80cm Rod of " + materialName + ".");
+ }
+ if (sRadiation > 0){
+ list.add(CORE.GT_Tooltip_Radioactive);
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public final String getMaterialName() {
+ return materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colour;
+
+ }
+
+ protected final int sRadiation;
+ @Override
+ public void onUpdate(ItemStack iStack, World world, Entity entityHolding, int p_77663_4_, boolean p_77663_5_) {
+ Utils.applyRadiationDamageToEntity(sRadiation, world, entityHolding);
+ }
+
+ private void addExtruderRecipe(){
+ Utils.LOG_WARNING("Adding recipe for Long "+materialName+" Rods");
+ String tempIngot = unlocalName.replace("itemRodLong", "stick");
+ ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 2);
+ if (null != tempOutputStack){
+ GT_Values.RA.addForgeHammerRecipe(tempOutputStack,
+ UtilsItems.getSimpleStack(this, 1),
+ 12*mTier*20, 24*mTier);
+ }
+ ItemStack rods = UtilsItems.getSimpleStack(this, 1);
+ ItemStack tempOutputStack2 = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1);
+ UtilsRecipe.addShapedGregtechRecipe(
+ tempOutputStack2, "craftingToolHardHammer", tempOutputStack2,
+ null, null, null,
+ null, null, null,
+ rods);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java b/src/Java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java
new file mode 100644
index 0000000000..d8ecea32bd
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/rotors/BaseItemRotor.java
@@ -0,0 +1,93 @@
+package gtPlusPlus.core.item.base.rotors;
+
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+
+import java.util.List;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class BaseItemRotor extends Item{
+
+ protected int colour;
+ protected String materialName;
+ protected String unlocalName;
+
+ public BaseItemRotor(String unlocalizedName, String materialName, int colour) {
+ setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(unlocalizedName);
+ this.unlocalName = unlocalizedName;
+ this.setMaxStackSize(64);
+ this.setTextureName(CORE.MODID + ":" + "itemRotor");
+ this.colour = colour;
+ this.materialName = materialName;
+ GameRegistry.registerItem(this, unlocalizedName);
+ GT_OreDictUnificator.registerOre(unlocalName.replace("itemR", "r"), UtilsItems.getSimpleStack(this));
+ generateRecipe();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return (materialName+ " Rotor");
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (materialName != null && materialName != "" && !materialName.equals("")){
+ list.add(EnumChatFormatting.GRAY+"A spindley Rotor made out of " + materialName + ". ");
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public final String getMaterialName() {
+ return materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colour;
+
+ }
+
+ public static boolean getValidItemStack(ItemStack validStack){
+ if (validStack != null){
+ return true;
+ }
+ return false;
+ }
+
+ public void generateRecipe(){
+
+ Utils.LOG_WARNING("Adding recipe for "+materialName+" Rotors");
+ String tempIngot = unlocalName.replace("itemRotor", "plate");
+ ItemStack tempOutputStack = UtilsItems.getItemStackOfAmountFromOreDict(tempIngot, 1);
+ Utils.LOG_WARNING("Found for recipe:"+tempIngot+ "isValidStack()="+getValidItemStack(tempOutputStack));
+ String screw = unlocalName.replace("itemRotor", "screw");
+ ItemStack screwStack = UtilsItems.getItemStackOfAmountFromOreDict(screw, 1);
+ Utils.LOG_WARNING("Found for recipe:"+screw+ "isValidStack()="+getValidItemStack(screwStack));
+ String ring = unlocalName.replace("itemRotor", "ring");
+ ItemStack ringStack = UtilsItems.getItemStackOfAmountFromOreDict(ring, 1);
+ Utils.LOG_WARNING("Found for recipe:"+ring+ "isValidStack()="+getValidItemStack(ringStack));
+
+ UtilsRecipe.addShapedGregtechRecipe(
+ tempOutputStack, "craftingToolHardHammer", tempOutputStack,
+ screwStack, ringStack, "craftingToolFile",
+ tempOutputStack, "craftingToolScrewdriver", tempOutputStack,
+ UtilsItems.getSimpleStack(this));
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java
new file mode 100644
index 0000000000..953c3a99a3
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/base/screws/BaseItemScrew.java
@@ -0,0 +1,85 @@
+package gtPlusPlus.core.item.base.screws;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+
+import java.util.List;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class BaseItemScrew extends Item{
+
+ protected int colour;
+ protected String materialName;
+ protected String unlocalName;
+ private int mTier;
+
+ public BaseItemScrew(String unlocalizedName, String materialName, int colour, int tier) {
+ setUnlocalizedName(unlocalizedName);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName(unlocalizedName);
+ this.unlocalName = unlocalizedName;
+ this.setMaxStackSize(64);
+ this.setTextureName(CORE.MODID + ":" + "itemScrew");
+ this.setMaxStackSize(64);
+ this.colour = colour;
+ this.mTier = tier;
+ this.materialName = materialName;
+ GameRegistry.registerItem(this, unlocalizedName);
+ GT_OreDictUnificator.registerOre(unlocalName.replace("itemS", "s"), UtilsItems.getSimpleStack(this));
+ addLatheRecipe();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return (materialName+ " Screw");
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ if (materialName != null && materialName != "" && !materialName.equals("")){
+ list.add(EnumChatFormatting.GRAY+"A 8mm Screw, fabricated out of some " + materialName + ".");
+ }
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public final String getMaterialName() {
+ return materialName;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colour;
+
+ }
+
+ private void addLatheRecipe(){
+ Utils.LOG_WARNING("Adding recipe for "+materialName+" Screws");
+ ItemStack boltStack = UtilsItems.getItemStackOfAmountFromOreDict(unlocalName.replace("itemScrew", "bolt"), 1);
+ if (null != boltStack){
+ GT_Values.RA.addLatheRecipe(boltStack,
+ UtilsItems.getSimpleStack(this), null,
+ 60*mTier, 16*mTier);
+ UtilsRecipe.addShapedGregtechRecipe(
+ "craftingToolFile", boltStack, null,
+ boltStack, null, null,
+ null, null, null,
+ UtilsItems.getSimpleStack(this));
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/effects/RarityEffect.java b/src/Java/gtPlusPlus/core/item/effects/RarityEffect.java
new file mode 100644
index 0000000000..cd5149b622
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/effects/RarityEffect.java
@@ -0,0 +1,41 @@
+package gtPlusPlus.core.item.effects;
+
+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;
+
+/*
+ *
+This determines the name colour. EnumRarity can be:
+EnumRarity.common - the standard white colour.
+EnumRarity.uncommon - a yellow colour.
+EnumRarity.rare - a light blue colour. This is used for enchanted items.
+EnumRarity.epic - the purple colour used on the Golden Apple.
+@SideOnly is an FML annotation. It marks the method below it for existing only on one side. Possible values are:
+Side.CLIENT is probably the most common one. This marks the method as existing only on the client side.
+Side.SERVER marks the method as existing only on the server side.
+ *
+ */
+
+public class RarityEffect extends Item {
+
+ public RarityEffect(int par1){
+ super();
+ this.setCreativeTab(CreativeTabs.tabMaterials);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack par1ItemStack){
+ return EnumRarity.common;
+ }
+
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack){
+ return true;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/effects/RarityEpic.java b/src/Java/gtPlusPlus/core/item/effects/RarityEpic.java
new file mode 100644
index 0000000000..35c5527d16
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/effects/RarityEpic.java
@@ -0,0 +1,28 @@
+package gtPlusPlus.core.item.effects;
+
+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;
+
+public class RarityEpic extends Item {
+
+ public RarityEpic(int par1){
+ super();
+ this.setCreativeTab(CreativeTabs.tabMaterials);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack par1ItemStack){
+ return EnumRarity.epic;
+ }
+
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack){
+ return true;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/effects/RarityRare.java b/src/Java/gtPlusPlus/core/item/effects/RarityRare.java
new file mode 100644
index 0000000000..c64accb7aa
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/effects/RarityRare.java
@@ -0,0 +1,28 @@
+package gtPlusPlus.core.item.effects;
+
+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;
+
+public class RarityRare extends Item {
+
+ public RarityRare(int par1){
+ super();
+ this.setCreativeTab(CreativeTabs.tabMaterials);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack par1ItemStack){
+ return EnumRarity.rare;
+ }
+
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack){
+ return true;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/effects/RarityUncommon.java b/src/Java/gtPlusPlus/core/item/effects/RarityUncommon.java
new file mode 100644
index 0000000000..398217a24a
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/effects/RarityUncommon.java
@@ -0,0 +1,22 @@
+package gtPlusPlus.core.item.effects;
+
+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;
+
+public class RarityUncommon extends Item {
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack par1ItemStack){
+ return EnumRarity.uncommon;
+ }
+
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack){
+ return true;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/general/BedLocator_Base.java b/src/Java/gtPlusPlus/core/item/general/BedLocator_Base.java
new file mode 100644
index 0000000000..5a05ac7655
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/general/BedLocator_Base.java
@@ -0,0 +1,107 @@
+package gtPlusPlus.core.item.general;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+
+import java.util.List;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+
+public class BedLocator_Base extends Item{
+
+ public int bed_X = 0;
+ public int bed_Y = 0;
+ public int bed_Z = 0;
+
+ public BedLocator_Base(String unlocalizedName) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+
+
+ int NBT_X = bed_X;
+ int NBT_Y = bed_Y;
+ int NBT_Z = bed_Z;
+
+
+ if (stack.stackTagCompound != null) {
+ NBT_X = stack.stackTagCompound.getInteger("pos_x");
+ NBT_Y = stack.stackTagCompound.getInteger("pos_y");
+ NBT_Z = stack.stackTagCompound.getInteger("pos_z");
+
+ String tempX = String.valueOf(NBT_X);
+ String tempY = String.valueOf(NBT_Y);
+ String tempZ = String.valueOf(NBT_Z);
+ String formattedX = EnumChatFormatting.DARK_RED+tempX+EnumChatFormatting.GRAY;
+ String formattedY = EnumChatFormatting.RED+tempY+EnumChatFormatting.GRAY;
+ String formattedZ = EnumChatFormatting.RED+tempZ+EnumChatFormatting.GRAY;
+
+ list.add(EnumChatFormatting.GRAY+"X: "+formattedX+".");
+ list.add(EnumChatFormatting.GRAY+"Y: "+formattedY+".");
+ list.add(EnumChatFormatting.GRAY+"Z: "+formattedZ+".");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+ }
+
+ //Ticking and NBT Handling
+ /* Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
+ * update it's contents.
+ *
+ * public int fuelRemaining = 0;
+ public int maximumFuel = 0;
+ public String fuelType = "";
+ public float heat = 0;
+ public float maxHeat = 5000;
+ *
+ */
+ @Override
+ public void onCreated(ItemStack itemStack, World world, EntityPlayer player) {
+ itemStack.stackTagCompound = new NBTTagCompound();
+ this.bed_X = 0;
+ this.bed_Y = 0;
+ this.bed_Z = 0;
+ itemStack.stackTagCompound.setInteger("pos_x", bed_X);
+ itemStack.stackTagCompound.setInteger("pos_y", bed_Y);
+ itemStack.stackTagCompound.setInteger("pos_z", bed_Z);
+ }
+
+ @Override
+ public void onUpdate(ItemStack itemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
+
+
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer par3Entity) {
+ itemStack.stackTagCompound = new NBTTagCompound();
+ if (par3Entity.getBedLocation() != null){
+ this.bed_X = par3Entity.getBedLocation().posX;
+ this.bed_Y = par3Entity.getBedLocation().posY;
+ this.bed_Z = par3Entity.getBedLocation().posZ;
+ }
+ else {
+ this.bed_X = 0;
+ this.bed_Y = 0;
+ this.bed_Z = 0;
+ }
+ itemStack.stackTagCompound.setInteger("pos_x", bed_X);
+ itemStack.stackTagCompound.setInteger("pos_y", bed_Y);
+ itemStack.stackTagCompound.setInteger("pos_z", bed_Z);
+ return super.onItemRightClick(itemStack, world, par3Entity);
+ }
+
+
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/general/BufferCore.java b/src/Java/gtPlusPlus/core/item/general/BufferCore.java
new file mode 100644
index 0000000000..6343ede855
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/general/BufferCore.java
@@ -0,0 +1,93 @@
+package gtPlusPlus.core.item.general;
+
+import gtPlusPlus.core.item.base.BaseItemWithDamageValue;
+import gtPlusPlus.core.lib.CORE;
+
+import java.util.List;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class BufferCore extends BaseItemWithDamageValue{
+
+ public int coreTier = 0;
+
+ public BufferCore(String unlocalizedName, int i) {
+ super(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setMaxStackSize(2);
+ this.coreTier = i;
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack stack) {
+ return super.getItemStackDisplayName(stack)+" ["+CORE.VOLTAGES[this.coreTier-1]+"].";
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public boolean requiresMultipleRenderPasses()
+ {
+ return true;
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add(EnumChatFormatting.GRAY+"A key crafting component for making energy buffers.");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public final int getCoreTier() {
+ return coreTier;
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ //Figure Out Damage
+ String s = String.format("%X", HEX_OxFFFFFF);
+ //Utils.LOG_INFO(s);
+ //String rgb = Utils.hex2Rgb(s);
+ //Utils.LOG_INFO(rgb);
+ if (coreTier == 1){
+ HEX_OxFFFFFF = 0x4d4d4d;
+ }
+ else if (coreTier == 2){
+ HEX_OxFFFFFF = 0x666666;
+ }
+ else if (coreTier == 3){
+ HEX_OxFFFFFF = 0x8c8c8c;
+ }
+ else if (coreTier == 4){
+ HEX_OxFFFFFF = 0xa6a6a6;
+ }
+ else if (coreTier == 5){
+ HEX_OxFFFFFF = 0xcccccc;
+ }
+ else if (coreTier == 6){
+ HEX_OxFFFFFF = 0xe6e6e6;
+ }
+ else if (coreTier == 7){
+ HEX_OxFFFFFF = 0xffffcc;
+ }
+ else if (coreTier == 8){
+ HEX_OxFFFFFF = 0xace600;
+ }
+ else if (coreTier == 9){
+ HEX_OxFFFFFF = 0xffff00;
+ }
+ else if (coreTier == 10){
+ HEX_OxFFFFFF = 0xff0000;
+ }
+ else {
+ HEX_OxFFFFFF = 0xffffff;
+ }
+
+
+ return HEX_OxFFFFFF;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemCloakingDevice.java b/src/Java/gtPlusPlus/core/item/general/ItemCloakingDevice.java
new file mode 100644
index 0000000000..22b6ed27f1
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/general/ItemCloakingDevice.java
@@ -0,0 +1,256 @@
+package gtPlusPlus.core.item.general;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.math.MathUtils;
+import ic2.api.item.ElectricItem;
+import ic2.api.item.IElectricItem;
+import ic2.api.item.IElectricItemManager;
+
+import java.util.List;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.potion.Potion;
+import net.minecraft.potion.PotionEffect;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import baubles.api.BaubleType;
+import baubles.api.IBauble;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class ItemCloakingDevice extends Item implements IElectricItem, IElectricItemManager, IBauble{
+
+ private final String unlocalizedName = "personalCloakingDevice";
+ private final ItemStack thisStack;
+ private final static int maxValueEU = 10000*20*500;
+ protected double chargeEU = 0;
+
+ public ItemCloakingDevice(double charge){
+ this.chargeEU = charge;
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ this.setUnlocalizedName(unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setTextureName(CORE.MODID + ":" + "personalCloakingDevice");
+ this.thisStack = UtilsItems.getSimpleStack(this);
+ this.charge(thisStack, charge, 3, true, false);
+ if (charge == 10000*20*500){
+ this.setDamage(thisStack, 13);
+ }
+ GameRegistry.registerItem(this, unlocalizedName+"-"+charge);
+ }
+
+ @Override
+ public void onUpdate(ItemStack itemStack, World worldObj, Entity player, int p_77663_4_, boolean p_77663_5_) {
+ if (worldObj.isRemote) {
+ return;
+ }
+
+ if (player instanceof EntityPlayer){
+ for (ItemStack is : ((EntityPlayer) player).inventory.mainInventory) {
+ if (is == itemStack) {
+ continue;
+ }
+ if (is != null) {
+ if (is.getItem() instanceof IElectricItem) {
+ IElectricItem electricItem = (IElectricItem) is.getItem();
+ chargeEU = ElectricItem.manager.getCharge(is);
+ }
+
+ }
+ }
+ }
+
+
+ super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public boolean canProvideEnergy(ItemStack itemStack) {
+ return true;
+ }
+
+ @Override
+ public Item getChargedItem(ItemStack itemStack) {
+ ItemStack x = itemStack.copy();
+ x.setItemDamage(maxValueEU);
+ return x.getItem();
+ }
+
+ @Override
+ public Item getEmptyItem(ItemStack itemStack) {
+ ItemStack x = itemStack.copy();
+ x.setItemDamage(0);
+ return x.getItem();
+ }
+
+ @Override
+ public double getMaxCharge(ItemStack itemStack) {
+ return maxValueEU;
+ }
+
+ @Override
+ public int getTier(ItemStack itemStack) {
+ return 5;
+ }
+
+ @Override
+ public double getTransferLimit(ItemStack itemStack) {
+ return 8196;
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return (EnumChatFormatting.BLUE+"Personal Cloaking Device"+EnumChatFormatting.GRAY);
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack)
+ {
+ //return 1.0D - getEnergyStored(stack) / this.capacity;
+ return 1.0D - (double)getCharge(stack) / (double)getMaxCharge(stack);
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack)
+ {
+ return true;
+ }
+
+ public int secondsLeft(ItemStack stack){
+ double r = 0;
+ r = getCharge(stack)/(10000*20);
+ return (int) MathUtils.decimalRounding(r);
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add("");
+ list.add(EnumChatFormatting.GREEN+"Worn as a Belt within Baubles."+EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GREEN+"Drains 10,000EU/t to provide invisibility."+EnumChatFormatting.GRAY);
+ list.add("");
+ list.add(EnumChatFormatting.GOLD+"IC2/EU Information"+EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GRAY+"Tier: ["+EnumChatFormatting.YELLOW+getTier(thisStack)+EnumChatFormatting.GRAY+"] Input Limit: ["+EnumChatFormatting.YELLOW+getTransferLimit(thisStack)+EnumChatFormatting.GRAY +"EU/t]");
+ list.add(EnumChatFormatting.GRAY+"Current Power: ["+EnumChatFormatting.YELLOW+(long) getCharge(stack)+EnumChatFormatting.GRAY+"EU] ["+EnumChatFormatting.YELLOW+MathUtils.findPercentage(getCharge(stack), getMaxCharge(stack))+EnumChatFormatting.GRAY +"%]");
+ list.add(EnumChatFormatting.GRAY+"Time Remaining: ["+EnumChatFormatting.YELLOW+secondsLeft(stack)+ EnumChatFormatting.GRAY +" seconds]");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ /*@Override
+ public ItemStack getContainerItem(ItemStack itemStack)
+ {
+ ItemStack newItem = itemStack.copy();
+ newItem.stackSize = 1;
+ extractEnergy(newItem, 150000, false);
+ return newItem;
+ }*/
+
+ /*@Override
+ public boolean hasContainerItem(ItemStack stack)
+ {
+ return true;
+ }*/
+
+ /*@Override
+ public int getBurnTime(ItemStack fuel) {
+ if ((fuel == null) || (fuel.getItem() != this)) {
+ return 0;
+ }
+ return extractEnergy(fuel, 150000, true) / 50 / 100;
+ }*/
+
+ @Override
+ public double charge(ItemStack stack, double amount, int tier,
+ boolean ignoreTransferLimit, boolean simulate) {
+
+ if (!simulate)
+ {
+ ElectricItem.manager.charge(stack, amount, tier, true, simulate);
+
+ }
+ return ElectricItem.manager.charge(stack, amount, tier, true, simulate);
+ }
+
+ @Override
+ public double discharge(ItemStack stack, double amount, int tier,
+ boolean ignoreTransferLimit, boolean externally, boolean simulate) {
+ if (!simulate)
+ {
+ ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
+ }
+
+ return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
+ }
+
+ @Override
+ public double getCharge(ItemStack stack) {
+ return ElectricItem.manager.getCharge(stack);
+ }
+
+ @Override
+ public boolean canUse(ItemStack stack, double amount) {
+ return ElectricItem.manager.canUse(stack, amount);
+ }
+
+ @Override
+ public boolean use(ItemStack stack, double amount, EntityLivingBase entity) {
+ return ElectricItem.manager.use(stack, amount, entity);
+ }
+
+ @Override
+ public void chargeFromArmor(ItemStack stack, EntityLivingBase entity) {
+ ElectricItem.manager.chargeFromArmor(stack, entity);
+ }
+
+ @Override
+ public String getToolTip(ItemStack stack) {
+ return ElectricItem.manager.getToolTip(stack);
+ }
+
+ @Override
+ public boolean canEquip(ItemStack arg0, EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override
+ public boolean canUnequip(ItemStack arg0, EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override
+ public BaubleType getBaubleType(ItemStack arg0) {
+ return BaubleType.BELT;
+ }
+
+ @Override //TODO
+ public void onEquipped(ItemStack arg0, EntityLivingBase arg1) {
+
+ }
+
+ @Override //TODO
+ public void onUnequipped(ItemStack arg0, EntityLivingBase arg1) {
+
+ }
+
+ @Override //TODO
+ public void onWornTick(ItemStack arg0, EntityLivingBase arg1) {
+ //Utils.LOG_INFO("Trying to Tick Belt. 1");
+ if (!arg1.worldObj.isRemote){
+ if (getCharge(arg0) >= 10000){
+ arg1.addPotionEffect(new PotionEffect(Potion.invisibility.id, 10, 2));
+ discharge(arg0, 10000, 5, true, true, false);
+ }
+ else {
+ if (arg1.isPotionActive((Potion.invisibility))){
+ arg1.removePotionEffect(Potion.invisibility.id);
+ }
+ }
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java
new file mode 100644
index 0000000000..728d498e2b
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/general/ItemHealingDevice.java
@@ -0,0 +1,228 @@
+package gtPlusPlus.core.item.general;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.math.MathUtils;
+import ic2.api.item.ElectricItem;
+import ic2.api.item.IElectricItem;
+import ic2.api.item.IElectricItemManager;
+
+import java.util.List;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import baubles.api.BaubleType;
+import baubles.api.IBauble;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class ItemHealingDevice extends Item implements IElectricItem, IElectricItemManager, IBauble{
+
+ private final String unlocalizedName = "personalHealingDevice";
+ private final ItemStack thisStack;
+ private final static int maxValueEU = 1000000000;
+ protected double chargeEU = 0;
+
+ public ItemHealingDevice(){
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ this.setUnlocalizedName(unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setTextureName(CORE.MODID + ":" + "personalCloakingDevice");
+ this.thisStack = UtilsItems.getSimpleStack(this);
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
+
+ @Override
+ public void onUpdate(ItemStack itemStack, World worldObj, Entity player, int p_77663_4_, boolean p_77663_5_) {
+ if (worldObj.isRemote) {
+ return;
+ }
+
+ if (player instanceof EntityPlayer){
+ for (ItemStack is : ((EntityPlayer) player).inventory.mainInventory) {
+ if (is == itemStack) {
+ continue;
+ }
+ if (is != null) {
+ if (is.getItem() instanceof IElectricItem) {
+ IElectricItem electricItem = (IElectricItem) is.getItem();
+ chargeEU = ElectricItem.manager.getCharge(is);
+ }
+
+ }
+ }
+ }
+
+
+ super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public boolean canProvideEnergy(ItemStack itemStack) {
+ return true;
+ }
+
+ @Override
+ public Item getChargedItem(ItemStack itemStack) {
+ ItemStack x = itemStack.copy();
+ x.setItemDamage(maxValueEU);
+ return x.getItem();
+ }
+
+ @Override
+ public Item getEmptyItem(ItemStack itemStack) {
+ ItemStack x = itemStack.copy();
+ x.setItemDamage(0);
+ return x.getItem();
+ }
+
+ @Override
+ public double getMaxCharge(ItemStack itemStack) {
+ return maxValueEU;
+ }
+
+ @Override
+ public int getTier(ItemStack itemStack) {
+ return 5;
+ }
+
+ @Override
+ public double getTransferLimit(ItemStack itemStack) {
+ return 32784;
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return (EnumChatFormatting.BLUE+"Personal Healing NanoBooster"+EnumChatFormatting.RESET);
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack)
+ {
+ //return 1.0D - getEnergyStored(stack) / this.capacity;
+ return 1.0D - (double)getCharge(stack) / (double)getMaxCharge(stack);
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack)
+ {
+ return true;
+ }
+
+ public double secondsLeft(ItemStack stack){
+
+ double r = 0;
+ r = getCharge(stack)/(1638400/4);
+ return (int) r;
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add("");
+ list.add(EnumChatFormatting.GREEN+"Worn as a Necklace within Baubles."+EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GREEN+"Drains 1638400eu to restore hunger."+EnumChatFormatting.GRAY);
+ list.add("");
+ list.add(EnumChatFormatting.GOLD+"IC2/EU Information"+EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GRAY+"Tier: ["+EnumChatFormatting.YELLOW+getTier(thisStack)+EnumChatFormatting.GRAY+"] Transfer Limit: ["+EnumChatFormatting.YELLOW+getTransferLimit(thisStack)+EnumChatFormatting.GRAY +"Eu/t]");
+ list.add(EnumChatFormatting.GRAY+"Current Power: ["+EnumChatFormatting.YELLOW+(long) getCharge(stack)+EnumChatFormatting.GRAY+"Eu] ["+EnumChatFormatting.YELLOW+MathUtils.findPercentage(getCharge(stack), getMaxCharge(stack))+EnumChatFormatting.GRAY +"%]");
+ list.add(EnumChatFormatting.GRAY+"Uses Remaining: ["+EnumChatFormatting.YELLOW+secondsLeft(stack)+ EnumChatFormatting.GRAY +"]");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public double charge(ItemStack stack, double amount, int tier,
+ boolean ignoreTransferLimit, boolean simulate) {
+
+ if (!simulate)
+ {
+ ElectricItem.manager.charge(stack, amount, tier, true, simulate);
+
+ }
+ return ElectricItem.manager.charge(stack, amount, tier, true, simulate);
+ }
+
+ @Override
+ public double discharge(ItemStack stack, double amount, int tier,
+ boolean ignoreTransferLimit, boolean externally, boolean simulate) {
+ if (!simulate)
+ {
+ ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
+ }
+
+ return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
+ }
+
+ @Override
+ public double getCharge(ItemStack stack) {
+ return ElectricItem.manager.getCharge(stack);
+ }
+
+ @Override
+ public boolean canUse(ItemStack stack, double amount) {
+ return ElectricItem.manager.canUse(stack, amount);
+ }
+
+ @Override
+ public boolean use(ItemStack stack, double amount, EntityLivingBase entity) {
+ return ElectricItem.manager.use(stack, amount, entity);
+ }
+
+ @Override
+ public void chargeFromArmor(ItemStack stack, EntityLivingBase entity) {
+ ElectricItem.manager.chargeFromArmor(stack, entity);
+ }
+
+ @Override
+ public String getToolTip(ItemStack stack) {
+ return ElectricItem.manager.getToolTip(stack);
+ }
+
+ @Override
+ public boolean canEquip(ItemStack arg0, EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override
+ public boolean canUnequip(ItemStack arg0, EntityLivingBase arg1) {
+ return true;
+ }
+
+ @Override
+ public BaubleType getBaubleType(ItemStack arg0) {
+ return BaubleType.AMULET;
+ }
+
+ @Override //TODO
+ public void onEquipped(ItemStack arg0, EntityLivingBase arg1) {
+
+ }
+
+ @Override //TODO
+ public void onUnequipped(ItemStack arg0, EntityLivingBase arg1) {
+
+ }
+
+ @Override //TODO
+ public void onWornTick(ItemStack arg0, EntityLivingBase arg1) {
+ if (!arg1.worldObj.isRemote){
+ if (getCharge(arg0) >= 1638400/4){
+ if (arg1.getHealth() < arg1.getMaxHealth()){
+ float rx = arg1.getMaxHealth()-arg1.getHealth();
+ Utils.LOG_INFO("rx:"+rx);
+ arg1.heal(rx*2);
+ discharge(arg0, (1638400/4)*rx, 6, true, true, false);
+ Utils.messagePlayer((EntityPlayer) arg1, "Your NanoBooster Whirs! Leaving you feeling stronger. It Healed "+rx+" hp.");
+ Utils.messagePlayer((EntityPlayer) arg1, "You check it's remaining uses, it has "+secondsLeft(arg0)+".");
+ }
+ }
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/general/NuclearFuelRodBase.java b/src/Java/gtPlusPlus/core/item/general/NuclearFuelRodBase.java
new file mode 100644
index 0000000000..f452b83a73
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/general/NuclearFuelRodBase.java
@@ -0,0 +1,210 @@
+package gtPlusPlus.core.item.general;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.MovingObjectPosition;
+import net.minecraft.world.World;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.entity.player.FillBucketEvent;
+import cpw.mods.fml.common.eventhandler.Event;
+
+public class NuclearFuelRodBase extends Item
+{
+ /** field for checking if the bucket has been filled. */
+ private Block isFull;
+ public NuclearFuelRodBase(Block p_i45331_1_)
+ {
+ this.maxStackSize = 1;
+ this.isFull = p_i45331_1_;
+ this.setCreativeTab(CreativeTabs.tabMisc);
+ }
+
+ /**
+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
+ */
+ @Override
+ public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_)
+ {
+ boolean flag = this.isFull == Blocks.air;
+ MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(p_77659_2_, p_77659_3_, flag);
+
+ if (movingobjectposition == null)
+ {
+ return p_77659_1_;
+ }
+ FillBucketEvent event = new FillBucketEvent(p_77659_3_, p_77659_1_, p_77659_2_, movingobjectposition);
+ if (MinecraftForge.EVENT_BUS.post(event))
+ {
+ return p_77659_1_;
+ }
+
+ if (event.getResult() == Event.Result.ALLOW)
+ {
+ if (p_77659_3_.capabilities.isCreativeMode)
+ {
+ return p_77659_1_;
+ }
+
+ if (--p_77659_1_.stackSize <= 0)
+ {
+ return event.result;
+ }
+
+ if (!p_77659_3_.inventory.addItemStackToInventory(event.result))
+ {
+ p_77659_3_.dropPlayerItemWithRandomChoice(event.result, false);
+ }
+
+ return p_77659_1_;
+ }
+ if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK)
+ {
+ int i = movingobjectposition.blockX;
+ int j = movingobjectposition.blockY;
+ int k = movingobjectposition.blockZ;
+
+ if (!p_77659_2_.canMineBlock(p_77659_3_, i, j, k))
+ {
+ return p_77659_1_;
+ }
+
+ if (flag)
+ {
+ if (!p_77659_3_.canPlayerEdit(i, j, k, movingobjectposition.sideHit, p_77659_1_))
+ {
+ return p_77659_1_;
+ }
+
+ Material material = p_77659_2_.getBlock(i, j, k).getMaterial();
+ int l = p_77659_2_.getBlockMetadata(i, j, k);
+
+ if (material == Material.water && l == 0)
+ {
+ p_77659_2_.setBlockToAir(i, j, k);
+ return this.func_150910_a(p_77659_1_, p_77659_3_, Items.water_bucket);
+ }
+
+ if (material == Material.lava && l == 0)
+ {
+ p_77659_2_.setBlockToAir(i, j, k);
+ return this.func_150910_a(p_77659_1_, p_77659_3_, Items.lava_bucket);
+ }
+ }
+ else
+ {
+ if (this.isFull == Blocks.air)
+ {
+ return new ItemStack(Items.bucket);
+ }
+
+ if (movingobjectposition.sideHit == 0)
+ {
+ --j;
+ }
+
+ if (movingobjectposition.sideHit == 1)
+ {
+ ++j;
+ }
+
+ if (movingobjectposition.sideHit == 2)
+ {
+ --k;
+ }
+
+ if (movingobjectposition.sideHit == 3)
+ {
+ ++k;
+ }
+
+ if (movingobjectposition.sideHit == 4)
+ {
+ --i;
+ }
+
+ if (movingobjectposition.sideHit == 5)
+ {
+ ++i;
+ }
+
+ if (!p_77659_3_.canPlayerEdit(i, j, k, movingobjectposition.sideHit, p_77659_1_))
+ {
+ return p_77659_1_;
+ }
+
+ if (this.tryPlaceContainedLiquid(p_77659_2_, i, j, k) && !p_77659_3_.capabilities.isCreativeMode)
+ {
+ return new ItemStack(Items.bucket);
+ }
+ }
+ }
+
+ return p_77659_1_;
+ }
+
+ @SuppressWarnings("static-method")
+ private ItemStack func_150910_a(ItemStack p_150910_1_, EntityPlayer p_150910_2_, Item p_150910_3_)
+ {
+ if (p_150910_2_.capabilities.isCreativeMode)
+ {
+ return p_150910_1_;
+ }
+ else if (--p_150910_1_.stackSize <= 0)
+ {
+ return new ItemStack(p_150910_3_);
+ }
+ else
+ {
+ if (!p_150910_2_.inventory.addItemStackToInventory(new ItemStack(p_150910_3_)))
+ {
+ p_150910_2_.dropPlayerItemWithRandomChoice(new ItemStack(p_150910_3_, 1, 0), false);
+ }
+
+ return p_150910_1_;
+ }
+ }
+
+ /**
+ * Attempts to place the liquid contained inside the bucket.
+ */
+ public boolean tryPlaceContainedLiquid(World p_77875_1_, int p_77875_2_, int p_77875_3_, int p_77875_4_)
+ {
+ if (this.isFull == Blocks.air)
+ {
+ return false;
+ }
+ Material material = p_77875_1_.getBlock(p_77875_2_, p_77875_3_, p_77875_4_).getMaterial();
+ boolean flag = !material.isSolid();
+
+ if (!p_77875_1_.isAirBlock(p_77875_2_, p_77875_3_, p_77875_4_) && !flag)
+ {
+ return false;
+ }
+ if (p_77875_1_.provider.isHellWorld && this.isFull == Blocks.flowing_water)
+ {
+ p_77875_1_.playSoundEffect((double)((float)p_77875_2_ + 0.5F), (double)((float)p_77875_3_ + 0.5F), (double)((float)p_77875_4_ + 0.5F), "random.fizz", 0.5F, 2.6F + (p_77875_1_.rand.nextFloat() - p_77875_1_.rand.nextFloat()) * 0.8F);
+
+ for (int l = 0; l < 8; ++l)
+ {
+ p_77875_1_.spawnParticle("largesmoke", (double)p_77875_2_ + Math.random(), (double)p_77875_3_ + Math.random(), (double)p_77875_4_ + Math.random(), 0.0D, 0.0D, 0.0D);
+ }
+ }
+ else
+ {
+ if (!p_77875_1_.isRemote && flag && !material.isLiquid())
+ {
+ p_77875_1_.func_147480_a(p_77875_2_, p_77875_3_, p_77875_4_, true);
+ }
+
+ p_77875_1_.setBlock(p_77875_2_, p_77875_3_, p_77875_4_, this.isFull, 0, 3);
+ }
+
+ return true;
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java b/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java
new file mode 100644
index 0000000000..f1141e1ef4
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/general/RF2EU_Battery.java
@@ -0,0 +1,314 @@
+package gtPlusPlus.core.item.general;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.math.MathUtils;
+import ic2.api.item.ElectricItem;
+import ic2.api.item.IElectricItem;
+import ic2.api.item.IElectricItemManager;
+
+import java.util.List;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.World;
+import cofh.api.energy.ItemEnergyContainer;
+import cpw.mods.fml.common.IFuelHandler;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class RF2EU_Battery extends ItemEnergyContainer implements IElectricItem, IElectricItemManager, IFuelHandler{
+
+ public static int rfPerEU = 4;
+ private final String unlocalizedName = "rfEUBattery";
+ private final ItemStack thisStack;
+ private final static int maxValueEU = 100000000;
+ private final static int maxValueRF = maxValueEU * rfPerEU;
+ protected double chargeEU = 0;
+
+ public RF2EU_Battery(){
+ super(maxValueRF, maxValueRF, maxValueRF);
+ GameRegistry.registerFuelHandler(this);
+ //this.setMaxDamage(Integer.MAX_VALUE);
+ //this.setDamage(UtilsItems.getSimpleStack(this), 0);
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ this.setUnlocalizedName(unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setTextureName(CORE.MODID + ":" + "itemIngot");
+ this.thisStack = UtilsItems.getSimpleStack(this);
+ GameRegistry.registerItem(this, unlocalizedName);
+ }
+
+ @Override
+ public void onUpdate(ItemStack itemStack, World worldObj, Entity player, int p_77663_4_, boolean p_77663_5_) {
+ getEnergyStored(itemStack);
+ if (worldObj.isRemote) {
+ return;
+ }
+
+ if (player instanceof EntityPlayer){
+ for (ItemStack is : ((EntityPlayer) player).inventory.mainInventory) {
+ if (is == itemStack) {
+ continue;
+ }
+ if (is != null) {
+ if (is.getItem() instanceof IElectricItem) {
+ IElectricItem electricItem = (IElectricItem) is.getItem();
+ chargeEU = ElectricItem.manager.getCharge(is);
+ }
+
+ }
+ }
+ }
+
+
+ super.onUpdate(itemStack, worldObj, player, p_77663_4_, p_77663_5_);
+ }
+
+ @Override
+ public boolean canProvideEnergy(ItemStack itemStack) {
+ return true;
+ }
+
+ @Override
+ public Item getChargedItem(ItemStack itemStack) {
+ ItemStack x = itemStack.copy();
+ x.setItemDamage(maxValueEU);
+ return x.getItem();
+ }
+
+ @Override
+ public Item getEmptyItem(ItemStack itemStack) {
+ ItemStack x = itemStack.copy();
+ x.setItemDamage(0);
+ return x.getItem();
+ }
+
+ @Override
+ public double getMaxCharge(ItemStack itemStack) {
+ return maxValueEU;
+ }
+
+ @Override
+ public int getTier(ItemStack itemStack) {
+ return 3;
+ }
+
+ @Override
+ public double getTransferLimit(ItemStack itemStack) {
+ return 8196;
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack p_77653_1_) {
+
+ return ("Universally Chargeable Battery");
+ }
+
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack)
+ {
+ //return 1.0D - getEnergyStored(stack) / this.capacity;
+ return MathUtils.findPercentage(getEnergyStored(stack), getMaxEnergyStored(stack));
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
+ {
+ int i = 30;
+
+ float f13 = (float)(Minecraft.getSystemTime() % 6000L) / 3000.0F * 3.141592F * 2.0F;
+
+ float t = 0.9F + 0.1F * MathHelper.cos(f13);
+
+ double v = 1.0D - getDurabilityForDisplay(par1ItemStack);
+
+ int r = i + (int)(v * (255 - i) * t);
+ if (r > 255) {
+ r = 255;
+ }
+ int g = i + (int)(v * (64 - i) * t);
+
+ return r << 16 | g << 8 | i;
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack)
+ {
+ return false;
+ }
+
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add(EnumChatFormatting.YELLOW+"IC2/EU Information"+EnumChatFormatting.GRAY);
+ list.add(EnumChatFormatting.GRAY+"Tier: ["+EnumChatFormatting.YELLOW+getTier(thisStack)+EnumChatFormatting.GRAY+"] Current Power: ["+EnumChatFormatting.YELLOW+(long) getCharge(stack)+EnumChatFormatting.GRAY+"/EU]");
+ list.add(EnumChatFormatting.GRAY+"Transfer Limit: ["+EnumChatFormatting.YELLOW+getTransferLimit(thisStack)+ EnumChatFormatting.GRAY +"Eu/t]" +"Burn Time: ["+EnumChatFormatting.YELLOW+getBurnTime(stack)/20+EnumChatFormatting.GRAY+"s]");
+ list.add("");
+ list.add(EnumChatFormatting.RED+"RF Information");
+ list.add(EnumChatFormatting.GRAY+"Extraction Rate: [" +EnumChatFormatting.RED+ this.maxExtract + EnumChatFormatting.GRAY + "Rf/t]" + " Insert Rate: [" +EnumChatFormatting.RED+ this.maxReceive+EnumChatFormatting.GRAY+"Rf/t]");
+ list.add(EnumChatFormatting.GRAY+"Current Charge: ["+EnumChatFormatting.RED+getEnergyStored(stack) + EnumChatFormatting.GRAY + "Rf / " + getMaxEnergyStored(stack)+"Rf] "+EnumChatFormatting.RED+MathUtils.findPercentage(getEnergyStored(stack), getMaxEnergyStored(stack))+EnumChatFormatting.GRAY+"%");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public ItemStack getContainerItem(ItemStack itemStack)
+ {
+ ItemStack newItem = itemStack.copy();
+ newItem.stackSize = 1;
+ extractEnergy(newItem, 150000, false);
+ return newItem;
+ }
+
+ @Override
+ public boolean hasContainerItem(ItemStack stack)
+ {
+ return true;
+ }
+
+ @Override
+ public int getBurnTime(ItemStack fuel) {
+ if ((fuel == null) || (fuel.getItem() != this)) {
+ return 0;
+ }
+ return extractEnergy(fuel, 150000, true) / 50 / 100;
+ }
+
+ @Override
+ public double charge(ItemStack stack, double amount, int tier,
+ boolean ignoreTransferLimit, boolean simulate) {
+ if (stack.stackTagCompound == null) {
+ stack.stackTagCompound = new NBTTagCompound();
+ }
+ int energy = stack.stackTagCompound.getInteger("Energy");
+ int energyReceived = Math.min(this.capacity - energy, Math.min(this.maxReceive, maxReceive));
+ if (!simulate)
+ {
+ energy += energyReceived;
+ stack.stackTagCompound.setInteger("Energy", energy);
+ ElectricItem.manager.discharge(stack, ElectricItem.manager.getCharge(stack), 3, true, true, false);
+ ElectricItem.manager.charge(stack, energy/rfPerEU, 3, true, false);
+
+ }
+ return ElectricItem.manager.charge(stack, amount, tier, ignoreTransferLimit, simulate);
+ }
+
+ @Override
+ public double discharge(ItemStack stack, double amount, int tier,
+ boolean ignoreTransferLimit, boolean externally, boolean simulate) {
+ if ((stack.stackTagCompound == null) || (!stack.stackTagCompound.hasKey("Energy"))) {
+ double euCharge = getCharge(UtilsItems.getSimpleStack(this));
+ if (euCharge != 0 && euCharge >= 1){
+ return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU));
+ }
+ return 0;
+ }
+ int energy = stack.stackTagCompound.getInteger("Energy");
+ int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
+ if (!simulate)
+ {
+ energy -= energyExtracted;
+ stack.stackTagCompound.setInteger("Energy", energy);
+ ElectricItem.manager.discharge(stack, ElectricItem.manager.getCharge(stack), 3, true, true, false);
+ ElectricItem.manager.charge(stack, energy/rfPerEU, 3, true, false);
+ }
+
+ return ElectricItem.manager.discharge(stack, amount, tier, ignoreTransferLimit, externally, simulate);
+ }
+
+ @Override
+ public double getCharge(ItemStack stack) {
+ return ElectricItem.manager.getCharge(stack);
+ }
+
+ @Override
+ public boolean canUse(ItemStack stack, double amount) {
+ return ElectricItem.manager.canUse(stack, amount);
+ }
+
+ @Override
+ public boolean use(ItemStack stack, double amount, EntityLivingBase entity) {
+ return ElectricItem.manager.use(stack, amount, entity);
+ }
+
+ @Override
+ public void chargeFromArmor(ItemStack stack, EntityLivingBase entity) {
+ ElectricItem.manager.chargeFromArmor(stack, entity);
+ }
+
+ @Override
+ public String getToolTip(ItemStack stack) {
+ return ElectricItem.manager.getToolTip(stack);
+ }
+
+ @Override
+ public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate)
+ {
+ if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) {
+ double euCharge = getCharge(UtilsItems.getSimpleStack(this));
+ if (euCharge != 0 && euCharge >= 1){
+ return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU));
+ }
+ return 0;
+ }
+ int energy = container.stackTagCompound.getInteger("Energy");
+ int energyReceived = Math.min(this.capacity - energy, Math.min(this.maxReceive, maxReceive));
+ if (!simulate)
+ {
+ energy += energyReceived;
+ container.stackTagCompound.setInteger("Energy", energy);
+ ElectricItem.manager.discharge(container, ElectricItem.manager.getCharge(container), 3, true, true, false);
+ ElectricItem.manager.charge(container, energy/rfPerEU, 3, true, false);
+
+ }
+ return energyReceived;
+ }
+
+ @Override
+ public int extractEnergy(ItemStack container, int maxExtract, boolean simulate)
+ {
+ if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) {
+ double euCharge = getCharge(UtilsItems.getSimpleStack(this));
+ if (euCharge != 0 && euCharge >= 1){
+ return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU));
+ }
+ return 0;
+ }
+ int energy = container.stackTagCompound.getInteger("Energy");
+ int energyExtracted = Math.min(energy, Math.min(this.maxExtract, maxExtract));
+ if (!simulate)
+ {
+ energy -= energyExtracted;
+ container.stackTagCompound.setInteger("Energy", energy);
+ ElectricItem.manager.discharge(container, ElectricItem.manager.getCharge(container), 3, true, true, false);
+ ElectricItem.manager.charge(container, energy/rfPerEU, 3, true, false);
+ }
+ return energyExtracted;
+ }
+
+ @Override
+ public int getEnergyStored(ItemStack container)
+ {
+ if ((container.stackTagCompound == null) || (!container.stackTagCompound.hasKey("Energy"))) {
+ double euCharge = getCharge(UtilsItems.getSimpleStack(this));
+ if (euCharge != 0 && euCharge >= 1){
+ return (int) (MathUtils.decimalRoundingToWholes(euCharge*rfPerEU));
+ }
+ return 0;
+ }
+ int energy = container.stackTagCompound.getInteger("Energy");
+ ElectricItem.manager.discharge(container, ElectricItem.manager.getCharge(container), 3, true, true, false);
+ ElectricItem.manager.charge(container, energy/rfPerEU, 3, true, false);
+ return energy;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java b/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java
new file mode 100644
index 0000000000..36e6c66df8
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Base.java
@@ -0,0 +1,223 @@
+package gtPlusPlus.core.item.general.fuelrods;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+
+import java.util.List;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+
+public class FuelRod_Base extends Item{
+
+ public int fuelRemaining = 0;
+ public int maximumFuel = 0;
+ public String fuelType = "";
+ public float heat = 0;
+ public float maxHeat = getMaxHeat();
+ public FuelRod_Base(String unlocalizedName, String type, int fuelLeft, int maxFuel) {
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setMaxDamage(maxFuel);
+ this.maximumFuel = maxFuel;
+ this.fuelRemaining = fuelLeft;
+ this.fuelType = type;
+ this.setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ private float getMaxHeat(){
+ float tempvar;
+ if (fuelType == "Thorium"){
+ tempvar = 2500;
+ }
+
+ else if (fuelType == "Uranium"){
+ tempvar = 5000;
+ }
+
+ else if (fuelType == "Plutonium"){
+ tempvar = 10000;
+ }
+
+ else {
+ tempvar = 5000;
+ }
+ return tempvar;
+
+ }
+
+ private void updateVars(ItemStack stack){
+ if (stack.stackTagCompound != null) {
+ heat = stack.stackTagCompound.getFloat("heat");
+ fuelRemaining = stack.stackTagCompound.getInteger("fuelRemaining");
+ }
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+
+ Float NBT_Heat = heat;
+ Float NBT_MaxHeat = maxHeat;
+ int NBT_Fuel = fuelRemaining;
+ String NBT_Type= fuelType;
+
+ if (stack.stackTagCompound != null) {
+ NBT_Heat = stack.stackTagCompound.getFloat("heat");
+ NBT_MaxHeat = stack.stackTagCompound.getFloat("maxHeat");
+ NBT_Fuel = stack.stackTagCompound.getInteger("fuelRemaining");
+ NBT_Type = stack.stackTagCompound.getString("fuelType");
+ }
+
+ String tempHeat = String.valueOf(NBT_Heat);
+ String tempMaxHeat = String.valueOf(NBT_MaxHeat);
+ String tempFuel = String.valueOf(NBT_Fuel);
+ String formattedType = EnumChatFormatting.DARK_RED+NBT_Type+EnumChatFormatting.GRAY;
+ String formattedHeat = EnumChatFormatting.RED+tempHeat+EnumChatFormatting.GRAY;
+ String formattedMaxHeat = EnumChatFormatting.RED+tempMaxHeat+EnumChatFormatting.GRAY;
+ String formattedFuelLeft = tempFuel+EnumChatFormatting.GRAY;
+
+ int tempMax = maximumFuel;
+ float tempCurrentHeat = heat;
+ int tempFuelLeft = fuelRemaining;
+
+ //Fuel Usage Formatting
+ if (tempFuelLeft <= maximumFuel/3){
+ formattedFuelLeft = EnumChatFormatting.RED+tempFuel+EnumChatFormatting.GRAY;
+ }
+ else if (tempFuelLeft >= maximumFuel/3 && tempFuelLeft <= (maximumFuel/3)*2){
+ formattedFuelLeft = EnumChatFormatting.YELLOW+tempFuel+EnumChatFormatting.GRAY;
+ }
+ else if (tempFuelLeft >= (maximumFuel/3)*2 && tempFuelLeft <= maximumFuel){
+ formattedFuelLeft = EnumChatFormatting.GREEN+tempFuel+EnumChatFormatting.GRAY;
+ }
+ else {
+ formattedFuelLeft = EnumChatFormatting.GRAY+tempFuel+EnumChatFormatting.GRAY;
+ }
+
+ //Heat Formatting
+ if (tempCurrentHeat <= 200 && tempCurrentHeat >= 0){
+ formattedHeat = EnumChatFormatting.GRAY+tempHeat+EnumChatFormatting.GRAY;
+ }
+ else if (tempCurrentHeat <= maxHeat/3 && tempCurrentHeat > 200){
+ formattedHeat = EnumChatFormatting.YELLOW+tempHeat+EnumChatFormatting.GRAY;
+ }
+ else if (tempCurrentHeat >= maxHeat/3 && tempMax < (maxHeat/3)*2 && tempCurrentHeat != 0){
+ formattedHeat = EnumChatFormatting.GOLD+tempHeat+EnumChatFormatting.GRAY;
+ }
+ else if (tempCurrentHeat >= ((maxHeat/3)*2) && tempMax <= maxHeat && tempCurrentHeat != 0){
+ formattedHeat = EnumChatFormatting.RED+tempHeat+EnumChatFormatting.GRAY;
+ }
+ else {
+ formattedHeat = EnumChatFormatting.BLUE+tempHeat+EnumChatFormatting.GRAY;
+ }
+ list.add(EnumChatFormatting.GRAY+"A "+formattedType+" Fuel Rod.");
+ list.add(EnumChatFormatting.GRAY+"Running at "+formattedHeat+"/"+formattedMaxHeat+" Kelvin.");
+ list.add(EnumChatFormatting.GRAY+"Fuel Remaining: "+formattedFuelLeft+"L.");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public String getType(ItemStack stack){
+ if (stack.stackTagCompound != null){
+ return stack.stackTagCompound.getString("fuelType");
+ }
+ return fuelType;
+ }
+
+ public int getFuelRemaining(ItemStack stack){
+ if (stack.stackTagCompound != null){
+ return stack.stackTagCompound.getInteger("fuelRemaining");
+ }
+ return 0;
+ }
+
+ public int getMaxFuel(){
+ return maximumFuel;
+ }
+
+ public int getFuel(ItemStack stack){
+ if (stack != null){
+ int i = stack.getItemDamage();
+ int r = maximumFuel - i;
+ return r;
+ }
+ return getFuelRemaining(stack);
+ }
+
+ public boolean setFuelRemainingExplicitly(int i){
+ int tempFuel = fuelRemaining;
+ fuelRemaining = i;
+ if (i != tempFuel){
+ return true;
+ }
+ return false;
+ }
+
+ public boolean addFuel(int i){
+ int tempFuel = fuelRemaining;
+ fuelRemaining = tempFuel+i;
+ if (fuelRemaining != tempFuel){
+ return true;
+ }
+ return false;
+ }
+
+ public float getHeat(ItemStack value){
+ if (value.stackTagCompound != null){
+ return value.stackTagCompound.getFloat("heat");
+ }
+ return 0f;
+ }
+
+ public boolean addHeat(float i){
+ float tempFuel = heat;
+ heat = tempFuel+i;
+ if (heat != tempFuel){
+ return true;
+ }
+ return false;
+ }
+
+
+ //Ticking and NBT Handling
+ /* Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
+ * update it's contents.
+ *
+ * public int fuelRemaining = 0;
+ public int maximumFuel = 0;
+ public String fuelType = "";
+ public float heat = 0;
+ public float maxHeat = 5000;
+ *
+ */
+ @Override
+ public void onCreated(ItemStack itemStack, World world, EntityPlayer player) {
+ itemStack.stackTagCompound = new NBTTagCompound();
+ itemStack.stackTagCompound.setInteger("fuelRemaining", getFuelRemaining(itemStack));
+ itemStack.stackTagCompound.setInteger("maximumFuel", maximumFuel);
+ itemStack.stackTagCompound.setFloat("heat", getHeat(itemStack));
+ itemStack.stackTagCompound.setFloat("maxHeat", getMaxHeat());
+ itemStack.stackTagCompound.setString("fuelType", getType(itemStack));
+ updateVars(itemStack);
+ }
+
+ @Override
+ public void onUpdate(ItemStack itemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
+ itemStack.stackTagCompound = new NBTTagCompound();
+ itemStack.stackTagCompound.setInteger("fuelRemaining", getFuelRemaining(itemStack));
+ itemStack.stackTagCompound.setInteger("maximumFuel", maximumFuel);
+ itemStack.stackTagCompound.setFloat("heat", getHeat(itemStack));
+ itemStack.stackTagCompound.setFloat("maxHeat", getMaxHeat());
+ itemStack.stackTagCompound.setString("fuelType", getType(itemStack));
+ updateVars(itemStack);
+ }
+
+
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Thorium.java b/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Thorium.java
new file mode 100644
index 0000000000..9b852cb1ea
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/general/fuelrods/FuelRod_Thorium.java
@@ -0,0 +1,13 @@
+package gtPlusPlus.core.item.general.fuelrods;
+
+public class FuelRod_Thorium extends FuelRod_Base{
+
+ public FuelRod_Thorium(String unlocalizedName, String type, int fuelLeft, int maxFuel) {
+ super(unlocalizedName, type, fuelLeft, maxFuel);
+ this.setMaxDamage(maxFuel);
+ this.maximumFuel = maxFuel;
+ this.fuelRemaining = fuelLeft;
+ this.fuelType = type;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/init/ItemsFoods.java b/src/Java/gtPlusPlus/core/item/init/ItemsFoods.java
new file mode 100644
index 0000000000..8f1a2083ac
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/init/ItemsFoods.java
@@ -0,0 +1,43 @@
+package gtPlusPlus.core.item.init;
+
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.item.base.foods.BaseItemFood;
+import gtPlusPlus.core.item.base.foods.BaseItemHotFood;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.item.UtilsItems;
+import net.minecraft.potion.Potion;
+import net.minecraft.potion.PotionEffect;
+
+public class ItemsFoods {
+
+ public static void load(){
+ run();
+ }
+
+ private static void run(){
+
+ //Raisin Bread
+ ModItems.itemIngotRaisinBread = new BaseItemFood("itemIngotRaisinBread", "Raisin Bread", 3, 1.5f, false, new PotionEffect(Potion.weakness.id, 40, 1)).setAlwaysEdible();
+ GT_OreDictUnificator.registerOre("foodRaisinBread", UtilsItems.getItemStack(CORE.MODID+":itemIngotRaisinBread", 1));
+ //Hot Raisin Bread
+ ModItems.itemHotIngotRaisinBread = new BaseItemHotFood("itemHotIngotRaisinBread", 1, 0.5f, "Raisin Bread", 120, ModItems.itemIngotRaisinBread);
+ GT_OreDictUnificator.registerOre("foodHotRaisinBread", UtilsItems.getItemStack(CORE.MODID+":itemHotIngotRaisinBread", 1));
+
+ //Raisin Bread
+ ModItems.itemFoodRaisinToast = new BaseItemFood("itemFoodRaisinToast", "Raisin Toast", 1, 0.5f, false).setAlwaysEdible();
+ GT_OreDictUnificator.registerOre("foodRaisinToast", UtilsItems.getItemStack(CORE.MODID+":itemFoodRaisinToast", 1));
+ //Hot Raisin Bread
+ ModItems.itemHotFoodRaisinToast = new BaseItemHotFood("itemHotFoodRaisinToast", 1, 0.5f, "Raisin Toast", 20, ModItems.itemFoodRaisinToast);
+ GT_OreDictUnificator.registerOre("foodHotRaisinToast", UtilsItems.getItemStack(CORE.MODID+":itemHotFoodRaisinToast", 1));
+
+ //Raisin Bread
+ ModItems.itemFoodCurriedSausages = new BaseItemFood("itemFoodCurriedSausages", "Curried Sausages", 5, 2f, false);
+ GT_OreDictUnificator.registerOre("foodCurriedSausages", UtilsItems.getItemStack(CORE.MODID+":itemFoodCurriedSausages", 1));
+ //Hot Raisin Bread
+ ModItems.itemHotFoodCurriedSausages = new BaseItemHotFood("itemHotFoodCurriedSausages", 1, 0.5f, "Curried Sausages", 240, ModItems.itemFoodCurriedSausages);
+ GT_OreDictUnificator.registerOre("foodHotCurriedSausages", UtilsItems.getItemStack(CORE.MODID+":itemHotFoodCurriedSausages", 1));
+
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/materials/MaterialHandler.java b/src/Java/gtPlusPlus/core/item/materials/MaterialHandler.java
new file mode 100644
index 0000000000..0f89f2a0ff
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/materials/MaterialHandler.java
@@ -0,0 +1,10 @@
+package gtPlusPlus.core.item.materials;
+
+public class MaterialHandler {
+
+ @SuppressWarnings("unused")
+ private String Staballoy;
+
+
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java b/src/Java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java
new file mode 100644
index 0000000000..108ac4b83d
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/tool/misc/SandstoneHammer.java
@@ -0,0 +1,79 @@
+package gtPlusPlus.core.item.tool.misc;
+
+import gtPlusPlus.core.item.base.BaseItemWithDamageValue;
+import gtPlusPlus.core.lib.CORE;
+
+import java.util.List;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class SandstoneHammer extends BaseItemWithDamageValue{
+
+ /* (non-Javadoc)
+ * @see net.minecraft.item.Item#getColorFromItemStack(net.minecraft.item.ItemStack, int)
+ */
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ //Figure Out Damage
+
+
+ return super.getColorFromItemStack(stack, HEX_OxFFFFFF);
+ }
+
+ public SandstoneHammer(String unlocalizedName) {
+ super(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.setMaxStackSize(1);
+ this.setMaxDamage(2500);
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add(EnumChatFormatting.GRAY+"Allows you to craft sand from cobble, or sandstone from sand.");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack)
+ {
+ return false;
+ }
+
+ @Override
+ public boolean getShareTag()
+ {
+ return true;
+ }
+
+ @Override
+ public boolean hasContainerItem(ItemStack itemStack)
+ {
+ return true;
+ }
+ @Override
+ public ItemStack getContainerItem(ItemStack itemStack)
+ {
+ itemStack.setItemDamage(itemStack.getItemDamage() + 8);
+
+ return itemStack;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack par1ItemStack){
+ return EnumRarity.uncommon;
+ }
+
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack){
+ return false;
+ }
+
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
new file mode 100644
index 0000000000..ea59ed2b7e
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/MultiPickaxeBase.java
@@ -0,0 +1,179 @@
+package gtPlusPlus.core.item.tool.staballoy;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.core.util.player.UtilsMining;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class MultiPickaxeBase extends StaballoyPickaxe{
+
+ /* (non-Javadoc)
+ * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack)
+ */
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ if (super.getDurabilityForDisplay(stack) > 0){
+ return super.getDurabilityForDisplay(stack);}
+ return 0;
+ }
+
+ protected Boolean FACING_HORIZONTAL = true;
+ protected String FACING = "north";
+ protected EntityPlayer localPlayer;
+ protected String lookingDirection;
+ protected World localWorld;
+ protected ItemStack thisPickaxe = null;
+ protected final int colour;
+ protected final String materialName;
+
+ public MultiPickaxeBase(String unlocalizedName, ToolMaterial material, int materialDurability, int colour) {
+ super(Utils.sanitizeString(unlocalizedName), material);
+ this.setUnlocalizedName(Utils.sanitizeString(unlocalizedName));
+ this.setTextureName(CORE.MODID + ":" + "itemPickaxe");
+ this.FACING_HORIZONTAL=true;
+ this.setMaxStackSize(1);
+ this.setMaxDamage(materialDurability);
+ this.colour = colour;
+ this.materialName = material.name();
+ GameRegistry.registerItem(this, Utils.sanitizeString(unlocalizedName));
+ this.setCreativeTab(AddToCreativeTab.tabTools);
+ }
+
+ /*
+ *
+ *
+ *
+ * Methods
+ *
+ *
+ *
+ */
+
+ public final String getMaterialName() {
+ return materialName;
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack iStack) {
+
+ String name;
+ if (getUnlocalizedName().toLowerCase().contains("wood")){
+ name = "Wooden";
+ }
+ else if (getUnlocalizedName().toLowerCase().contains("cobblestone")){
+ name = "Cobblestone";
+ }
+ else if (getUnlocalizedName().toLowerCase().contains("iron")){
+ name = "Iron";
+ }
+ else if (getUnlocalizedName().toLowerCase().contains("gold")){
+ name = "Gold";
+ }
+ else if (getUnlocalizedName().toLowerCase().contains("diamond")){
+ name = "Diamond";
+ }
+ else {
+ name = materialName;
+ }
+ return name+" Multipickaxe";
+ }
+
+ @Override
+ public int getColorFromItemStack(ItemStack stack, int HEX_OxFFFFFF) {
+ if (colour == 0){
+ return MathUtils.generateSingularRandomHexValue();
+ }
+ return colour;
+
+ }
+
+ @SuppressWarnings("static-method")
+ private float calculateDurabilityLoss(World world, int X, int Y, int Z){
+ float bDurabilityLoss = 0;
+ Boolean correctTool = false;
+ float bHardness = 0;
+ if (!world.isRemote){
+ try {
+ Block removalist = world.getBlock(X, Y, Z);
+ //Utils.LOG_WARNING(removalist.toString());
+
+ bHardness = removalist.getBlockHardness(world, X, Y, Z);
+ Utils.LOG_WARNING("Hardness: "+bHardness);
+
+ bDurabilityLoss = (bDurabilityLoss + bHardness);
+ //Utils.LOG_WARNING("Durability Loss: "+bDurabilityLoss);
+
+ correctTool = canPickaxeBlock(removalist, world);
+ Utils.LOG_WARNING(""+correctTool);
+
+ if (!correctTool){
+ return 0;
+ }
+
+ } catch (NullPointerException e){
+
+ }
+ }
+ return bDurabilityLoss;
+ }
+
+ @Override
+ public int doDurabilityDamage(int x){
+ return x;
+ }
+
+ //Should clear up blocks quicker if I chain it.
+ @Override
+ public void removeBlockAndDropAsItem(World world, int X, int Y, int Z, ItemStack heldItem){
+ localWorld = world;
+ try {
+ Block block = world.getBlock(X, Y, Z);
+ float dur = calculateDurabilityLoss(world, X, Y, Z);
+ Utils.LOG_WARNING(block.toString());
+ String removalTool = "";
+ removalTool = block.getHarvestTool(1);
+
+ if (removalTool.equals("pickaxe") || UtilsMining.getBlockType(block)){
+ if (canPickaxeBlock(block, world)){
+ if((block != Blocks.bedrock) && (block.getBlockHardness(world, X, Y, Z) != -1) && (block.getBlockHardness(world, X, Y, Z) <= 100) && (block != Blocks.water) && (block != Blocks.lava)){
+
+ if (heldItem.getItemDamage() <= (heldItem.getMaxDamage()-dur)){
+
+ block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
+ world.setBlockToAir(X, Y, Z);
+
+ }
+
+ }
+ }
+ else {
+ Utils.LOG_WARNING("Incorrect Tool for mining this block.");
+ }
+ }
+ } catch (NullPointerException e){
+
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack par1ItemStack){
+ return EnumRarity.uncommon;
+ }
+
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack){
+ return false;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java
new file mode 100644
index 0000000000..07c5800a1f
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyAxe.java
@@ -0,0 +1,279 @@
+package gtPlusPlus.core.item.tool.staballoy;
+
+import gtPlusPlus.core.lib.CORE;
+
+import java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockAir;
+import net.minecraft.block.BlockCocoa;
+import net.minecraft.block.BlockDirt;
+import net.minecraft.block.BlockDoublePlant;
+import net.minecraft.block.BlockFlower;
+import net.minecraft.block.BlockGrass;
+import net.minecraft.block.BlockHugeMushroom;
+import net.minecraft.block.BlockLeavesBase;
+import net.minecraft.block.BlockLog;
+import net.minecraft.block.BlockMushroom;
+import net.minecraft.block.BlockSand;
+import net.minecraft.block.BlockSnow;
+import net.minecraft.block.BlockSnowBlock;
+import net.minecraft.block.BlockTallGrass;
+import net.minecraft.block.BlockVine;
+import net.minecraft.enchantment.EnchantmentHelper;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.ItemAxe;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class StaballoyAxe extends ItemAxe{
+ public String mat;
+
+ public StaballoyAxe(String unlocalizedName, ToolMaterial material) {
+ super(material);
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ }
+
+ // EXPLODE TREE
+ byte[] tre= new byte[32000];
+ byte unchecked=0;
+ byte needcheck=1;
+ byte ignore =2;
+ byte harvest =3;
+
+ private boolean setcheck(int x, int y, int z) {
+ if(x<0 || x>19 || z<0 || z>19 || y<0 || y>79) return false;
+ int o=x+z*20+y*400;
+ if (tre[o]==unchecked) tre[o]=needcheck;
+ return true;
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add(EnumChatFormatting.GOLD+"Fells entire trees in a single swipe!..");
+ list.add(EnumChatFormatting.GRAY+"Ask Alkalus for new trees to be supported.");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ public boolean canIgnore(Block bit){
+ if (bit instanceof BlockAir)return true;
+ if (bit instanceof BlockGrass)return true;
+ if (bit instanceof BlockSand)return true;
+ if (bit instanceof BlockDirt)return true;
+ if (bit instanceof BlockCocoa)return true;
+ if (bit instanceof BlockVine)return true;
+ if (bit instanceof BlockMushroom)return true;
+ if (bit instanceof BlockSnow)return true;
+ if (bit instanceof BlockSnowBlock)return true;
+ if (bit instanceof BlockFlower)return true;
+ if (bit instanceof BlockTallGrass)return true;
+ if (bit instanceof BlockDoublePlant)return true;
+
+ //LoonTools.log("Found uncuttable "+bit.getClass().getSimpleName());
+ return false;
+ }
+
+ private int check(World par1World, int x, int y, int z, int xo, int yo,int zo) {
+ int f=0;
+ int o=x+z*20+y*400;
+ if (tre[o]==needcheck){
+ tre[o]=ignore;
+ Block bit = par1World.getBlock(x+xo, y+yo, z+zo);
+ if ((bit instanceof BlockLog)||(bit instanceof BlockLeavesBase)||(bit instanceof BlockHugeMushroom) || (bit.getUnlocalizedName().toLowerCase().contains("log")) || (bit.getUnlocalizedName().toLowerCase().contains("wood"))){
+ f=1;
+ tre[o]=harvest;
+ //if (bit instanceof BlockLog){
+ // LoonTools.log("^ Found log @ "+x+xo+" "+y+yo+" "+z+zo+" ");
+ //}
+ for(int xb=-1;xb<2;xb++)
+ for(int yb=-1;yb<2;yb++)
+ for(int zb=-1;zb<2;zb++)
+ if (!setcheck(x+xb,y+yb,z+zb))return 3;
+ }else{
+ if (!canIgnore(bit)) return 2;
+ }
+ }
+ return f;
+ }
+
+ public int checkTree(World par1World,int xo,int yo,int zo){
+ boolean f;
+ for (f=true;f==true;){
+ f=false;
+ for (int y=0;y<80;y++)
+ for(int z=0;z<20;z++)
+ for(int x=0;x<20;x++){
+ int r=check(par1World,x,y,z,xo,yo,zo);
+ if (r==3) return 3;
+ if (r==2) return 2;
+ if (r==1) f=true;
+ }
+
+ for (int y=79;y>=0;y--)
+ for(int z=19;z>=0;z--)
+ for(int x=19;x>=0;x--){
+ int r=check(par1World,x,y,z,xo,yo,zo);
+ if (r==2) return 3;
+ if (r==2) return 2;
+ if (r==1) f=true;
+ }
+ }
+ return 1;
+ }
+
+ private int check2(World par1World, int x, int y, int z, int xo, int yo,int zo) {
+ int f=0;
+ int o=x+z*20+y*400;
+ if (tre[o]==needcheck){
+ tre[o]=ignore;
+ Block bit = par1World.getBlock(x+xo, y+yo, z+zo);
+ if (bit instanceof BlockLog){
+ f=1;
+ tre[o]=harvest;
+ //if (bit instanceof BlockLog){
+ // LoonTools.log("^ Found log @ "+x+xo+" "+y+yo+" "+z+zo+" ");
+ //}
+ for(int xb=-1;xb<2;xb++)
+ for(int yb=-1;yb<2;yb++)
+ for(int zb=-1;zb<2;zb++)
+ if (!setcheck(x+xb,y+yb,z+zb))return 3;
+ }else if (bit instanceof BlockLeavesBase){
+ }else{
+ if (!canIgnore(bit)) return 2;
+ }
+ }
+ return f;
+ }
+
+ public int checkTree2(World par1World,int xo,int yo,int zo){
+ boolean f;
+ for (f=true;f==true;){
+ f=false;
+ for (int y=0;y<80;y++)
+ for(int z=0;z<20;z++)
+ for(int x=0;x<20;x++){
+ int r=check2(par1World,x,y,z,xo,yo,zo);
+ if (r==3) return 3;
+ if (r==2) return 2;
+ if (r==1) f=true;
+ }
+
+ for (int y=79;y>=0;y--)
+ for(int z=19;z>=0;z--)
+ for(int x=19;x>=0;x--){
+ int r=check2(par1World,x,y,z,xo,yo,zo);
+ if (r==2) return 3;
+ if (r==2) return 2;
+ if (r==1) f=true;
+ }
+ }
+ return 1;
+ }
+
+ public void exploadTree(World par1World,int xo,int yo,int zo, EntityPlayer plr){
+ for (int y=0;y<80;y++)
+ for(int z=0;z<20;z++)
+ for(int x=0;x<20;x++){
+ int o=x+z*20+y*400;
+ if (tre[o]==harvest){
+ Block bit = par1World.getBlock(x+xo, y+yo, z+zo);
+ int met = par1World.getBlockMetadata(x+xo, y+yo, z+zo);
+
+ if ((bit instanceof BlockLog)||(bit instanceof BlockLeavesBase) || (bit.getUnlocalizedName().toLowerCase().contains("log")) || (bit.getUnlocalizedName().toLowerCase().contains("wood"))){
+ bit.harvestBlock(par1World, plr, x+xo, y+yo, z+zo,met);
+ par1World.setBlockToAir(x+xo, y+yo, z+zo);
+ }
+ }
+ }
+ }
+
+ private void breakMushroom(World wld, Block bit, EntityPlayer plr, boolean silk, int x, int y, int z, int met) {
+ if (silk){
+ ItemStack stk = null; //TODO
+ /*if (bit==Blocks.brown_mushroom_block) stk = new ItemStack(LoonToolItems.brown_mushroom_block,1,met);
+ else if (bit==Blocks.red_mushroom_block) stk = new ItemStack(LoonToolItems.red_mushroom_block,1,met);
+ else stk = new ItemStack(bit,1,met);*/
+ EntityItem entityitem = new EntityItem(wld, x+0.5, y+0.5, z+0.5, stk);
+ entityitem.delayBeforeCanPickup = 10;
+ wld.spawnEntityInWorld(entityitem);
+ }else{
+ bit.harvestBlock(wld, plr, x, y, z, met);
+ }
+ wld.setBlockToAir(x, y, z);
+ }
+
+ public void exploadMushroom(World par1World,int xo,int yo,int zo, EntityPlayer plr, boolean silk){
+ for (int y=0;y<80;y++)
+ for(int z=0;z<20;z++)
+ for(int x=0;x<20;x++){
+ int o=x+z*20+y*400;
+ if (tre[o]==harvest){
+ Block bit = par1World.getBlock(x+xo, y+yo, z+zo);
+ int met = par1World.getBlockMetadata(x+xo, y+yo, z+zo);
+ if (bit instanceof BlockHugeMushroom){
+ breakMushroom(par1World, bit, plr, silk, x+xo, y+yo, z+zo,met);
+ }else{
+ bit.harvestBlock(par1World, plr, x+xo, y+yo, z+zo,met);
+ par1World.setBlockToAir(x+xo, y+yo, z+zo);
+ }
+ }
+ }
+ }
+
+
+ @Override
+ public boolean onBlockDestroyed(ItemStack itm, World wld,Block blk, int x, int y,int z, EntityLivingBase plr) {
+ if (!wld.isRemote){
+ Block bit = wld.getBlock(x, y, z);
+ boolean silk=EnchantmentHelper.getSilkTouchModifier(plr);
+ if ((bit instanceof BlockHugeMushroom)){
+ for (int n=0;n<32000;n++) tre[n]=unchecked;
+ int met = wld.getBlockMetadata(x, y, z);
+ breakMushroom(wld, bit, (EntityPlayer) plr, silk, x, y, z,met);
+ wld.setBlockToAir(x,y,z);
+ tre[2210]=needcheck;
+ if (checkTree(wld,x-10,y-4,z-10)==1){
+ exploadMushroom(wld,x-10,y-4,z-10,(EntityPlayer) plr,silk);
+ }
+ }
+
+ if (bit instanceof BlockLog || (bit.getUnlocalizedName().toLowerCase().contains("log")) || (bit.getUnlocalizedName().toLowerCase().contains("wood"))){
+ //LoonTools.log("cutting tree @ "+x+" "+y+" "+z+" ");
+ for (int n=0;n<32000;n++) tre[n]=unchecked;
+ int met = wld.getBlockMetadata(x, y, z);
+ bit.harvestBlock(wld, (EntityPlayer) plr, x, y, z,met);
+ wld.setBlockToAir(x,y,z);
+ tre[2210]=needcheck;
+ if (checkTree(wld,x-10,y-4,z-10)==1){
+ exploadTree(wld,x-10,y-4,z-10,(EntityPlayer) plr);
+ }else{
+ for (int n=0;n<32000;n++) tre[n]=unchecked;
+ tre[2210]=needcheck;
+ if (checkTree2(wld,x-10,y-4,z-10)==1){
+ exploadTree(wld,x-10,y-4,z-10,(EntityPlayer) plr);
+ }
+ }
+ }
+ }
+ return super.onBlockDestroyed(itm, wld, blk, x, y, z, plr);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack par1ItemStack){
+ return EnumRarity.rare;
+ }
+
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack){
+ return true;
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java
new file mode 100644
index 0000000000..a21ee7e6ad
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/item/tool/staballoy/StaballoyPickaxe.java
@@ -0,0 +1,310 @@
+package gtPlusPlus.core.item.tool.staballoy;
+
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.player.UtilsMining;
+
+import java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.EnumRarity;
+import net.minecraft.item.ItemPickaxe;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.MathHelper;
+import net.minecraft.util.MovingObjectPosition;
+import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class StaballoyPickaxe extends ItemPickaxe{
+
+ /* (non-Javadoc)
+ * @see net.minecraft.item.Item#getDurabilityForDisplay(net.minecraft.item.ItemStack)
+ */
+ @Override
+ public double getDurabilityForDisplay(ItemStack stack) {
+ if (super.getDurabilityForDisplay(stack) > 0){
+ return super.getDurabilityForDisplay(stack);}
+ return 0;
+ }
+
+ protected Boolean FACING_HORIZONTAL = true;
+ protected String FACING = "north";
+ protected EntityPlayer localPlayer;
+ protected String lookingDirection;
+ protected World localWorld;
+ public ItemStack thisPickaxe = null;
+
+ /*
+ *
+ *
+ *
+ * Methods
+ *
+ *
+ *
+ */
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer aPlayer) {
+ localPlayer = aPlayer;
+ localWorld = world;
+ thisPickaxe = stack;
+ return super.onItemRightClick(stack, world, aPlayer);
+ }
+
+
+
+ @Override
+ public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int X, int Y, int Z, EntityLivingBase entity) {
+ //super.onBlockDestroyed(stack, world, block, X, Y, Z, entity);
+ localWorld = world;
+ thisPickaxe = stack;
+ //checkFacing(world);
+ if (!world.isRemote){
+ GetDestroyOrientation(lookingDirection, world, X, Y, Z, stack);
+ }
+
+ return super.onBlockDestroyed(stack, world, block, X, Y, Z, entity);
+ }
+
+ @SuppressWarnings("static-method")
+ private float calculateDurabilityLoss(World world, int X, int Y, int Z){
+ float bDurabilityLoss = 0;
+ Boolean correctTool = false;
+ float bHardness = 0;
+ if (!world.isRemote){
+ try {
+ Block removalist = world.getBlock(X, Y, Z);
+ //Utils.LOG_WARNING(removalist.toString());
+
+ bHardness = removalist.getBlockHardness(world, X, Y, Z);
+ Utils.LOG_WARNING("Hardness: "+bHardness);
+
+ bDurabilityLoss = (bDurabilityLoss + bHardness);
+ //Utils.LOG_WARNING("Durability Loss: "+bDurabilityLoss);
+
+ correctTool = canPickaxeBlock(removalist, world);
+ Utils.LOG_WARNING(""+correctTool);
+
+ if (!correctTool){
+ return 0;
+ }
+
+ } catch (NullPointerException e){
+
+ }
+ }
+ return bDurabilityLoss;
+ }
+
+ public Boolean canPickaxeBlock(Block currentBlock, World currentWorld){
+ String correctTool = "";
+ if (!currentWorld.isRemote){
+ try {
+ correctTool = currentBlock.getHarvestTool(0);
+ //Utils.LOG_WARNING(correctTool);
+ if (UtilsMining.getBlockType(currentBlock) || correctTool.equals("pickaxe")){
+ return true;}
+ } catch (NullPointerException e){
+ return false;}
+ }
+ return false;
+ }
+
+ private void GetDestroyOrientation(String FACING, World world, int X, int Y, int Z, ItemStack heldItem){
+ localWorld = world;
+ float DURABILITY_LOSS = 0;
+ if (!world.isRemote){
+
+ if (FACING.equals("below") || FACING.equals("above")){
+ DURABILITY_LOSS = 0;
+ for(int i = -1; i < 2; i++) {
+ for(int j = -1; j < 2; j++) {
+ float dur = calculateDurabilityLoss(world, X + i, Y, Z + j);
+ DURABILITY_LOSS = (DURABILITY_LOSS + calculateDurabilityLoss(world, X + i, Y, Z + j));
+ Utils.LOG_WARNING("Added Loss: "+dur);
+ removeBlockAndDropAsItem(world, X + i, Y, Z + j, heldItem);
+ }
+ }
+ }
+
+ else if (FACING.equals("facingEast") || FACING.equals("facingWest")){
+ DURABILITY_LOSS = 0;
+ for(int i = -1; i < 2; i++) {
+ for(int j = -1; j < 2; j++) {
+ float dur = calculateDurabilityLoss(world, X, Y + i, Z + j);
+ DURABILITY_LOSS = (DURABILITY_LOSS + calculateDurabilityLoss(world, X, Y + i, Z + j));
+ Utils.LOG_WARNING("Added Loss: "+dur);
+ removeBlockAndDropAsItem(world, X , Y + i, Z + j, heldItem);
+ }
+ }
+ }
+
+ else if (FACING.equals("facingNorth") || FACING.equals("facingSouth")){
+ DURABILITY_LOSS = 0;
+ for(int i = -1; i < 2; i++) {
+ for(int j = -1; j < 2; j++) {
+ float dur = calculateDurabilityLoss(world, X + j, Y + i, Z);
+ DURABILITY_LOSS = (DURABILITY_LOSS + dur);
+ Utils.LOG_WARNING("Added Loss: "+dur);
+ removeBlockAndDropAsItem(world, X + j, Y + i, Z, heldItem);
+ }
+ }
+ }
+
+ //int heldItemDurability = heldItem.getDamage(1);
+ Utils.LOG_WARNING("Total Loss: "+(int)DURABILITY_LOSS);
+ //heldItem.setDamage(heldStack, DURABILITY_LOSS);
+ //Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage());
+ //Utils.LOG_WARNING("Durability: "+heldStack.getDamage(heldStack));
+ if (heldItem.getItemDamage() < (heldItem.getMaxDamage()-DURABILITY_LOSS)){
+ heldItem.damageItem((int) DURABILITY_LOSS, localPlayer);
+ }
+ //Utils.LOG_WARNING("|GID|Durability: "+heldItem.getItemDamage());
+ DURABILITY_LOSS = 0;
+
+ }
+ }
+
+ public int doDurabilityDamage(int x){
+ return x;
+ }
+
+ //Should clear up blocks quicker if I chain it.
+ public void removeBlockAndDropAsItem(World world, int X, int Y, int Z, ItemStack heldItem){
+ localWorld = world;
+ try {
+ Block block = world.getBlock(X, Y, Z);
+ float dur = calculateDurabilityLoss(world, X, Y, Z);
+ Utils.LOG_WARNING(block.toString());
+ String removalTool = "";
+ removalTool = block.getHarvestTool(1);
+
+ if (removalTool.equals("pickaxe") || UtilsMining.getBlockType(block)){
+ if (canPickaxeBlock(block, world)){
+ if((block != Blocks.bedrock) && (block.getBlockHardness(world, X, Y, Z) != -1) && (block.getBlockHardness(world, X, Y, Z) <= 100) && (block != Blocks.water) && (block != Blocks.lava)){
+
+ if (heldItem.getItemDamage() <= (heldItem.getMaxDamage()-dur)){
+
+ block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
+ world.setBlockToAir(X, Y, Z);
+
+ }
+
+ }
+ }
+ else {
+ Utils.LOG_WARNING("Incorrect Tool for mining this block.");
+ }
+ }
+ } catch (NullPointerException e){
+
+ }
+ }
+
+ public boolean checkFacing(World world){
+ localWorld = world;
+ if (localPlayer != null){
+ int direction = MathHelper.floor_double((double)((localPlayer.rotationYaw * 4F) / 360F) + 0.5D) & 3;
+ //Utils.LOG_WARNING("Player - F: "+direction);
+ //Utils.LOG_WARNING("Player - getLookVec(): "+localPlayer.getLookVec().yCoord);
+
+ /*if (localPlayer.getLookVec().yCoord > 0){
+ localPlayer.getLookVec().yCoord;
+ }*/
+
+ MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, (EntityPlayer) localPlayer, false);
+ if (movingobjectposition != null){
+ int sideHit = movingobjectposition.sideHit;
+ String playerStandingPosition = "";
+ if (movingobjectposition != null) {
+ //System.out.println("Side Hit: "+movingobjectposition.sideHit);
+ }
+
+ if (sideHit == 0){
+ playerStandingPosition = "above";
+ FACING_HORIZONTAL = false;
+ }
+ else if (sideHit == 1){
+ playerStandingPosition = "below";
+ FACING_HORIZONTAL = false;
+ }
+ else if (sideHit == 2){
+ playerStandingPosition = "facingSouth";
+ FACING_HORIZONTAL = true;
+ }
+ else if (sideHit == 3){
+ playerStandingPosition = "facingNorth";
+ FACING_HORIZONTAL = true;
+ }
+ else if (sideHit == 4){
+ playerStandingPosition = "facingEast";
+ FACING_HORIZONTAL = true;
+ }
+ else if (sideHit == 5){
+ playerStandingPosition = "facingWest";
+ FACING_HORIZONTAL = true;
+ }
+ lookingDirection = playerStandingPosition;
+
+ if (direction == 0){
+ FACING = "south";
+ }
+ else if (direction == 1){
+ FACING = "west";
+ }
+ else if (direction == 2){
+ FACING = "north";
+ }
+ else if (direction == 3){
+ FACING = "east";
+ }
+ }
+
+
+ return true;
+ }
+ return false;
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ thisPickaxe = stack;
+ list.add(EnumChatFormatting.GOLD+"Mines a 3x3 area in the direction you are facing.");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack par1ItemStack){
+ return EnumRarity.rare;
+ }
+
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack){
+ return true;
+ }
+
+
+ @Override
+ public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer aPlayer) {
+ thisPickaxe = itemstack;
+ localPlayer = aPlayer;
+ checkFacing(localPlayer.worldObj);
+ return super.onBlockStartBreak(itemstack, X, Y, Z, aPlayer);
+ }
+ public StaballoyPickaxe(String unlocalizedName, ToolMaterial material) {
+ super(material);
+ this.setUnlocalizedName(unlocalizedName);
+ this.setTextureName(CORE.MODID + ":" + unlocalizedName);
+ this.FACING_HORIZONTAL=true;
+ this.setMaxStackSize(1);
+ this.setMaxDamage(3200);
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/lib/CORE.java b/src/Java/gtPlusPlus/core/lib/CORE.java
new file mode 100644
index 0000000000..262f46b831
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/lib/CORE.java
@@ -0,0 +1,96 @@
+package gtPlusPlus.core.lib;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.util.gregtech.recipehandlers.GregtechRecipe;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import gtPlusPlus.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder;
+import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.common.config.Configuration;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class CORE {
+
+ public static final String name = "GT++";
+ public static final String MODID = "miscutils";
+ public static final String VERSION = "1.4.4.2-release";
+ public static boolean DEBUG = false;
+ public static final boolean LOAD_ALL_CONTENT = false;
+ public static final int GREG_FIRST_ID = 760;
+ public static Map PlayerCache;
+ public static final String[] VOLTAGES = {"ULV","LV","MV","HV","EV","IV","LuV","ZPM","UV","MAX"};
+ public static final boolean MAIN_GREGTECH_5U_EXPERIMENTAL_FORK = Meta_GT_Proxy.areWeUsingGregtech5uExperimental();
+ public static IGregtech_RecipeAdder RA;
+ @Deprecated
+ public static IGregtech_RecipeAdder sRecipeAdder;
+ public static GregtechRecipe GT_Recipe = new GregtechRecipe();
+
+ @SideOnly(Side.CLIENT)
+ public static IIconRegister GT_BlockIcons, GT_ItemIcons;
+ public static List<Runnable> GT_BlockIconload = new ArrayList<Runnable>();
+ public static final Class<AddToCreativeTab> TAB = AddToCreativeTab.class;
+ public static Configuration Config;
+ public static final String GT_Tooltip = "Added by: " + EnumChatFormatting.DARK_GREEN+"Alkalus "+EnumChatFormatting.GRAY+"- "+EnumChatFormatting.RED+"[GT++]";
+ public static final String GT_Tooltip_Radioactive = EnumChatFormatting.GRAY+"Warning: "+EnumChatFormatting.GREEN+"Radioactive! "+EnumChatFormatting.GOLD+" Avoid direct handling without hazmat protection.";
+ public static final String noItem = "";
+
+ /**
+ * A List containing all the Materials, which are somehow in use by GT and therefor receive a specific Set of Items.
+ */
+ public static final GT_Materials[] sMU_GeneratedMaterials = new GT_Materials[1000];
+
+ //GUIS
+ public enum GUI_ENUM
+ {
+ ENERGYBUFFER, TOOLBUILDER, NULL, NULL1, NULL2
+ }
+
+ /**
+ * File Paths and Resource Paths
+ */
+ public static final String
+ TEX_DIR = "textures/",
+ TEX_DIR_GUI = TEX_DIR + "gui/",
+ TEX_DIR_ITEM = TEX_DIR + "items/",
+ TEX_DIR_BLOCK = TEX_DIR + "blocks/",
+ TEX_DIR_ENTITY = TEX_DIR + "entity/",
+ TEX_DIR_ASPECTS = TEX_DIR + "aspects/",
+ TEX_DIR_FLUIDS = TEX_DIR_BLOCK + "fluids/",
+ RES_PATH = MODID + ":" + TEX_DIR,
+ RES_PATH_GUI = MODID + ":" + TEX_DIR_GUI,
+ RES_PATH_ITEM = MODID + ":" + TEX_DIR_ITEM,
+ RES_PATH_BLOCK = MODID + ":" + TEX_DIR_BLOCK,
+ RES_PATH_ENTITY = MODID + ":" + TEX_DIR_ENTITY,
+ RES_PATH_ASPECTS = MODID + ":" + TEX_DIR_ASPECTS,
+ RES_PATH_FLUIDS = MODID + ":" + TEX_DIR_FLUIDS;
+
+
+ //public static final Materials2[] MiscGeneratedMaterials = new Materials2[1000];
+
+ public static class configSwitches {
+
+ //Debug
+ public static boolean disableEnderIOIntegration = false;
+ public static boolean disableStaballoyBlastFurnaceRecipe = false;
+ public static boolean disableCentrifugeFormation = false;
+
+ //Machine Related
+ public static boolean enableSolarGenerators = false;
+ public static boolean enableAlternativeBatteryAlloy = false;
+ public static boolean enableThaumcraftShardUnification = false;
+ public static boolean disableIC2Recipes = false;
+ public static boolean enableAlternativeDivisionSigilRecipe = false;
+
+ //Feature Related
+ public static boolean enableCustomAlvearyBlocks = false;
+
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/lib/LoadedMods.java b/src/Java/gtPlusPlus/core/lib/LoadedMods.java
new file mode 100644
index 0000000000..f1cc7eb830
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/lib/LoadedMods.java
@@ -0,0 +1,174 @@
+package gtPlusPlus.core.lib;
+
+import gtPlusPlus.core.lib.CORE.configSwitches;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechTextures;
+import gtPlusPlus.xmod.gregtech.recipes.GregtechRecipeAdder;
+import cpw.mods.fml.common.Loader;
+
+public class LoadedMods {
+
+
+ //Initialize Variables
+ public static boolean Gregtech = false;
+ public static boolean EnderIO = false;
+ public static boolean Big_Reactors = false;
+ public static boolean IndustrialCraft2 = false;
+ public static boolean Simply_Jetpacks = false;
+ public static boolean RFTools = false;
+ public static boolean Thaumcraft = false;
+ public static boolean Extra_Utils = false;
+ public static boolean PneumaticCraft = false;
+ public static boolean MorePlanets = false;
+ public static boolean ForbiddenMagic = false;
+ public static boolean CompactWindmills = false;
+ public static boolean Railcraft = false;
+ public static boolean ImmersiveEngineering = false;
+ public static boolean Growthcraft = false;
+ public static boolean CoFHCore = false;
+ public static boolean Forestry = false;
+ public static boolean MagicBees = false;
+ public static boolean ExtraBees = false;
+ public static boolean Psychedelicraft = false;
+ public static boolean MiscUtils = true; //Dummy For MetaData Lookups in MT Wrapper
+ public static boolean ThermalFoundation = false;
+ public static boolean IHL = false;
+
+
+
+ private static int totalMods;
+ @SuppressWarnings("deprecation")
+ public static void checkLoaded(){
+ Utils.LOG_INFO("Looking for optional mod prereqs.");
+ if (Loader.isModLoaded("gregtech") == true ){
+ Gregtech = true;
+ Utils.LOG_INFO("Components enabled for: Gregtech");
+ if (Gregtech){
+ try {
+ CORE.sRecipeAdder = CORE.RA = new GregtechRecipeAdder();
+ Utils.LOG_INFO("Created Gregtech recipe handler.");
+ GregtechTextures.BlockIcons.VOID.name();
+ GregtechTextures.ItemIcons.VOID.name();
+ Utils.LOG_INFO("Created Gregtech texture handler.");
+ } catch (NullPointerException e){
+ Utils.LOG_INFO("Could NOT create a Gregtech recipe handler.");
+ }
+ }
+
+ totalMods++;
+ }
+ if (Loader.isModLoaded("EnderIO") == true && !configSwitches.disableEnderIOIntegration){
+ EnderIO = true;
+ Utils.LOG_INFO("Components enabled for: EnderIO");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("BigReactors") == true){
+ Big_Reactors = true;
+ Utils.LOG_INFO("Components enabled for: Big Reactors");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("IC2") == true){
+ IndustrialCraft2 = true;
+ Utils.LOG_INFO("Components enabled for: IndustrialCraft2");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("simplyjetpacks") == true){
+ Simply_Jetpacks = true;
+ Utils.LOG_INFO("Components enabled for: Simply Jetpacks");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("rftools") == true){
+ RFTools = true;
+ Utils.LOG_INFO("Components enabled for: RFTools");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("Thaumcraft") == true){
+ Thaumcraft = true;
+ Utils.LOG_INFO("Components enabled for: Thaumcraft");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("ExtraUtilities") == true){
+ Extra_Utils = true;
+ Utils.LOG_INFO("Components enabled for: Extra_Utils");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("PneumaticCraft") == true){
+ PneumaticCraft = true;
+ Utils.LOG_INFO("Components enabled for: PneumaticCraft");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("MorePlanet") == true){
+ MorePlanets = true;
+ Utils.LOG_INFO("Components enabled for: MorePlanets");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("ForbiddenMagic") == true){
+ ForbiddenMagic = true;
+ Utils.LOG_INFO("Components enabled for: ForbiddenMagic");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("CompactWindmills") == true){
+ CompactWindmills = true;
+ Utils.LOG_INFO("Components enabled for: CompactWindmills");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("Railcraft") == true){
+ Railcraft = true;
+ Utils.LOG_INFO("Components enabled for: Railcraft");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("Growthcraft") == true){
+ Growthcraft = true;
+ Utils.LOG_INFO("Components enabled for: Growthcraft");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("CoFHCore") == true){
+ CoFHCore = true;
+ Utils.LOG_INFO("Components enabled for: CoFHCore");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("Forestry") == true){
+ Forestry = true;
+ Utils.LOG_INFO("Components enabled for: Forestry");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("MagicBees") == true){
+ MagicBees = true;
+ Utils.LOG_INFO("Components enabled for: MagicBees");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("psychedelicraft") == true){
+ Psychedelicraft = true;
+ Utils.LOG_INFO("Components enabled for: Psychedelicraft");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("ImmersiveEngineering") == true){
+ ImmersiveEngineering = true;
+ Utils.LOG_INFO("Components enabled for: ImmersiveEngineering");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("ExtraBees") == true){
+ ExtraBees = true;
+ Utils.LOG_INFO("Components enabled for: ExtraBees");
+ totalMods++;
+ }
+ if (Loader.isModLoaded("ThermalFoundation") == false){
+ ThermalFoundation = false;
+ Utils.LOG_INFO("Components enabled for: ThermalFoundation - This feature will disable itself if you add TF.");
+ totalMods++;
+ }
+ else if (Loader.isModLoaded("ThermalFoundation") == true){
+ ThermalFoundation = true;
+ Utils.LOG_INFO("Components disabled for: ThermalFoundation - This feature will enable itself if you remove TF.");
+ //totalMods++;
+ }
+ if (Loader.isModLoaded("ihl") == true){
+ IHL = true;
+ Utils.LOG_INFO("Components enabled for: IHL");
+ totalMods++;
+ }
+
+ Utils.LOG_INFO("Content found for "+totalMods+" mods");
+
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/lib/MaterialInfo.java b/src/Java/gtPlusPlus/core/lib/MaterialInfo.java
new file mode 100644
index 0000000000..5f80224bca
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/lib/MaterialInfo.java
@@ -0,0 +1,149 @@
+package gtPlusPlus.core.lib;
+
+import static gtPlusPlus.core.lib.CORE.noItem;
+import static gtPlusPlus.core.util.item.UtilsItems.getItemStackOfAmountFromOreDict;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.TextureSet;
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.core.util.materials.MaterialUtils;
+
+import java.util.List;
+
+import net.minecraft.item.ItemStack;
+
+public enum MaterialInfo {
+
+ ENERGYCRYSTAL(GTplusplus.randomDust_A, 8, GTplusplus.randomDust_B, 8, GTplusplus.randomDust_C, 8, GTplusplus.randomDust_D, 8, "dustEnergyCrystal", 1, noItem, 0),
+ BLOODSTEEL(noItem, 0, noItem, 0, noItem, 0, noItem, 0, noItem, 0, noItem, 0),
+ STABALLOY("dustTitanium", 1, "dustUranium", 8, noItem, 0, noItem, 0, "dustStaballoy", 1, noItem, 0),
+ TANTALLOY60("dustTungsten", 1, "dustTantalum", 8, "dustTinyTitanium", 5, noItem, 0, "dustTantalloy60", 1, noItem, 0),
+ TANTALLOY61("dustTungsten", 1, "dustSmallTitanium", 3, "dustSmallYttrium", 2, "dustTantalum", 9, "dustTantalloy61", 1, noItem, 0),
+ QUANTUM(noItem, 0, noItem, 0, noItem, 0, noItem, 0, noItem, 0, noItem, 0),
+ TUMBAGA("dustGold", 6, "dustCopper", 3, noItem, 0, noItem, 0, "dustTumbaga", 2, noItem, 0),
+ POTIN("dustBronze", 3, "dustTin", 2, "dustLead", 4, noItem, 0, "dustPotin", 3, noItem, 0),
+ BEDROCKIUM(noItem, 0, noItem, 0, noItem, 0, noItem, 0, noItem, 0, noItem, 0),
+ INCONEL625("dustNickel", 5, "dustChrome", 2, "dustWroughtIron", 1, "dustMolybdenum", 1, "dustInconel625", 4, "dustTinyDarkAsh", 1),
+ INCONEL690("dustNickel", 5, "dustChrome", 2, "dustNiobium", 1, "dustMolybdenum", 1, "dustInconel690", 2, "dustTinyDarkAsh", 1),
+ INCONEL792("dustNickel", 5, "dustChrome", 1, "dustAluminium", 2, "dustNiobium", 1, "dustInconel792", 2, "dustTinyDarkAsh", 1),
+ TUNGSTENCARBIDE("dustTungsten", 16, "dustCarbon", 16, noItem, 0, noItem, 0, "dustTungstenCarbide", 4, noItem, 0),
+ SILICONCARBIDE("dustSilicon", 16, "dustCarbon", 16, noItem, 0, noItem, 0, "dustSiliconCarbide", 4, noItem, 0),
+ ZERON100("dustChrome", 5, "dustSmallNickel", 6, "dustSmallMolybdenum", 3, "dustSteel", 14, "dustZeron100", 5, noItem, 0),
+ MARAGING250("dustSteel", 4, "dustNickel", 2, "dustCobalt", 1, "dustTinyTitanium", 1, "dustMaragingSteel250", 6, noItem, 0),
+ MARAGING300("dustSteel", 5, "dustNickel", 2, "dustCobalt", 2, "dustSmallTitanium", 1, "dustMaragingSteel300", 5, noItem, 0),
+ MARAGING350("dustSteel", 6, "dustNickel", 3, "dustCobalt", 3, "dustTitanium", 1, "dustMaragingSteel350", 4, noItem, 0),
+ STELLITE("dustCobalt", 4, "dustChrome", 4, "dustManganese", 2, "dustTitanium", 1, "dustStellite", 2, noItem, 0),
+ TALONITE("dustCobalt", 4, "dustChrome", 4, "dustPhosphorus", 1, "dustMolybdenum", 1, "dustTalonite", 2, noItem, 0),
+ HASTELLOY_W("dustSmallCobalt", 1, "dustSmallChrome", 4, "dustMolybdenum", 2, "dustNickel", 6, "dustHastelloyW", 2, noItem, 0),
+ HASTELLOY_X("dustTinyCobalt", 6, "dustChrome", 2, "dustMolybdenum", 1, "dustNickel", 5, "dustHastelloyX", 2, noItem, 0),
+ HASTELLOY_C276("dustSmallCobalt", 1, "dustSmallChrome", 14, "dustSmallMolybdenum", 14, "dustNickel", 5, "dustHastelloyC276", 2, noItem, 0),
+ INCOLOY020("dustIron", 4, "dustChrome", 2, "dustTinyCarbon", 2, "dustSmallCopper", 4, "dustIncoloy020", 1, noItem, 0),
+ INCOLOYDS("dustIron", 4, "dustChrome", 2, "dustTinyTitanium", 2, "dustSmallManganese", 1, "dustIncoloyDS", 1, noItem, 0),
+ INCOLOYMA956("dustIron", 6, "dustChrome", 2, "dustSmallAluminium", 5, "dustTinyYttrium", 1, "dustIncoloyMA956", 1, noItem, 0),
+ TANTALUMCARBIDE("dustTantalum", 4, "dustCarbon", 2, noItem, 0, noItem, 0, "dustTantalumCarbide", 1, noItem, 0),
+ ZIRCONIUM(noItem, 0, noItem, 0, noItem, 0, noItem, 0, "dustZirconium", 1, noItem, 0),
+ ZIRCONIUMCARBIDE("dustZirconium", 2, "dustCarbon", 2, noItem, 0, noItem, 0, "dustZirconiumCarbide", 1, noItem, 0),
+ NIOMBIUMCARBIDE("dustNiobium", 2, "dustCarbon", 2, noItem, 0, noItem, 0, "dustNiobiumCarbide", 1, noItem, 0),
+ HASTELLOY_N("dustIron", 1, "dustSmallChrome", 7, "dustSmallMolybdenum", 12, "dustNickel", 4, "dustHastelloyN", 1, noItem, 0);
+
+
+
+ private String input1;
+ private String input2;
+ private String input3;
+ private String input4;
+ private int inputAmount1;
+ private int inputAmount2;
+ private int inputAmount3;
+ private int inputAmount4;
+ private String out1;
+ private String out2;
+ private int outAmount1;
+ private int outAmount2;
+ public static List<String> nonLoadedInputs;
+ public final Materials materialGT;
+
+ private MaterialInfo (
+ String inputMaterial_1, int amountIn1,
+ String inputMaterial_2, int amountIn2,
+ String inputMaterial_3, int amountIn3,
+ String inputMaterial_4, int amountIn4,
+ String output_A,int amount1, String output_B, int amount2)
+ {
+ this.input1 = inputMaterial_1;
+ this.input2 = inputMaterial_2;
+ this.input3 = inputMaterial_3;
+ this.input4 = inputMaterial_4;
+ this.inputAmount1 = amountIn1;
+ this.inputAmount2 = amountIn2;
+ this.inputAmount3 = amountIn3;
+ this.inputAmount4 = amountIn4;
+ this.out1 = output_A;
+ this.out2 = output_B;
+ this.outAmount1 = amount1;
+ this.outAmount2 = amount2;
+
+
+
+ this.materialGT = MaterialUtils.addGtMaterial(
+ getMaterialName().toLowerCase(), TextureSet.SET_DULL, 2f, 512, 2,
+ 1 | 2 | 16 | 32 | 64 | 128,
+ 193, 211, 217, 0, getMaterialName(), 0, 0, 3015, 2150, true,
+ false, 1, 2, 1, Dyes.dyeWhite, 2, null, null);
+ }
+
+ public ItemStack[] getInputs() {
+ return new ItemStack[]{
+ getStack(input1, inputAmount1),
+ getStack(input2, inputAmount2),
+ getStack(input3, inputAmount3),
+ getStack(input4, inputAmount4)
+ };
+ }
+
+ public ItemStack[] getOutputs() {
+ return new ItemStack[]{
+ getStack(out1, outAmount1),
+ getStack(out2, outAmount2)
+ };
+ }
+
+ public String[] getInputItemsAsList(){
+ String[] inputArray = {
+ input1,
+ input2,
+ input3,
+ input4
+ };
+ return inputArray;
+ }
+
+ public int[] getInputStackSizesAsList(){
+ int[] inputArray = {
+ inputAmount1,
+ inputAmount2,
+ inputAmount3,
+ inputAmount4
+ };
+ return inputArray;
+ }
+
+ @SuppressWarnings("static-method")
+ public ItemStack getStack(String i, int r){
+ if (i == ""){
+ return null;
+ }
+ ItemStack temp = getItemStackOfAmountFromOreDict(i,r);
+ if (temp.getDisplayName().toLowerCase().contains("tell alkalus")){
+ //temp = null;
+ }
+ return temp;
+ }
+
+ public String getMaterialName(){
+ String x = this.name();
+ return x;
+ }
+
+
+}
diff --git a/src/Java/gtPlusPlus/core/proxy/ClientProxy.java b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java
new file mode 100644
index 0000000000..3019a71266
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/proxy/ClientProxy.java
@@ -0,0 +1,86 @@
+package gtPlusPlus.core.proxy;
+
+import gtPlusPlus.core.common.CommonProxy;
+import gtPlusPlus.core.util.particles.EntityParticleFXMysterious;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.particle.EntityFX;
+import net.minecraft.entity.Entity;
+import cpw.mods.fml.client.registry.RenderingRegistry;
+import cpw.mods.fml.common.event.FMLInitializationEvent;
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import cpw.mods.fml.common.event.FMLServerStartingEvent;
+
+public class ClientProxy extends CommonProxy{
+
+ @Override
+ public void preInit(FMLPreInitializationEvent e) {
+ // TODO Auto-generated method stub
+ super.preInit(e);
+ }
+
+ @Override
+ public void init(FMLInitializationEvent e) {
+ // TODO Auto-generated method stub
+ super.init(e);
+ }
+
+ @Override
+ public void postInit(FMLPostInitializationEvent e) {
+ // TODO Auto-generated method stub
+ super.postInit(e);
+ }
+
+ @Override
+ public void registerRenderThings(){
+ //RenderingRegistry.registerEntityRenderingHandler(EntityBloodSteelMob.class, new RenderBloodSteelMob(new ModelBloodSteelMob(), 0));
+ //RenderingRegistry.registerEntityRenderingHandler(EntityBloodSteelHostileMob.class, new RenderBloodSteelMobHostile(new ModelBloodSteelMob(), 0));
+ //RenderingRegistry.registerEntityRenderingHandler(EntityGrenade.class, new RenderSnowball(ModItems.tutGrenade));
+
+ //ClientRegistry.bindTileEntitySpecialRenderer(TileEntityBloodSteelChest.class, new BloodSteelChestRenderer());
+ //MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.tutChest), new ItemRenderBloodSteelChest());
+ }
+
+ @Override
+ public int addArmor(String armor){
+ return RenderingRegistry.addNewArmourRendererPrefix(armor);
+ }
+
+
+
+ @Override
+ public void generateMysteriousParticles(Entity theEntity)
+ {
+ double motionX = theEntity.worldObj.rand.nextGaussian() * 0.02D;
+ double motionY = theEntity.worldObj.rand.nextGaussian() * 0.02D;
+ double motionZ = theEntity.worldObj.rand.nextGaussian() * 0.02D;
+ EntityFX particleMysterious = new EntityParticleFXMysterious(
+
+ theEntity.worldObj,
+ theEntity.posX + theEntity.worldObj.rand.nextFloat() * theEntity.width
+
+ * 2.0F - theEntity.width,
+ theEntity.posY + 0.5D + theEntity.worldObj.rand.nextFloat()
+
+ * theEntity.height,
+ theEntity.posZ + theEntity.worldObj.rand.nextFloat() * theEntity.width
+
+ * 2.0F - theEntity.width,
+
+ motionX,
+
+ motionY,
+
+ motionZ);
+ Minecraft.getMinecraft().effectRenderer.addEffect(particleMysterious);
+ }
+
+ @Override
+ public void serverStarting(FMLServerStartingEvent e)
+ {
+
+ }
+
+
+
+}
diff --git a/src/Java/gtPlusPlus/core/proxy/ServerProxy.java b/src/Java/gtPlusPlus/core/proxy/ServerProxy.java
new file mode 100644
index 0000000000..1f912b9022
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/proxy/ServerProxy.java
@@ -0,0 +1,28 @@
+package gtPlusPlus.core.proxy;
+
+import gtPlusPlus.core.common.CommonProxy;
+import cpw.mods.fml.common.event.FMLInitializationEvent;
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+
+public class ServerProxy extends CommonProxy{
+
+ @Override
+ public void preInit(FMLPreInitializationEvent e) {
+ // TODO Auto-generated method stub
+ super.preInit(e);
+ }
+
+ @Override
+ public void init(FMLInitializationEvent e) {
+ // TODO Auto-generated method stub
+ super.init(e);
+ }
+
+ @Override
+ public void postInit(FMLPostInitializationEvent e) {
+ // TODO Auto-generated method stub
+ super.postInit(e);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java b/src/Java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java
new file mode 100644
index 0000000000..0f31c4c61d
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/recipe/Gregtech_Recipe_Adder.java
@@ -0,0 +1,98 @@
+package gtPlusPlus.core.recipe;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.util.GT_ModHandler;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+
+public class Gregtech_Recipe_Adder {
+
+ private static int euT;
+ private static int ticks;
+ private static ItemStack inputStack1;
+ private static ItemStack inputStack2;
+ private static ItemStack outputStack1;
+ private static ItemStack outputStack2;
+
+ public static void addRecipe(
+ Item maceratorInput, int maceratorInputAmount1,
+ Item maceratorOutput, int maceratorOutputAmount1,
+ Item compressorInput, int compressorInputAmount1,
+ Item compressorOutput, int compressorOutputAmount1,
+ Item blastFurnaceInput, int blastFurnaceInputAmount1,
+ Item blastFurnaceOutput, int blastFurnaceOutputAmount1,
+ Item blastFurnaceInput2, int blastFurnaceInputAmount2,
+ Item blastFurnaceOutput2, int blastFurnaceOutputAmount2,
+ Item smeltingInput, int smeltingInputAmount1,
+ Item smeltingOutput, int smeltingOutputAmount1,
+
+ int euPerTick, int timeInTicks,
+ boolean addMaceratorRecipe, boolean addCompressorRecipe, boolean addBlastFurnaceRecipe, int blastFurnaceTemp, boolean addSmeltingRecipe, boolean addMixerRecipe){
+ euT = euPerTick;
+ ticks = timeInTicks;
+
+ resetVars();
+ if (addMaceratorRecipe){
+ inputStack1 = UtilsItems.getSimpleStack(maceratorInput, maceratorInputAmount1);
+ outputStack1 = UtilsItems.getSimpleStack(maceratorOutput, maceratorOutputAmount1);
+ addMaceratorRecipe(inputStack1, outputStack1);
+ }
+ resetVars();
+ if (addCompressorRecipe){
+ inputStack1 = UtilsItems.getSimpleStack(compressorInput, compressorInputAmount1);
+ outputStack1 = UtilsItems.getSimpleStack(compressorOutput, compressorOutputAmount1);
+ addCompressorRecipe(inputStack1, outputStack1);
+ }
+ resetVars();
+ if (addBlastFurnaceRecipe){
+ inputStack1 = UtilsItems.getSimpleStack(blastFurnaceInput, blastFurnaceInputAmount1);
+ inputStack2 = UtilsItems.getSimpleStack(blastFurnaceInput2, blastFurnaceInputAmount2);
+ outputStack1 = UtilsItems.getSimpleStack(blastFurnaceOutput, blastFurnaceOutputAmount1);
+ outputStack2 = UtilsItems.getSimpleStack(blastFurnaceOutput2, blastFurnaceOutputAmount2);
+ addBlastFurnaceRecipe(inputStack1, inputStack2, outputStack1, outputStack2, blastFurnaceTemp);
+ }
+ resetVars();
+ if (addSmeltingRecipe){
+ inputStack1 = UtilsItems.getSimpleStack(smeltingInput, smeltingInputAmount1);
+ outputStack1 = UtilsItems.getSimpleStack(smeltingOutput, smeltingOutputAmount1);
+ addSmeltingRecipe(inputStack1, outputStack1);
+ }
+ resetVars();
+
+ }
+
+ private static void resetVars(){
+ inputStack1 = null;
+ inputStack2 = null;
+ outputStack1 = null;
+ outputStack2 = null;
+ }
+
+ private static void addMaceratorRecipe(ItemStack input1, ItemStack output1){
+ GT_ModHandler.addPulverisationRecipe(input1, output1);
+ }
+
+ private static void addCompressorRecipe(ItemStack input1, ItemStack output1){
+ GT_ModHandler.addCompressionRecipe(input1, output1);
+ }
+
+ private static void addBlastFurnaceRecipe(ItemStack input1, ItemStack input2, ItemStack output1, ItemStack output2, int tempRequired){
+ Utils.LOG_INFO("Registering Blast Furnace Recipes.");
+ GT_Values.RA.addBlastRecipe(
+ input1,
+ input2,
+ GT_Values.NF, GT_Values.NF,
+ output1,
+ output2,
+ ticks,
+ euT,
+ tempRequired);
+ }
+
+ private static void addSmeltingRecipe(ItemStack input1, ItemStack output1){
+ GT_ModHandler.addSmeltingRecipe(input1, output1);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
new file mode 100644
index 0000000000..addeb8b74a
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java
@@ -0,0 +1,233 @@
+package gtPlusPlus.core.recipe;
+
+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 gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.fluid.FluidUtils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import net.minecraft.item.ItemStack;
+
+public class RECIPES_GREGTECH {
+
+ public static void run(){
+ Utils.LOG_INFO("Loading Recipes through GregAPI for Industrial Multiblocks.");
+ execute();
+ }
+
+ private static void execute(){
+ cokeOvenRecipes();
+ matterFabRecipes();
+ assemblerRecipes();
+ distilleryRecipes();
+ extractorRecipes();
+ chemicalBathRecipes();
+ dehydratorRecipes();
+ addFuels();
+ }
+
+ private static void cokeOvenRecipes(){
+ Utils.LOG_INFO("Loading Recipes for Industrial Coking Oven.");
+
+ try {
+
+ //GT Logs to Charcoal Recipe
+ //With Sulfuric Acid
+ CORE.RA.addCokeOvenRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.log, Materials.Wood, 1L), //Input 1
+ GT_OreDictUnificator.get(OrePrefixes.log, Materials.Wood, 1L), //Input 2
+ Materials.SulfuricAcid.getFluid(20L), //Fluid Input
+ Materials.Creosote.getFluid(175L), //Fluid Output
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Charcoal, 2L), //Item Output
+ 800, //Time in ticks
+ 30); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+ try {
+
+ //Coal -> Coke Recipe
+ //With Sulfuric Acid
+ CORE.RA.addCokeOvenRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1L), //Input 1
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1L), //Input 2
+ Materials.SulfuricAcid.getFluid(60L), //Fluid Input
+ Materials.Creosote.getFluid(250L), //Fluid Output
+ UtilsItems.getItemStack("Railcraft:fuel.coke", 2), //Item Output
+ 600, //Time in ticks
+ 120); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+
+ try {
+ //GT Logs to Charcoal Recipe
+ //Without Sulfuric Acid
+ CORE.RA.addCokeOvenRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.log, Materials.Wood, 1L), //Input 1
+ GT_OreDictUnificator.get(OrePrefixes.log, Materials.Wood, 1L), //Input 2
+ FluidUtils.getFluidStack("oxygen", 80), //Fluid Input
+ Materials.Creosote.getFluid(145L), //Fluid Output
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Charcoal, 2L), //Item Output
+ 1200, //Time in ticks
+ 30); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+
+ try {
+ //Coal -> Coke Recipe
+ //Without Sulfuric Acid
+ CORE.RA.addCokeOvenRecipe(
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1L), //Input 1
+ GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1L), //Input 2
+ FluidUtils.getFluidStack("oxygen", 185), //Fluid Input
+ Materials.Creosote.getFluid(200L), //Fluid Output
+ UtilsItems.getItemStack("Railcraft:fuel.coke", 2), //Item Output
+ 900, //Time in ticks
+ 120); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+ }
+
+ private static void matterFabRecipes(){
+ Utils.LOG_INFO("Loading Recipes for Matter Fabricator.");
+
+ try {
+
+ CORE.RA.addMatterFabricatorRecipe(
+ Materials.UUAmplifier.getFluid(1L), //Fluid Input
+ Materials.UUMatter.getFluid(1L), //Fluid Output
+ 800, //Time in ticks
+ 32); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+ try {
+
+ CORE.RA.addMatterFabricatorRecipe(
+ null, //Fluid Input
+ Materials.UUMatter.getFluid(1L), //Fluid Output
+ 3200, //Time in ticks
+ 32); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+
+ }
+
+ private static void dehydratorRecipes(){
+ Utils.LOG_INFO("Loading Recipes for Chemical Dehydrator.");
+
+ try {
+
+ //Makes Lithium Carbonate
+ CORE.RA.addDehydratorRecipe(
+ FluidUtils.getFluidStack("sulfuriclithium", 1000), //Item input (slot 1)
+ null, //Fluid Input
+ new ItemStack[]{
+ UtilsItems.getItemStackOfAmountFromOreDict("dustSodium", 1),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustCarbon", 1),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustLithium", 1)
+ }, //Output Array of Items - Upto 9
+ 10*20, //Time in ticks
+ 30); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+ try {
+
+ CORE.RA.addDehydratorRecipe(
+ UtilsItems.getItemStackOfAmountFromOreDict("cellEmpty", 1), //Item input (slot 1)
+ FluidUtils.getFluidStack("sulfuriclithium", 1000), //Fluid Input
+ new ItemStack[]{
+ UtilsItems.getItemStackOfAmountFromOreDict("dustSodium", 1),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustCarbon", 1),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustLithium", 1)
+ }, //Output Array of Items - Upto 9
+ 10*20, //Time in ticks
+ 30); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+ try {
+ CORE.RA.addDehydratorRecipe(
+ UtilsItems.getItemStackOfAmountFromOreDict("cellEmpty", 1), //Item input (slot 1)
+ UtilsItems.getItemStackOfAmountFromOreDict("cellWater", 1), //Item input (slot 2)
+ new ItemStack[]{
+ UtilsItems.getItemStackOfAmountFromOreDict("dustSodium", 1),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustCarbon", 1),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustLithium", 1)
+ }, //Output Array of Items - Upto 9
+ 10*20, //Time in ticks
+ 30); //EU
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+ try {
+ CORE.RA.addDehydratorRecipe(
+ UtilsItems.getItemStackOfAmountFromOreDict("cellEmpty", 1),
+ null,
+ FluidUtils.getFluidStack("sulfuriclithium", 1000),
+ new ItemStack[]{
+ UtilsItems.getItemStackOfAmountFromOreDict("dustSodium", 1),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustCarbon", 1),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustLithium", 1)
+ }, //Output Array of Items - Upto 9
+ FluidUtils.getFluidStack("water", 1000),
+ 10*20, //Time in ticks
+ 30); //EU
+
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+
+ try {
+ CORE.RA.addDehydratorRecipe(
+ null, //Item input (slot 1)
+ null, //Item input (slot 2)
+ FluidUtils.getFluidStack("sulfuriclithium", 1000), //Fluid input (slot 1)
+ null, //Fluid output (slot 1)
+ new ItemStack[]{
+ UtilsItems.getItemStackOfAmountFromOreDict("dustSodium", 1),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustCarbon", 1),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustLithium", 1)
+ }, //Output Array of Items - Upto 9,
+ new int[]{0},
+ 10*20, //Time in ticks
+ 30); //EU
+
+ }catch (NullPointerException e){Utils.LOG_INFO("FAILED TO LOAD RECIPES - NULL POINTER SOMEWHERE");}
+ }
+
+ private static void assemblerRecipes(){
+ //GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Titanium, 6L), ItemList.Casing_Turbine.get(1L, new Object[0]), ItemList.Casing_Turbine2.get(1L, new Object[0]), 50, 16);
+ //GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.TungstenSteel, 6L), ItemList.Casing_Turbine.get(1L, new Object[0]), ItemList.Casing_Turbine3.get(1L, new Object[0]), 50, 16);
+
+ }
+
+ private static void distilleryRecipes(){
+ Utils.LOG_INFO("Registering Distillery/Distillation Tower Recipes.");
+ GT_Values.RA.addDistilleryRecipe(ItemList.Circuit_Integrated.getWithDamage(0L, 4L, new Object[0]), FluidUtils.getFluidStack("air", 1000), FluidUtils.getFluidStack("helium", 1), 400, 30, false);
+ GT_Values.RA.addDistillationTowerRecipe(FluidUtils.getFluidStack("air", 20000), FluidUtils.getFluidStackArray("helium", 25), UtilsItems.getSimpleStack(ModItems.itemHeliumBlob, 1), 200, 60);
+ }
+
+ private static void addFuels(){
+ Utils.LOG_INFO("Registering New Fuels.");
+ GT_Values.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketFire_water", 0, 1), null, 120, 0);
+ GT_Values.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketRocket_fuel", 0, 1), null, 112, 0);
+ GT_Values.RA.addFuel(UtilsItems.simpleMetaStack("EnderIO:bucketHootch", 0, 1), null, 36, 0);
+ //System.exit(1);
+ }
+
+ private static void extractorRecipes(){
+ Utils.LOG_INFO("Registering Extractor Recipes.");
+ GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Sodium.get(1L, new Object[0]), ItemList.Battery_Hull_HV.get(4L, new Object[0]));
+ GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Cadmium.get(1L, new Object[0]), ItemList.Battery_Hull_HV.get(4L, new Object[0]));
+ GT_ModHandler.addExtractionRecipe(GregtechItemList.Battery_RE_EV_Lithium.get(1L, new Object[0]), ItemList.Battery_Hull_HV.get(4L, new Object[0]));
+ }
+
+ private static void chemicalBathRecipes(){
+ int[] chances = {10000, 5000, 2500};
+ GT_Values.RA.addChemicalBathRecipe(UtilsItems.getItemStackOfAmountFromOreDict("dustTin", 12), FluidUtils.getFluidStack("chlorine", 2400),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustZirconium", 1),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustZirconium", 1),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustZirconium", 1),
+ chances,
+ 30*20,
+ 240);
+ }
+
+ private static void registerSkookumChoocher(){
+ //GT_ModHandler.addCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.toolHeadUniversalSpade, aMaterial, 1L), tBits, new Object[]{"fX", Character.valueOf('X'), OrePrefixes.toolHeadShovel.get(aMaterial)});
+ }
+
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java
new file mode 100644
index 0000000000..94a1d85ae3
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_LaserEngraver.java
@@ -0,0 +1,32 @@
+package gtPlusPlus.core.recipe;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OreDictNames;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.interfaces.IOreRecipeRegistrator;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import net.minecraft.item.ItemStack;
+
+public class RECIPES_LaserEngraver implements IOreRecipeRegistrator {
+ public RECIPES_LaserEngraver() {
+ OrePrefixes.crafting.add(this);
+ }
+
+ @Override
+ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+ if (aOreDictName.equals(OreDictNames.craftingLensBlue.toString())) {
+ GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.YttriumBariumCuprate, 2L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Circuit_Parts_Wiring_IV.get(1L, new Object[0]), 64, 480);
+ } else if (aOreDictName.equals(OreDictNames.craftingLensYellow.toString())) {
+ GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Osmium, 2L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Circuit_Parts_Wiring_LuV.get(1L, new Object[0]), 64, 1024);
+ } else if (aOreDictName.equals(OreDictNames.craftingLensCyan.toString())) {
+ } else if (aOreDictName.equals(OreDictNames.craftingLensRed.toString())) {
+ } else if (aOreDictName.equals(OreDictNames.craftingLensGreen.toString())) {
+ GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.foil, Materials.Naquadah, 2L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Circuit_Parts_Wiring_ZPM.get(1L, new Object[0]), 64, 2000);
+ } else if (aOreDictName.equals(OreDictNames.craftingLensWhite.toString())) {
+
+ }
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java
new file mode 100644
index 0000000000..6d81ba42ad
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_MTWRAPPER.java
@@ -0,0 +1,115 @@
+package gtPlusPlus.core.recipe;
+
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+import gtPlusPlus.core.util.wrapper.var;
+
+import java.util.ArrayList;
+
+import net.minecraft.item.ItemStack;
+
+public class RECIPES_MTWRAPPER {
+
+ public static int MT_RECIPES_LOADED = 0;
+ public static int MT_RECIPES_FAILED = 0;
+
+ static var chestWood = new var("minecraft:chest>");
+ static var slabWood = new var("ore:slabWood>");
+ static var gemNetherQuartz = new var("ore:gemNetherQuartz>");
+ static var glass = new var("ore:blockGlass>");
+ static var sensorDaylight = new var("minecraft:daylight_detector>");
+ static var blazeRod = new var("minecraft:blaze_rod>");
+ static var saw = new var("ore:craftingToolSaw>");
+ static var logWood = new var("ore:logWood>");
+ static var button = new var("minecraft:stone_button>");
+ static var stoneBlock = new var("minecraft:stone>");
+
+ public static void run(){
+ /*addShaped(button.getStack(2),
+ null, stoneBlock, null,
+ null, stoneBlock, null,
+ null, null, null);*/
+ /*addShaped(stoneStick.getStack(1),
+ stoneBlock, null, null,
+ stoneBlock, null, null,
+ null, null, null);*/
+ addShaped(chestWood.getStack(2),
+ logWood, logWood, logWood,
+ logWood, null, logWood,
+ logWood, logWood, logWood);
+ addShaped(chestWood.getStack(4),
+ logWood, logWood, logWood,
+ logWood, saw, logWood,
+ logWood, logWood, logWood);
+ //Recipe Fixes
+ //remove(sensorDaylight);
+ addShaped(sensorDaylight.getStack(1),
+ glass, glass, glass,
+ gemNetherQuartz, gemNetherQuartz, gemNetherQuartz,
+ slabWood, slabWood, slabWood);
+ /*addShaped(ironBars .getStack( 8),
+ null, "<ore:craftingToolWrench>", null,
+ "<ore:stickAnyIron>", "<ore:stickAnyIron>", "<ore:stickAnyIron>",
+ "<ore:stickAnyIron>", "<ore:stickAnyIron>", "<ore:stickAnyIron>");*/
+ }
+
+
+ public static void addShaped(Object item_Output,
+ Object item_1, Object item_2, Object item_3,
+ Object item_4, Object item_5, Object item_6,
+ Object item_7, Object item_8, Object item_9){
+
+
+ /*
+ *
+ * var item_1, var item_2, var item_3,
+ var item_4, var item_5, var item_6,
+ var item_7, var item_8, var item_9
+ *
+ *
+ */
+
+ ItemStack outputItem = UtilsItems.getCorrectStacktype(item_Output, 1);
+
+ ArrayList<Object> validSlots = new ArrayList<Object>();
+ String a,b,c,d,e,f,g,h,i;
+ if (item_1 == null){ a = " ";} else { a = "1";validSlots.add('1');validSlots.add(item_1);}
+ if (item_2 == null){ b = " ";} else { b = "2";validSlots.add('2');validSlots.add(item_2);}
+ if (item_3 == null){ c = " ";} else { c = "3";validSlots.add('3');validSlots.add(item_3);}
+ if (item_4 == null){ d = " ";} else { d = "4";validSlots.add('4');validSlots.add(item_4);}
+ if (item_5 == null){ e = " ";} else { e = "5";validSlots.add('5');validSlots.add(item_5);}
+ if (item_6 == null){ f = " ";} else { f = "6";validSlots.add('6');validSlots.add(item_6);}
+ if (item_7 == null){ g = " ";} else { g = "7";validSlots.add('7');validSlots.add(item_7);}
+ if (item_8 == null){ h = " ";} else { h = "8";validSlots.add('8');validSlots.add(item_8);}
+ if (item_9 == null){ i = " ";} else { i = "9";validSlots.add('9');validSlots.add(item_9);}
+
+ String lineOne = a+b+c;
+ String lineTwo = d+e+f;
+ String lineThree = g+h+i;
+ validSlots.add(0, lineOne);
+ validSlots.add(1, lineTwo);
+ validSlots.add(2, lineThree);
+
+ try {
+ UtilsRecipe.recipeBuilder((Object[]) validSlots.toArray(), outputItem.copy());
+ MT_RECIPES_LOADED++;
+ }
+ catch(NullPointerException | ClassCastException k){
+ k.getMessage();
+ k.getClass();
+ k.printStackTrace();
+ k.getLocalizedMessage();
+ Utils.LOG_WARNING("@@@: Invalid Recipe detected for: "+((var) item_Output).getsanitizedName());
+ MT_RECIPES_FAILED++;
+ }
+ }
+
+ public static void addShapeless(){
+
+ }
+
+
+
+}
+
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java
new file mode 100644
index 0000000000..f5e3fd1ad5
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_MachineComponents.java
@@ -0,0 +1,299 @@
+package gtPlusPlus.core.recipe;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+
+public class RECIPES_MachineComponents {
+
+ //Wire
+ static String wireTier6 = "wireGt08NiobiumTitanium";
+ static String wireTier7 = "wireGt08Osmium";
+ static String wireTier8 = "wireGt08Naquadah";
+ static String wireTier9 = "wireGt08Superconductor";
+ static String wireTier10 = "wireGt16Superconductor";
+
+ //Wire
+ static String cableTier6 = "cableGt04Tungsten";
+ static String cableTier7 = "cableGt04NiobiumTitanium";
+ static String cableTier8 = "cableGt04Osmium";
+ static String cableTier9 = "cableGt04Naquadah";
+ static String cableTier10 = "wireGt08Superconductor";
+
+ //Plates
+ static String plateTier7 = "plateChrome";
+ static String plateTier8 = "plateIridium";
+ static String plateTier9 = "plateOsmium";
+ static String plateTier10 = "plateNeutronium";
+
+ //rods
+ static String rodTier7a = "stickChrome";
+ static String rodTier8a = "stickIridium";
+ static String rodTier9a = "stickOsmium";
+ static String rodTier10a = "stickNeutronium";
+ static String rodTier7b = "stickPlatinum";
+ static String rodTier8b = "stickChrome";
+ static String rodTier9b = "stickIridium";
+ static String rodTier10b = "stickOsmium";
+ static String rodTier7c = "stickTitanium";
+ static String rodTier8c = "stickTungstenSteel";
+ static String rodTier9c = "stickNaquadah";
+ static String rodTier10c = "stickOsmium";
+
+ //Screws
+ static String screwTier7 = "screwChrome";
+ static String screwTier8 = "screwIridium";
+ static String screwTier9 = "screwOsmium";
+ static String screwTier10 = "screwNeutronium";
+
+ //Rotors
+ static String rotorTier7 = "rotorChrome";
+ static String rotorTier8 = "rotorIridium";
+ static String rotorTier9 = "rotorOsmium";
+ static String rotorTier10 = "rotorNeutronium";
+
+ //Fluid Pipe
+ static String pipeTier7 = "pipeHugeSteel";
+ static String pipeTier8 = "pipeHugeStainlessSteel";
+ static String pipeTier9 = "pipeHugeTitanium";
+ static String pipeTier10 = "pipeHugeTungstenSteel";
+
+ //Rubber Ring/Plate
+ static String itemRubberRing = "ringRubber";
+ static String plateRubber = "plateRubber";
+
+ //Circuits
+ static String circuitTier6 = "circuitMaster";
+ static String circuitTier7 = "circuitUltimate";
+ static String circuitTier8 = "circuitSymbiotic";
+ static String circuitTier9 = "circuitNeutronic";
+ static String circuitTier10 = "circuitQuantum";
+
+ //small gears
+ static String smallGearTier7 = "gearGtSmallChrome";
+ static String smallGearTier8 = "gearGtSmallIridium";
+ static String smallGearTier9 = "gearGtSmallOsmium";
+ static String smallGearTier10 = "gearGtSmallNeutronium";
+
+ //Crafting Tools
+ static String craftingToolWrench = "craftingToolWrench";
+ static String craftingToolScrewdriver = "craftingToolScrewdriver";
+
+ public static final void RECIPES_LOAD(){
+ Utils.LOG_INFO("Loading Recipes for the Various Circuits and Machine components.");
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ run();
+ }
+ GregtechMachinePhase();
+ }
+
+ private static void run(){
+ //Electric Motors
+ UtilsRecipe.addShapedGregtechRecipe(
+ cableTier7, wireTier7, rodTier7a,
+ wireTier7, rodTier7b, wireTier7,
+ rodTier7a, wireTier7, cableTier7,
+ RECIPE_CONSTANTS.electricMotor_LuV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ cableTier8, wireTier8, rodTier8a,
+ wireTier8, rodTier8b, wireTier8,
+ rodTier8a, wireTier8, cableTier8,
+ RECIPE_CONSTANTS.electricMotor_ZPM);
+ UtilsRecipe.addShapedGregtechRecipe(
+ cableTier9, wireTier9, rodTier9a,
+ wireTier9, rodTier9b, wireTier9,
+ rodTier9a, wireTier9, cableTier9,
+ RECIPE_CONSTANTS.electricMotor_UV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ cableTier10, wireTier10, rodTier10a,
+ wireTier10, rodTier10b, wireTier10,
+ rodTier10a, wireTier10, cableTier10,
+ RECIPE_CONSTANTS.electricMotor_MAX);
+
+ //Electric Pump
+ UtilsRecipe.addShapedGregtechRecipe(
+ cableTier7, rotorTier7, itemRubberRing,
+ craftingToolScrewdriver, pipeTier7, craftingToolWrench,
+ itemRubberRing, RECIPE_CONSTANTS.electricMotor_LuV, cableTier7,
+ RECIPE_CONSTANTS.electricPump_LuV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ cableTier8, rotorTier8, itemRubberRing,
+ craftingToolScrewdriver, pipeTier8, craftingToolWrench,
+ itemRubberRing, RECIPE_CONSTANTS.electricMotor_ZPM, cableTier8,
+ RECIPE_CONSTANTS.electricPump_ZPM);
+ UtilsRecipe.addShapedGregtechRecipe(
+ cableTier9, rotorTier9, itemRubberRing,
+ craftingToolScrewdriver, pipeTier9, craftingToolWrench,
+ itemRubberRing, RECIPE_CONSTANTS.electricMotor_UV, cableTier9,
+ RECIPE_CONSTANTS.electricPump_UV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ cableTier10, rotorTier10, itemRubberRing,
+ craftingToolScrewdriver, pipeTier10, craftingToolWrench,
+ itemRubberRing, RECIPE_CONSTANTS.electricMotor_MAX, cableTier10,
+ RECIPE_CONSTANTS.electricPump_MAX);
+
+ //Electric Pump
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier7, plateTier7, plateTier7,
+ cableTier7, rodTier7a, rodTier7a,
+ cableTier7, RECIPE_CONSTANTS.electricMotor_LuV, smallGearTier7,
+ RECIPE_CONSTANTS.electricPiston_LuV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier8, plateTier8, plateTier8,
+ cableTier8, rodTier8a, rodTier8a,
+ cableTier8, RECIPE_CONSTANTS.electricMotor_ZPM, smallGearTier8,
+ RECIPE_CONSTANTS.electricPiston_ZPM);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier9, plateTier9, plateTier9,
+ cableTier9, rodTier9a, rodTier9a,
+ cableTier9, RECIPE_CONSTANTS.electricMotor_UV, smallGearTier9,
+ RECIPE_CONSTANTS.electricPiston_UV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier10, plateTier10, plateTier10,
+ cableTier10, rodTier10a, rodTier10a,
+ cableTier10, RECIPE_CONSTANTS.electricMotor_MAX, smallGearTier10,
+ RECIPE_CONSTANTS.electricPiston_MAX);
+
+ //Robot Arms
+ UtilsRecipe.addShapedGregtechRecipe(
+ cableTier7, cableTier7, cableTier7,
+ RECIPE_CONSTANTS.electricMotor_LuV, rodTier7a, RECIPE_CONSTANTS.electricMotor_LuV,
+ RECIPE_CONSTANTS.electricPiston_LuV, circuitTier7, rodTier7a,
+ RECIPE_CONSTANTS.robotArm_LuV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ cableTier8, cableTier8, cableTier8,
+ RECIPE_CONSTANTS.electricMotor_ZPM, rodTier8a, RECIPE_CONSTANTS.electricMotor_ZPM,
+ RECIPE_CONSTANTS.electricPiston_ZPM, circuitTier8, rodTier8a,
+ RECIPE_CONSTANTS.robotArm_ZPM);
+ UtilsRecipe.addShapedGregtechRecipe(
+ cableTier9, cableTier9, cableTier9,
+ RECIPE_CONSTANTS.electricMotor_UV, rodTier9a, RECIPE_CONSTANTS.electricMotor_UV,
+ RECIPE_CONSTANTS.electricPiston_UV, circuitTier9, rodTier9a,
+ RECIPE_CONSTANTS.robotArm_UV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ cableTier10, cableTier10, cableTier10,
+ RECIPE_CONSTANTS.electricMotor_MAX, rodTier10a, RECIPE_CONSTANTS.electricMotor_MAX,
+ RECIPE_CONSTANTS.electricPiston_MAX, circuitTier10, rodTier10a,
+ RECIPE_CONSTANTS.robotArm_MAX);
+
+ //Conveyor Modules
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateRubber, plateRubber, plateRubber,
+ RECIPE_CONSTANTS.electricMotor_LuV, cableTier7, RECIPE_CONSTANTS.electricMotor_LuV,
+ plateRubber, plateRubber, plateRubber,
+ RECIPE_CONSTANTS.conveyorModule_LuV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateRubber, plateRubber, plateRubber,
+ RECIPE_CONSTANTS.electricMotor_ZPM, cableTier8, RECIPE_CONSTANTS.electricMotor_ZPM,
+ plateRubber, plateRubber, plateRubber,
+ RECIPE_CONSTANTS.conveyorModule_ZPM);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateRubber, plateRubber, plateRubber,
+ RECIPE_CONSTANTS.electricMotor_UV, cableTier9, RECIPE_CONSTANTS.electricMotor_UV,
+ plateRubber, plateRubber, plateRubber,
+ RECIPE_CONSTANTS.conveyorModule_UV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateRubber, plateRubber, plateRubber,
+ RECIPE_CONSTANTS.electricMotor_MAX, cableTier10, RECIPE_CONSTANTS.electricMotor_MAX,
+ plateRubber, plateRubber, plateRubber,
+ RECIPE_CONSTANTS.conveyorModule_MAX);
+
+ //Emitter Modules
+ UtilsRecipe.addShapedGregtechRecipe(
+ rodTier7c, rodTier7c, circuitTier7,
+ cableTier7, circuitTier6, rodTier7c,
+ circuitTier7, cableTier7, rodTier7c,
+ RECIPE_CONSTANTS.emitter_LuV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ rodTier8c, rodTier8c, circuitTier8,
+ cableTier8, circuitTier7, rodTier8c,
+ circuitTier8, cableTier8, rodTier8c,
+ RECIPE_CONSTANTS.emitter_ZPM);
+ UtilsRecipe.addShapedGregtechRecipe(
+ rodTier9c, rodTier9c, circuitTier9,
+ cableTier9, circuitTier8, rodTier9c,
+ circuitTier9, cableTier9, rodTier9c,
+ RECIPE_CONSTANTS.emitter_UV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ rodTier10c, rodTier10c, circuitTier10,
+ cableTier10, circuitTier9, rodTier10c,
+ circuitTier10, cableTier10, rodTier10c,
+ RECIPE_CONSTANTS.emitter_MAX);
+
+ //Field Generator Modules
+ UtilsRecipe.addShapedGregtechRecipe(
+ wireTier7, circuitTier7, wireTier7,
+ circuitTier7, circuitTier6, circuitTier7,
+ wireTier7, circuitTier7, wireTier7,
+ RECIPE_CONSTANTS.fieldGenerator_LuV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ wireTier8, circuitTier8, wireTier8,
+ circuitTier8, circuitTier7, circuitTier8,
+ wireTier8, circuitTier8, wireTier8,
+ RECIPE_CONSTANTS.fieldGenerator_ZPM);
+ UtilsRecipe.addShapedGregtechRecipe(
+ wireTier9, circuitTier9, wireTier9,
+ circuitTier9, circuitTier8, circuitTier9,
+ wireTier9, circuitTier9, wireTier9,
+ RECIPE_CONSTANTS.fieldGenerator_UV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ wireTier10, circuitTier10, wireTier10,
+ circuitTier10, circuitTier9, circuitTier10,
+ wireTier10, circuitTier10, wireTier10,
+ RECIPE_CONSTANTS.fieldGenerator_MAX);
+
+ //Sensor Modules
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier7, null, circuitTier6,
+ plateTier7, rodTier7c, null,
+ circuitTier7, plateTier7, plateTier7,
+ RECIPE_CONSTANTS.sensor_LuV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier8, null, circuitTier7,
+ plateTier8, rodTier8c, null,
+ circuitTier8, plateTier8, plateTier8,
+ RECIPE_CONSTANTS.sensor_ZPM);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier9, null, circuitTier8,
+ plateTier9, rodTier9c, null,
+ circuitTier9, plateTier9, plateTier9,
+ RECIPE_CONSTANTS.sensor_UV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier10, null, circuitTier9,
+ plateTier10, rodTier10c, null,
+ circuitTier10, plateTier10, plateTier10,
+ RECIPE_CONSTANTS.sensor_MAX);
+
+ Utils.LOG_INFO("Done loading recipes for the Various machine components.");
+
+ }
+
+ private static void GregtechMachinePhase(){
+ Utils.LOG_INFO("Adding Gregtech machine recipes for the circuits.");
+ GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 1L), GregtechItemList.Circuit_Parts_Wiring_IV.get(4L, new Object[0]), GregtechItemList.Circuit_Board_IV.get(1L, new Object[0]), 32, 256);
+ GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 1L), GregtechItemList.Circuit_Parts_Wiring_LuV.get(4L, new Object[0]), GregtechItemList.Circuit_Board_LuV.get(1L, new Object[0]), 64, 512);
+ GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 2L), GregtechItemList.Circuit_Parts_Wiring_ZPM.get(4L, new Object[0]), GregtechItemList.Circuit_Board_ZPM.get(1L, new Object[0]), 96, 1024);
+ GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L), GregtechItemList.Circuit_Parts_Crystal_Chip_IV.get(3L, new Object[0]), GregtechItemList.Circuit_Parts_IV.get(1L, new Object[0]), 32, 512);
+ GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L), GregtechItemList.Circuit_Parts_Crystal_Chip_LuV.get(3L, new Object[0]), GregtechItemList.Circuit_Parts_LuV.get(1L, new Object[0]), 64, 1024);
+ GT_Values.RA.addFormingPressRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Lazurite, 1L), GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM.get(3L, new Object[0]), GregtechItemList.Circuit_Parts_ZPM.get(1L, new Object[0]), 96, 2048);
+ GT_Values.RA.addForgeHammerRecipe(ItemList.Circuit_Master.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_Crystal_Chip_IV.get(5L, new Object[0]), 32, 256);
+ GT_Values.RA.addForgeHammerRecipe(GregtechItemList.Circuit_IV.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_Crystal_Chip_LuV.get(5L, new Object[0]), 64, 512);
+ GT_Values.RA.addForgeHammerRecipe(GregtechItemList.Circuit_LuV.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_Crystal_Chip_ZPM.get(5L, new Object[0]), 128, 1024);
+ for (Materials tMat : Materials.VALUES) {
+ if ((tMat.mStandardMoltenFluid != null) && (tMat.contains(SubTag.SOLDERING_MATERIAL))) {
+ int tMultiplier = tMat.contains(SubTag.SOLDERING_MATERIAL_GOOD) ? 1 : tMat.contains(SubTag.SOLDERING_MATERIAL_BAD) ? 4 : 2;
+ GT_Values.RA.addAssemblerRecipe(GregtechItemList.Circuit_Board_IV.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_IV.get(1L, new Object[0]), tMat.getMolten(144L * tMultiplier / 4L), GregtechItemList.Circuit_IV.get(1L, new Object[0]), 32, 512);
+ GT_Values.RA.addAssemblerRecipe(GregtechItemList.Circuit_Board_LuV.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_LuV.get(1L, new Object[0]), tMat.getMolten(144L * tMultiplier / 4L), GregtechItemList.Circuit_LuV.get(1L, new Object[0]), 64, 1024);
+ GT_Values.RA.addAssemblerRecipe(GregtechItemList.Circuit_Board_ZPM.get(1L, new Object[0]), GregtechItemList.Circuit_Parts_ZPM.get(1L, new Object[0]), tMat.getMolten(144L * tMultiplier / 4L), GregtechItemList.Circuit_ZPM.get(1L, new Object[0]), 96, 2048);
+
+ }
+ }
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java
new file mode 100644
index 0000000000..a0d244ea85
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Machines.java
@@ -0,0 +1,601 @@
+package gtPlusPlus.core.recipe;
+
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import net.minecraft.item.ItemStack;
+
+public class RECIPES_Machines {
+
+ //Outputs
+ //static ItemStack RECIPE_BufferCore_ULV = new ItemStack(GregtechEnergyBuffer.itemBufferCore);
+ static ItemStack RECIPE_SteamCondenser = GregtechItemList.Condensor_MAX.get(1);
+ static ItemStack RECIPE_IronBlastFurnace = GregtechItemList.Machine_Iron_BlastFurnace.get(1);
+ static ItemStack RECIPE_IronPlatedBricks = GregtechItemList.Casing_IronPlatedBricks.get(1);
+ static ItemStack RECIPE_Buffer_ULV = GregtechItemList.Energy_Buffer_1by1_ULV.get(1);
+ static ItemStack RECIPE_Buffer_LV = GregtechItemList.Energy_Buffer_1by1_LV.get(1);
+ static ItemStack RECIPE_Buffer_MV = GregtechItemList.Energy_Buffer_1by1_MV.get(1);
+ static ItemStack RECIPE_Buffer_HV = GregtechItemList.Energy_Buffer_1by1_HV.get(1);
+ static ItemStack RECIPE_Buffer_EV = GregtechItemList.Energy_Buffer_1by1_EV.get(1);
+ static ItemStack RECIPE_Buffer_IV = GregtechItemList.Energy_Buffer_1by1_IV.get(1);
+ static ItemStack RECIPE_Buffer_LuV = GregtechItemList.Energy_Buffer_1by1_LuV.get(1);
+ static ItemStack RECIPE_Buffer_ZPM = GregtechItemList.Energy_Buffer_1by1_ZPM.get(1);
+ static ItemStack RECIPE_Buffer_UV = GregtechItemList.Energy_Buffer_1by1_UV.get(1);
+ static ItemStack RECIPE_Buffer_MAX = GregtechItemList.Energy_Buffer_1by1_MAX.get(1);
+ //Industrial Centrifuge
+ static ItemStack RECIPE_IndustrialCentrifugeController = GregtechItemList.Industrial_Centrifuge.get(1);
+ static ItemStack RECIPE_IndustrialCentrifugeCasing = GregtechItemList.Casing_Centrifuge1.get(1);
+ //Industrial Coke Oven
+ static ItemStack RECIPE_IndustrialCokeOvenController = GregtechItemList.Industrial_CokeOven.get(1);
+ static ItemStack RECIPE_IndustrialCokeOvenFrame = GregtechItemList.Casing_CokeOven.get(1);
+ static ItemStack RECIPE_IndustrialCokeOvenCasingA = GregtechItemList.Casing_CokeOven_Coil1.get(1);
+ static ItemStack RECIPE_IndustrialCokeOvenCasingB = GregtechItemList.Casing_CokeOven_Coil2.get(1);
+ //
+ static ItemStack RECIPE_IndustrialElectrolyzerController = GregtechItemList.Industrial_Electrolyzer.get(1);
+ static ItemStack RECIPE_IndustrialElectrolyzerFrame = GregtechItemList.Casing_Electrolyzer.get(1);
+ //
+ static ItemStack RECIPE_IndustrialMaterialPressController = GregtechItemList.Industrial_PlatePress.get(1);
+ static ItemStack RECIPE_IndustrialMaterialPressFrame = GregtechItemList.Casing_MaterialPress.get(1);
+ //
+ static ItemStack RECIPE_IndustrialMacerationStackController = GregtechItemList.Industrial_MacerationStack.get(1);
+ static ItemStack RECIPE_IndustrialMacerationStackFrame = GregtechItemList.Casing_MacerationStack.get(1);
+ //
+ static ItemStack RECIPE_IndustrialWireFactoryController = GregtechItemList.Industrial_WireFactory.get(1);
+ static ItemStack RECIPE_IndustrialWireFactoryFrame = GregtechItemList.Casing_WireFactory.get(1);
+
+
+ //Buffer Cores
+ static ItemStack RECIPE_BufferCore_ULV = UtilsItems.getItemStack("miscutils:item.itemBufferCore1", 1);
+ static ItemStack RECIPE_BufferCore_LV = UtilsItems.getItemStack("miscutils:item.itemBufferCore2", 1);
+ static ItemStack RECIPE_BufferCore_MV = UtilsItems.getItemStack("miscutils:item.itemBufferCore3", 1);
+ static ItemStack RECIPE_BufferCore_HV = UtilsItems.getItemStack("miscutils:item.itemBufferCore4", 1);
+ static ItemStack RECIPE_BufferCore_EV = UtilsItems.getItemStack("miscutils:item.itemBufferCore5", 1);
+ static ItemStack RECIPE_BufferCore_IV = UtilsItems.getItemStack("miscutils:item.itemBufferCore6", 1);
+ static ItemStack RECIPE_BufferCore_LuV = UtilsItems.getItemStack("miscutils:item.itemBufferCore7", 1);
+ static ItemStack RECIPE_BufferCore_ZPM = UtilsItems.getItemStack("miscutils:item.itemBufferCore8", 1);
+ static ItemStack RECIPE_BufferCore_UV = UtilsItems.getItemStack("miscutils:item.itemBufferCore9", 1);
+ static ItemStack RECIPE_BufferCore_MAX = UtilsItems.getItemStack("miscutils:item.itemBufferCore10", 1);
+
+
+ //Wire
+ static String wireTier1 = "wireGt08Lead";
+ static String wireTier2 = "wireGt08Tin";
+ static String wireTier3 = "wireGt08Copper";
+ static String wireTier4 = "wireGt08Gold";
+ static String wireTier5 = "wireGt08Aluminium";
+ static String wireTier6 = "wireGt08Tungsten";
+ static String wireTier7 = "wireGt08Naquadah";
+ static String wireTier8 = "wireGt08Osmium";
+ static String wireTier9 = "wireGt08Superconductor";
+ static String wireTier10 = "wireGt16Superconductor";
+
+ //Wire
+ static String cableTier1 = "cableGt04Lead";
+ static String cableTier2 = "cableGt04Tin";
+ static String cableTier3 = "cableGt04Copper";
+ static String cableTier4 = "cableGt04Gold";
+ static String cableTier5 = "cableGt04Aluminium";
+ static String cableTier6 = "cableGt04Tungsten";
+ static String cableTier7 = "cableGt04Naquadah";
+ static String cableTier8 = "cableGt04Osmium";
+ static String cableTier9 = "cableGt04NiobiumTitanium";
+ static String cableTier10 = "cableGt08NiobiumTitanium";
+
+
+ //Plates
+ static String plateTier1 = "plateLead";
+ static String plateTier2 = "plateTin";
+ static String plateTier3 = "plateCopper";
+ static String plateTier4 = "plateGold";
+ static String plateTier5 = "plateAluminium";
+ static String plateTier6 = "plateMaragingSteel250";
+ static String plateTier7 = "plateTungsten";
+ static String plateTier8 = "plateTungstenSteel";
+ static String plateTier9 = "plateZeron100";
+ static String plateTier10 = "plateNaquadah";
+ static String plateTier11 = "plateNeutronium";
+
+ //rods
+ static String rodTier1 = "stickLead";
+ static String rodTier2 = "stickTin";
+ static String rodTier3 = "stickCopper";
+ static String rodTier4 = "stickGold";
+ static String rodTier5 = "stickAluminium";
+ static String rodTier6 = "stickMaragingSteel250";
+ static String rodTier7 = "stickTungsten";
+ static String rodTier8 = "stickTungstenSteel";
+ static String rodTier9 = "stickZeron100";
+ static String rodTier10 = "stickNaquadah";
+ static String rodTier11 = "stickNeutronium";
+
+
+ //Machine Casings
+ static ItemStack machineCasing_ULV;
+ static ItemStack machineCasing_LV;
+ static ItemStack machineCasing_MV;
+ static ItemStack machineCasing_HV;
+ static ItemStack machineCasing_EV;
+ static ItemStack machineCasing_IV;
+ static ItemStack machineCasing_LuV;
+ static ItemStack machineCasing_ZPM;
+ static ItemStack machineCasing_UV;
+ static ItemStack machineCasing_MAX;
+
+ //Gearbox Casings
+ static ItemStack gearboxCasing_Tier_1;
+ static ItemStack gearboxCasing_Tier_2;
+ static ItemStack gearboxCasing_Tier_3;
+ static ItemStack gearboxCasing_Tier_4;
+
+ //IV MACHINES
+ public static ItemStack IV_MACHINE_Electrolyzer;
+ public static ItemStack IV_MACHINE_Centrifuge;
+ public static ItemStack IV_MACHINE_BendingMachine;
+ public static ItemStack IV_MACHINE_Wiremill;
+ public static ItemStack IV_MACHINE_Macerator;
+ public static ItemStack IV_MACHINE_MassFabricator;
+
+
+ //Cables
+ static String cableGt02Electrum = "cableGt02Electrum";
+
+
+ //Plates
+ static String plateElectricalSteel= "plateElectricalSteel";
+ static String plateEnergeticAlloy= "plateEnergeticAlloy";
+ static String plateCobalt = "plateCobalt";
+ static String plateBronze = "plateBronze";
+ static String plateSteel = "plateSteel";
+
+ //Pipes
+ static String pipeLargeCopper="pipeLargeCopper";
+ static String pipeHugeSteel="pipeHugeSteel";
+ static String pipeHugeStainlessSteel="pipeHugeStainlessSteel";
+ static String pipeHugeTitanium="pipeHugeTitanium";
+
+ //Lava Boiler
+ static ItemStack boiler_Coal;
+ static ItemStack blockBricks = UtilsItems.getItemStack("minecraft:brick_block", 1);
+
+ //Batteries
+ static String batteryBasic = "batteryBasic";
+ static String batteryAdvanced = "batteryAdvanced";
+ static String batteryElite = "batteryElite";
+ static String batteryMaster = "batteryMaster";
+ static String batteryUltimate = "batteryUltimate";
+ static ItemStack IC2MFE;
+ static ItemStack IC2MFSU;
+
+ //Circuits
+ static String circuitPrimitive = "circuitBasic";
+ static String circuitTier1 = "circuitGood";
+ static String circuitTier2 = "circuitAdvanced";
+ static String circuitTier3 = "circuitData";
+ static String circuitTier4 = "circuitElite";
+ static String circuitTier5 = "circuitMaster";
+ static String circuitTier6 = "circuitUltimate";
+ static String circuitTier7 = "circuitSymbiotic";
+ static String circuitTier8 = "circuitNeutronic";
+ static String circuitTier9 = "circuitQuantum";
+
+ //Machine Components
+ static ItemStack electricMotor_LV;
+ static ItemStack electricMotor_MV;
+ static ItemStack electricMotor_HV;
+ static ItemStack electricMotor_EV;
+ static ItemStack electricMotor_IV;
+ static ItemStack electricPump_LV;
+ static ItemStack electricPump_MV;
+ static ItemStack electricPump_HV;
+ static ItemStack electricPump_EV;
+ static ItemStack electricPump_IV;
+ static ItemStack electricPiston_LV;
+ static ItemStack electricPiston_MV;
+ static ItemStack electricPiston_HV;
+ static ItemStack electricPiston_EV;
+ static ItemStack electricPiston_IV;
+ static ItemStack robotArm_LV;
+ static ItemStack robotArm_MV;
+ static ItemStack robotArm_HV;
+ static ItemStack robotArm_EV;
+ static ItemStack robotArm_IV;
+ static ItemStack conveyorModule_LV;
+ static ItemStack conveyorModule_MV;
+ static ItemStack conveyorModule_HV;
+ static ItemStack conveyorModule_EV;
+ static ItemStack conveyorModule_IV;
+ static ItemStack emitter_LV;
+ static ItemStack emitter_MV;
+ static ItemStack emitter_HV;
+ static ItemStack emitter_EV;
+ static ItemStack emitter_IV;
+ static ItemStack fieldGenerator_LV;
+ static ItemStack fieldGenerator_MV;
+ static ItemStack fieldGenerator_HV;
+ static ItemStack fieldGenerator_EV;
+ static ItemStack fieldGenerator_IV;
+ static ItemStack sensor_LV;
+ static ItemStack sensor_MV;
+ static ItemStack sensor_HV;
+ static ItemStack sensor_EV;
+ static ItemStack sensor_IV;
+
+ //Misc
+ static ItemStack INPUT_RCCokeOvenBlock;
+ static ItemStack INPUT_IECokeOvenBlock;
+
+
+
+ //RobotArm, Conveyor, Emitter, Sensor, Field Generator
+
+
+ public static final void RECIPES_LOAD(){
+ run();
+ Utils.LOG_INFO("Loading Recipes for the Various machine blocks.");
+ }
+
+ private static void run(){
+ initModItems();
+ }
+
+ private static void initModItems(){
+ if (LoadedMods.IndustrialCraft2){
+ IC2MFE = UtilsItems.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:blockElectric", "IC2_MFE", 1, 1);
+ IC2MFSU = UtilsItems.getItemStackWithMeta(LoadedMods.IndustrialCraft2, "IC2:blockElectric", "IC2_MFSU", 2, 1);
+ }
+ if (LoadedMods.Gregtech){
+ RECIPES_Shapeless.dustStaballoy = UtilsItems.getItemStackWithMeta(LoadedMods.MiscUtils, "gregtech:gt.metaitem.01", "Staballoy Dust", 2319, 2);
+ machineCasing_ULV = ItemList.Casing_ULV.get(1);
+ machineCasing_LV = ItemList.Casing_LV.get(1);
+ machineCasing_MV = ItemList.Casing_MV.get(1);
+ machineCasing_HV = ItemList.Casing_HV.get(1);
+ machineCasing_EV = ItemList.Casing_EV.get(1);
+ machineCasing_IV = ItemList.Casing_IV.get(1);
+ machineCasing_LuV = ItemList.Casing_LuV.get(1);
+ machineCasing_ZPM = ItemList.Casing_ZPM.get(1);
+ machineCasing_UV = ItemList.Casing_UV.get(1);
+ machineCasing_MAX = ItemList.Casing_MAX.get(1);
+
+ //Gearbox Casings
+ gearboxCasing_Tier_1 = ItemList.Casing_Gearbox_Bronze.get(1);
+ gearboxCasing_Tier_2 = ItemList.Casing_Gearbox_Steel.get(1);
+ gearboxCasing_Tier_3 = ItemList.Casing_Gearbox_Titanium.get(1);
+ gearboxCasing_Tier_4 = ItemList.Casing_Gearbox_TungstenSteel.get(1);
+
+ //Lava Boiler
+ boiler_Coal = ItemList.Machine_Bronze_Boiler.get(1);
+
+ //Machine Components
+ electricMotor_LV = ItemList.Electric_Motor_LV.get(1);
+ electricMotor_MV = ItemList.Electric_Motor_MV.get(1);
+ electricMotor_HV = ItemList.Electric_Motor_HV.get(1);
+ electricMotor_EV = ItemList.Electric_Motor_EV.get(1);
+ electricMotor_IV = ItemList.Electric_Motor_IV.get(1);
+ electricPump_LV = ItemList.Electric_Pump_LV.get(1);
+ electricPump_MV = ItemList.Electric_Pump_MV.get(1);
+ electricPump_HV = ItemList.Electric_Pump_HV.get(1);
+ electricPump_EV = ItemList.Electric_Pump_EV.get(1);
+ electricPump_IV = ItemList.Electric_Pump_IV.get(1);
+ electricPiston_LV = ItemList.Electric_Piston_LV.get(1);
+ electricPiston_MV = ItemList.Electric_Piston_MV.get(1);
+ electricPiston_HV = ItemList.Electric_Piston_HV.get(1);
+ electricPiston_EV = ItemList.Electric_Piston_EV.get(1);
+ electricPiston_IV = ItemList.Electric_Piston_IV.get(1);
+ robotArm_LV = ItemList.Robot_Arm_LV.get(1);
+ robotArm_MV = ItemList.Robot_Arm_MV.get(1);
+ robotArm_HV = ItemList.Robot_Arm_HV.get(1);
+ robotArm_EV = ItemList.Robot_Arm_EV.get(1);
+ robotArm_IV = ItemList.Robot_Arm_IV.get(1);
+ conveyorModule_LV = ItemList.Conveyor_Module_LV.get(1);
+ conveyorModule_MV = ItemList.Conveyor_Module_MV.get(1);
+ conveyorModule_HV = ItemList.Conveyor_Module_HV.get(1);
+ conveyorModule_EV = ItemList.Conveyor_Module_EV.get(1);
+ conveyorModule_IV = ItemList.Conveyor_Module_IV.get(1);
+ emitter_LV = ItemList.Emitter_LV.get(1);
+ emitter_MV = ItemList.Emitter_MV.get(1);
+ emitter_HV = ItemList.Emitter_HV.get(1);
+ emitter_EV = ItemList.Emitter_EV.get(1);
+ emitter_IV = ItemList.Emitter_IV.get(1);
+ fieldGenerator_LV = ItemList.Field_Generator_LV.get(1);
+ fieldGenerator_MV = ItemList.Field_Generator_MV.get(1);
+ fieldGenerator_HV = ItemList.Field_Generator_HV.get(1);
+ fieldGenerator_EV = ItemList.Field_Generator_EV.get(1);
+ fieldGenerator_IV = ItemList.Field_Generator_IV.get(1);
+ sensor_LV = ItemList.Sensor_LV.get(1);
+ sensor_MV = ItemList.Sensor_MV.get(1);
+ sensor_HV = ItemList.Sensor_HV.get(1);
+ sensor_EV = ItemList.Sensor_EV.get(1);
+ sensor_IV = ItemList.Sensor_IV.get(1);
+
+
+ //IV MACHINES
+ IV_MACHINE_Electrolyzer = ItemList.Machine_IV_Electrolyzer.get(1);
+ IV_MACHINE_BendingMachine= ItemList.Machine_IV_Bender.get(1);
+ IV_MACHINE_Wiremill= ItemList.Machine_IV_Wiremill.get(1);
+ IV_MACHINE_Macerator= ItemList.Machine_IV_Macerator.get(1);
+ IV_MACHINE_MassFabricator= ItemList.Machine_IV_Massfab.get(1);
+ IV_MACHINE_Centrifuge= ItemList.Machine_IV_Centrifuge.get(1);
+
+
+ }
+
+ if(LoadedMods.Railcraft){
+ //Misc
+ INPUT_RCCokeOvenBlock = UtilsItems.getItemStackWithMeta(LoadedMods.Railcraft, "Railcraft:machine.alpha", "Coke_Oven_RC", 7, 1);
+ }
+ if(LoadedMods.ImmersiveEngineering){
+ //Misc
+ INPUT_IECokeOvenBlock = UtilsItems.getItemStackWithMeta(LoadedMods.ImmersiveEngineering, "ImmersiveEngineering:stoneDecoration", "Coke_Oven_IE", 1, 1);
+ }
+ runModRecipes();
+ }
+
+ private static void runModRecipes(){
+ if (LoadedMods.Gregtech){
+
+ UtilsRecipe.addShapedGregtechRecipe(
+ ItemList.Electric_Piston_EV, GregtechOrePrefixes.circuit.get(Materials.Ultimate), ItemList.Electric_Piston_EV,
+ ItemList.Electric_Motor_EV, machineCasing_EV, ItemList.Electric_Motor_EV,
+ "gearGtTitanium", "cableGt02Aluminium", "gearGtTitanium",
+ UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 793, 1));
+ UtilsRecipe.addShapedGregtechRecipe(
+ ItemList.Electric_Piston_IV, GregtechOrePrefixes.circuit.get(GT_Materials.Symbiotic), ItemList.Electric_Piston_IV,
+ ItemList.Electric_Motor_IV, machineCasing_IV, ItemList.Electric_Motor_IV,
+ "gearGtTungstenSteel", "cableGt02Platinum", "gearGtTungstenSteel",
+ UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 794, 1));
+ UtilsRecipe.addShapedGregtechRecipe(
+ RECIPE_CONSTANTS.electricPiston_LuV, GregtechOrePrefixes.circuit.get(GT_Materials.Neutronic), RECIPE_CONSTANTS.electricPiston_LuV,
+ RECIPE_CONSTANTS.electricMotor_LuV, machineCasing_LuV, RECIPE_CONSTANTS.electricMotor_LuV,
+ "gearGtChrome", "cableGt02Tungsten", "gearGtChrome",
+ UtilsItems.simpleMetaStack("gregtech:gt.blockmachines", 795, 1));
+
+ //Buffer Core
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier1, cableTier1, plateTier1,
+ circuitPrimitive, IC2MFE, circuitPrimitive,
+ plateTier1, cableTier1, plateTier1,
+ RECIPE_BufferCore_ULV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier2, cableTier2, plateTier2,
+ circuitTier1, IC2MFE, circuitTier1,
+ plateTier2, cableTier2, plateTier2,
+ RECIPE_BufferCore_LV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier3, cableTier3, plateTier3,
+ RECIPE_BufferCore_LV, circuitTier2, RECIPE_BufferCore_LV,
+ plateTier3, cableTier3, plateTier3,
+ RECIPE_BufferCore_MV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier4, cableTier4, plateTier4,
+ RECIPE_BufferCore_MV, circuitTier3, RECIPE_BufferCore_MV,
+ plateTier4, cableTier4, plateTier4,
+ RECIPE_BufferCore_HV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier5, cableTier5, plateTier5,
+ RECIPE_BufferCore_HV, circuitTier4, RECIPE_BufferCore_HV,
+ plateTier5, cableTier5, plateTier5,
+ RECIPE_BufferCore_EV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier6, cableTier6, plateTier6,
+ RECIPE_BufferCore_EV, circuitTier5, RECIPE_BufferCore_EV,
+ plateTier6, cableTier6, plateTier6,
+ RECIPE_BufferCore_IV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier7, cableTier7, plateTier7,
+ RECIPE_BufferCore_IV, circuitTier6, RECIPE_BufferCore_IV,
+ plateTier7, cableTier7, plateTier7,
+ RECIPE_BufferCore_LuV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier8, cableTier8, plateTier8,
+ RECIPE_BufferCore_LuV, circuitTier7, RECIPE_BufferCore_LuV,
+ plateTier8, cableTier8, plateTier8,
+ RECIPE_BufferCore_ZPM);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier9, cableTier9, plateTier9,
+ RECIPE_BufferCore_ZPM, circuitTier8, RECIPE_BufferCore_ZPM,
+ plateTier9, cableTier9, plateTier9,
+ RECIPE_BufferCore_UV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier10, cableTier10, plateTier10,
+ RECIPE_BufferCore_UV, circuitTier9, RECIPE_BufferCore_UV,
+ plateTier10, cableTier10, plateTier10,
+ RECIPE_BufferCore_MAX);
+
+
+ UtilsRecipe.addShapedGregtechRecipe(
+ wireTier1, RECIPE_BufferCore_ULV, wireTier1,
+ wireTier1, machineCasing_ULV, wireTier1,
+ circuitPrimitive, circuitTier1, circuitPrimitive,
+ RECIPE_Buffer_ULV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ wireTier2, RECIPE_BufferCore_LV, wireTier2,
+ wireTier2, machineCasing_LV, wireTier2,
+ circuitTier1, RECIPE_BufferCore_LV, circuitTier1,
+ RECIPE_Buffer_LV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ wireTier3, RECIPE_BufferCore_MV, wireTier3,
+ wireTier3, machineCasing_MV, wireTier3,
+ circuitTier2, RECIPE_BufferCore_MV, circuitTier2,
+ RECIPE_Buffer_MV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ wireTier4, RECIPE_BufferCore_HV, wireTier4,
+ wireTier4, machineCasing_HV, wireTier4,
+ circuitTier3, RECIPE_BufferCore_HV, circuitTier3,
+ RECIPE_Buffer_HV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ wireTier5, RECIPE_BufferCore_EV, wireTier5,
+ wireTier5, machineCasing_EV, wireTier5,
+ circuitTier4, RECIPE_BufferCore_EV, circuitTier4,
+ RECIPE_Buffer_EV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ wireTier6, RECIPE_BufferCore_IV, wireTier6,
+ wireTier6, machineCasing_IV, wireTier6,
+ circuitTier5, RECIPE_BufferCore_IV, circuitTier5,
+ RECIPE_Buffer_IV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ wireTier7, RECIPE_BufferCore_LuV, wireTier7,
+ wireTier7, machineCasing_LuV, wireTier7,
+ circuitTier6, RECIPE_BufferCore_LuV, circuitTier6,
+ RECIPE_Buffer_LuV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ wireTier8, RECIPE_BufferCore_ZPM, wireTier8,
+ wireTier8, machineCasing_ZPM, wireTier8,
+ circuitTier7, RECIPE_BufferCore_ZPM, circuitTier7,
+ RECIPE_Buffer_ZPM);
+ UtilsRecipe.addShapedGregtechRecipe(
+ wireTier9, RECIPE_BufferCore_UV, wireTier9,
+ wireTier9, machineCasing_UV, wireTier9,
+ circuitTier8, RECIPE_BufferCore_UV, circuitTier8,
+ RECIPE_Buffer_UV);
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier11, RECIPE_BufferCore_MAX, plateTier11,
+ wireTier10, machineCasing_MAX, wireTier10,
+ circuitTier9, RECIPE_BufferCore_MAX, circuitTier9,
+ RECIPE_Buffer_MAX);
+
+ //Steam Condenser
+ UtilsRecipe.addShapedGregtechRecipe(
+ pipeLargeCopper, pipeHugeSteel, pipeLargeCopper,
+ plateEnergeticAlloy, electricPump_HV, plateEnergeticAlloy,
+ plateEnergeticAlloy, pipeLargeCopper, plateEnergeticAlloy,
+ RECIPE_SteamCondenser);
+
+ //Iron BF
+ UtilsRecipe.addShapedGregtechRecipe(
+ "plateDoubleAnyIron", "craftingFurnace", "plateDoubleAnyIron",
+ boiler_Coal, machineCasing_ULV, boiler_Coal,
+ "plateDoubleAnyIron", "bucketLava", "plateDoubleAnyIron",
+ RECIPE_IronBlastFurnace);
+ //Iron plated Bricks
+ UtilsRecipe.addShapedGregtechRecipe(
+ "plateAnyIron", RECIPES_Tools.craftingToolHardHammer, "plateAnyIron",
+ "plateAnyIron", blockBricks, "plateAnyIron",
+ "plateAnyIron", RECIPES_Tools.craftingToolWrench, "plateAnyIron",
+ RECIPE_IronPlatedBricks);
+
+ /*//Electrolyzer Frame Casing
+ UtilsRecipe.addShapedGregtechRecipe(
+ "platePotin", "stickLongChrome", "platePotin",
+ "stickLongPotin", "frameGtPotin", "stickLongPotin",
+ "platePotin", "stickLongPotin", "platePotin",
+ RECIPE_IndustrialCentrifugeCasing);
+ //Industrial Electrolyzer
+ UtilsRecipe.addShapedGregtechRecipe(
+ "plateStellite", circuitTier6, "plateStellite",
+ machineCasing_EV, IV_MACHINE_Electrolyzer, machineCasing_EV,
+ "plateStellite", "rotorStellite", "plateStellite",
+ RECIPE_IndustrialCentrifugeController);*/
+
+ //Industrial Centrifuge
+ UtilsRecipe.addShapedGregtechRecipe(
+ circuitTier6, pipeHugeStainlessSteel, circuitTier6,
+ plateTier6, IV_MACHINE_Centrifuge, plateTier6,
+ plateTier8, machineCasing_IV, plateTier8,
+ RECIPE_IndustrialCentrifugeController);
+ //Centrifuge Casing
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier6, "stickTumbaga", plateTier6,
+ plateTier8, "stickTumbaga", plateTier8,
+ plateTier6, "stickTumbaga", plateTier6,
+ RECIPE_IndustrialCentrifugeCasing);
+
+ if (LoadedMods.Railcraft){
+ //Industrial Coke Oven
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateCobalt, circuitTier4, plateCobalt,
+ machineCasing_HV, INPUT_RCCokeOvenBlock, machineCasing_HV,
+ plateCobalt, circuitTier5, plateCobalt,
+ RECIPE_IndustrialCokeOvenController);
+ }
+ if (LoadedMods.ImmersiveEngineering){
+ //Industrial Coke Oven
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateCobalt, circuitTier4, plateCobalt,
+ machineCasing_HV, INPUT_IECokeOvenBlock, machineCasing_HV,
+ plateCobalt, circuitTier5, plateCobalt,
+ RECIPE_IndustrialCokeOvenController);
+ }
+ //Coke Oven Frame Casing
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateTier8, rodTier8, plateTier8,
+ rodTier8, "frameGtTantalloy61", rodTier8,
+ plateTier8, rodTier8, plateTier8,
+ RECIPE_IndustrialCokeOvenFrame);
+ //Coke Oven Coil 1
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateBronze, plateBronze, plateBronze,
+ "frameGtBronze", gearboxCasing_Tier_1, "frameGtBronze",
+ plateBronze, plateBronze, plateBronze,
+ RECIPE_IndustrialCokeOvenCasingA);
+ //Coke Oven Coil 2
+ UtilsRecipe.addShapedGregtechRecipe(
+ plateSteel, plateSteel, plateSteel,
+ "frameGtSteel", gearboxCasing_Tier_2, "frameGtSteel",
+ plateSteel, plateSteel, plateSteel,
+ RECIPE_IndustrialCokeOvenCasingB);
+
+ //Electrolyzer Frame Casing
+ UtilsRecipe.addShapedGregtechRecipe(
+ "platePotin", "stickLongChrome", "platePotin",
+ "stickLongPotin", "frameGtPotin", "stickLongPotin",
+ "platePotin", "stickLongPotin", "platePotin",
+ RECIPE_IndustrialElectrolyzerFrame);
+ //Industrial Electrolyzer
+ UtilsRecipe.addShapedGregtechRecipe(
+ "plateStellite", circuitTier6, "plateStellite",
+ machineCasing_EV, IV_MACHINE_Electrolyzer, machineCasing_EV,
+ "plateStellite", "rotorStellite", "plateStellite",
+ RECIPE_IndustrialElectrolyzerController);
+
+ //Material Press Frame Casing
+ UtilsRecipe.addShapedGregtechRecipe(
+ "plateTitanium", "stickLongTumbaga", "plateTitanium",
+ "stickTantalloy60", "frameGtTumbaga", "stickTantalloy60",
+ "plateTitanium", "stickLongTumbaga", "plateTitanium",
+ RECIPE_IndustrialMaterialPressFrame);
+ //Industrial Material Press
+ UtilsRecipe.addShapedGregtechRecipe(
+ "plateTitanium", circuitTier5, "plateTitanium",
+ machineCasing_EV, IV_MACHINE_BendingMachine, machineCasing_EV,
+ "plateTitanium", circuitTier5, "plateTitanium",
+ RECIPE_IndustrialMaterialPressController);
+
+ //Maceration Frame Casing
+ UtilsRecipe.addShapedGregtechRecipe(
+ "platePalladium", "platePalladium", "platePalladium",
+ "stickPlatinum", "frameGtInconel625", "stickPlatinum",
+ "platePalladium", "stickLongPalladium", "platePalladium",
+ RECIPE_IndustrialMacerationStackFrame);
+ //Industrial Maceration stack
+ UtilsRecipe.addShapedGregtechRecipe(
+ "plateTungstenCarbide", IV_MACHINE_Macerator, "plateTungstenCarbide",
+ IV_MACHINE_Macerator, circuitTier8, IV_MACHINE_Macerator,
+ "plateTungstenCarbide", machineCasing_IV, "plateTungstenCarbide",
+ RECIPE_IndustrialMacerationStackController);
+
+ //Wire Factory Frame Casing
+ UtilsRecipe.addShapedGregtechRecipe(
+ "plateBlueSteel", "stickBlueSteel", "plateBlueSteel",
+ "stickBlueSteel", "frameGtBlueSteel", "stickBlueSteel",
+ "plateBlueSteel", "stickBlueSteel", "plateBlueSteel",
+ RECIPE_IndustrialWireFactoryFrame);
+ //Industrial Wire Factory
+ UtilsRecipe.addShapedGregtechRecipe(
+ "plateZeron100", machineCasing_IV, "plateZeron100",
+ circuitTier6, IV_MACHINE_Wiremill, circuitTier6,
+ "plateZeron100", machineCasing_IV, "plateZeron100",
+ RECIPE_IndustrialWireFactoryController);
+
+
+ }
+
+
+ Utils.LOG_INFO("Done loading recipes for the Various machine blocks.");
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java
new file mode 100644
index 0000000000..2a79aa92c9
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Shapeless.java
@@ -0,0 +1,46 @@
+package gtPlusPlus.core.recipe;
+
+import gregtech.api.enums.ItemList;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+import net.minecraft.item.ItemStack;
+
+public class RECIPES_Shapeless {
+
+ static ItemStack dustStaballoy;
+
+ //Circuits
+ static String circuitPrimitive = "circuitPrimitive";
+ static String circuitBasic = "circuitBasic";
+ static String circuitGood = "circuitGood";
+ static String circuitAdvanced = "circuitAdvanced";
+ static String circuitData = "circuitData";
+ static String circuitElite = "circuitElite";
+ static String circuitMaster = "circuitMaster";
+ static String circuitUltimate = "circuitUltimate";
+ static ItemStack gearboxCasing_Tier_1;
+
+ public static final void RECIPES_LOAD(){
+ //run();
+ Utils.LOG_INFO("Loading Shapeless Recipes.");
+ }
+
+ private static void run(){
+ //Gregtech items
+ if (LoadedMods.Gregtech){
+ gearboxCasing_Tier_1 = ItemList.Casing_Gearbox_Bronze.get(1);
+
+ UtilsRecipe.shapelessBuilder(dustStaballoy,
+ "dustTitanium", "dustUranium", "dustUranium",
+ "dustUranium", "dustUranium", "dustUranium",
+ "dustUranium", "dustUranium", "dustUranium");
+
+ UtilsRecipe.shapelessBuilder(gearboxCasing_Tier_1,
+ circuitPrimitive, circuitPrimitive, circuitPrimitive,
+ circuitPrimitive, circuitPrimitive, circuitPrimitive,
+ circuitPrimitive, circuitPrimitive, circuitPrimitive);
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java
new file mode 100644
index 0000000000..2f97d7e7ff
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Tools.java
@@ -0,0 +1,177 @@
+package gtPlusPlus.core.recipe;
+
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+import net.minecraft.block.Block;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.oredict.OreDictionary;
+
+public class RECIPES_Tools {
+
+ //Outputs
+ public static ItemStack RECIPE_StaballoyPickaxe = new ItemStack(ModItems.itemStaballoyPickaxe);
+ public static ItemStack RECIPE_StaballoyAxe = new ItemStack(ModItems.itemStaballoyAxe);
+ public static ItemStack RECIPE_SandstoneHammer = new ItemStack(ModItems.itemSandstoneHammer);
+ public static ItemStack RECIPE_StaballoyIngot = new ItemStack(ModItems.itemIngotStaballoy);
+ public static ItemStack RECIPE_SandStone = new ItemStack(Blocks.sandstone, 2);
+ public static ItemStack RECIPE_Sand = new ItemStack(Blocks.sand, 4);
+
+ public static ItemStack RECIPE_DivisionSigil;
+
+ //MC Items
+ public static Item Apple = Items.apple;
+
+ //MC Blocks
+ public static Block CobbleStone = Blocks.cobblestone;
+ public static Block Dirt = Blocks.dirt;
+ public static Block Sand = Blocks.sand;
+ public static Block Gravel = Blocks.gravel;
+ public static Block Sandstone = Blocks.sandstone;
+
+ //null
+ public static String empty = " ";
+
+ //Batteries
+ public static String batteryBasic = "batteryBasic";
+ public static String batteryAdvanced = "batteryAdvanced";
+ public static String batteryElite = "batteryElite";
+ public static String batteryMaster = "batteryMaster";
+ public static String batteryUltimate = "batteryUltimate";
+
+ //Circuits
+ public static String circuitPrimitive = "circuitPrimitive";
+ public static String circuitBasic = "circuitBasic";
+ public static String circuitGood = "circuitGood";
+ public static String circuitAdvanced = "circuitAdvanced";
+ public static String circuitElite = "circuitElite";
+ public static String circuitMaster = "circuitMaster";
+ public static String circuitUltimate = "circuitUltimate";
+
+ //Cables
+ public static String cableGt01Electrum = "cableGt01Electrum";
+ public static String cableGt02Electrum = "cableGt02Electrum";
+ public static String cableGt01RedstoneAlloy = "cableGt01RedstoneAlloy";
+ public static String cableGt02RedstoneAlloy = "cableGt02RedstoneAlloy";
+ public static String cableGt01Copper = "cableGt01Copper";
+ public static String cableGt02Copper = "cableGt02Copper";
+ public static String cableGt01AnnealedCopper = "cableGt01AnnealedCopper";
+ public static String cableGt02AnnealedCopper = "cableGt02AnnealedCopper";
+
+ //Rods
+ public static String stickStaballoy= "stickStaballoy";
+ public static String stickTitanium= "stickTitanium";
+ public static String stickIron= "stickIron";
+ public static String stickGold= "stickGold";
+ public static String stickSilver= "stickSilver";
+ public static String stickSteel= "stickSteel";
+ public static String stickBronze= "stickBronze";
+ public static String stickTungsten= "stickTungsten";
+ public static String stickRedAlloy= "stickRedAlloy";
+ public static String stickInvar= "stickInvar";
+ public static String stickElectrum= "stickElectrum";
+ public static String stickElectricalSteel= "stickElectricalSteel";
+
+ //Plates
+ public static String plateStaballoy= "plateStaballoy";
+ public static String plateTitanium= "plateTitanium";
+ public static String plateIron= "plateIron";
+ public static String plateGold= "plateGold";
+ public static String plateSilver= "plateSilver";
+ public static String plateSteel= "plateSteel";
+ public static String plateBronze= "plateBronze";
+ public static String plateTungsten= "plateTungsten";
+ public static String plateRedAlloy= "plateRedAlloy";
+ public static String plateInvar= "plateInvar";
+ public static String plateElectrum= "plateElectrum";
+ public static String plateElectricalSteel= "plateElectricalSteel";
+
+ //Ingots
+ public static String ingotStaballoy= "ingotStaballoy";
+ public static String ingotTitanium= "ingotTitanium";
+ public static String ingotIron= "ingotIron";
+ public static String ingotGold= "ingotGold";
+ public static String ingotSilver= "ingotSilver";
+ public static String ingotSteel= "ingotSteel";
+ public static String ingotBronze= "ingotBronze";
+ public static String ingotTungsten= "ingotTungsten";
+ public static String ingotRedAlloy= "ingotRedAlloy";
+ public static String ingotInvar= "ingotInvar";
+ public static String ingotElectrum= "ingotElectrum";
+ public static String ingotUranium= "ingotUranium";
+ public static String ingotElectricalSteel= "ingotElectricalSteel";
+
+ //Crafting Tools
+ public static String craftingToolHardHammer = "craftingToolHardHammer";
+ public static String craftingToolSoftHammer = "craftingToolSoftHammer";
+ public static String craftingToolFile = "craftingToolFile";
+ public static String craftingToolSaw = "craftingToolSaw";
+ public static String craftingToolPickaxe = "craftingToolPickaxe";
+ public static String craftingToolWrench = "craftingToolWrench";
+ public static String craftingToolCrowbar = "craftingToolCrowbar";
+ public static String craftingToolKnife = "craftingToolKnife";
+ public static String craftingToolScrewdriver = "craftingToolScrewdriver";
+
+ public static ItemStack sandHammer = new ItemStack (ModItems.itemSandstoneHammer, 1, OreDictionary.WILDCARD_VALUE);
+ public static String craftingToolSandHammer = "craftingToolSandHammer";
+
+ public static ItemStack personalCloakingDevice = UtilsItems.getSimpleStack(ModItems.itemPersonalCloakingDevice);
+ public static String plateDoubleNiChrome = "plateDoubleNichrome";
+ public static String plateIridiumAlloy = "plateAlloyIridium";
+
+ public static final void RECIPES_LOAD(){
+
+
+ run();
+
+ }
+
+ private static void run(){
+ //Staballoy Pickaxe
+ UtilsRecipe.recipeBuilder(
+ plateStaballoy, plateStaballoy, ingotStaballoy,
+ craftingToolFile, stickTungsten, craftingToolHardHammer,
+ craftingToolWrench, stickTungsten, craftingToolHardHammer,
+ RECIPE_StaballoyPickaxe);
+
+ //Staballoy Axe
+ UtilsRecipe.recipeBuilder(
+ plateStaballoy, ingotStaballoy, craftingToolHardHammer,
+ plateStaballoy, stickTungsten, craftingToolHardHammer,
+ craftingToolFile, stickTungsten, craftingToolWrench,
+ RECIPE_StaballoyAxe);
+
+ //Cobble to Sand
+ UtilsRecipe.recipeBuilder(
+ CobbleStone, CobbleStone, CobbleStone,
+ CobbleStone, sandHammer, CobbleStone,
+ CobbleStone, CobbleStone, CobbleStone,
+ RECIPE_Sand);
+
+ //Cloaking Device
+ UtilsRecipe.recipeBuilder(
+ plateDoubleNiChrome, plateIridiumAlloy, plateDoubleNiChrome,
+ plateIridiumAlloy, batteryUltimate, plateIridiumAlloy,
+ plateDoubleNiChrome, plateIridiumAlloy, plateDoubleNiChrome,
+ personalCloakingDevice);
+
+ //Sand to Sandstone
+ UtilsRecipe.recipeBuilder(
+ Sand, Sand, Sand,
+ Sand, sandHammer, Sand,
+ Sand, Sand, Sand,
+ RECIPE_SandStone);
+
+ //Sandstone Hammer
+ UtilsRecipe.recipeBuilder(
+ plateElectrum, ingotElectrum, plateElectrum,
+ craftingToolScrewdriver, stickBronze, craftingToolHardHammer,
+ null, stickSteel, null,
+ RECIPE_SandstoneHammer);
+
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPE_Batteries.java b/src/Java/gtPlusPlus/core/recipe/RECIPE_Batteries.java
new file mode 100644
index 0000000000..80ee79e292
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPE_Batteries.java
@@ -0,0 +1,49 @@
+package gtPlusPlus.core.recipe;
+
+import gregtech.api.enums.ItemList;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import net.minecraft.item.ItemStack;
+
+public class RECIPE_Batteries {
+
+ static ItemStack RECIPE_Battery_Sodium = GregtechItemList.Battery_RE_EV_Sodium.get(1);
+ static ItemStack RECIPE_Battery_Cadmium = GregtechItemList.Battery_RE_EV_Cadmium.get(1);
+ static ItemStack RECIPE_Battery_Lithium = GregtechItemList.Battery_RE_EV_Lithium.get(1);
+ static ItemStack GT_Battery_Sodium = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32539, 1);
+ static ItemStack GT_Battery_Cadmium = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32537, 1);
+ static ItemStack GT_Battery_Lithium = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32538, 1);
+ static ItemStack machineTransformer_EV;
+
+ public static void RECIPES_LOAD(){
+
+ if (LoadedMods.Gregtech){
+ machineTransformer_EV = ItemList.Transformer_EV_HV.get(1);
+ run();
+ }
+ }
+
+ private static void run(){
+
+
+ UtilsRecipe.addShapedGregtechRecipe(
+ GT_Battery_Sodium, RECIPES_Machines.cableTier4, GT_Battery_Sodium,
+ RECIPES_Machines.circuitTier3, machineTransformer_EV, RECIPES_Machines.circuitTier3,
+ GT_Battery_Sodium, RECIPES_Machines.cableTier4, GT_Battery_Sodium,
+ RECIPE_Battery_Sodium);
+ UtilsRecipe.addShapedGregtechRecipe(
+ GT_Battery_Cadmium, RECIPES_Machines.cableTier4, GT_Battery_Cadmium,
+ RECIPES_Machines.circuitTier3, machineTransformer_EV, RECIPES_Machines.circuitTier3,
+ GT_Battery_Cadmium, RECIPES_Machines.cableTier4, GT_Battery_Cadmium,
+ RECIPE_Battery_Cadmium);
+ UtilsRecipe.addShapedGregtechRecipe(
+ GT_Battery_Lithium, RECIPES_Machines.cableTier4, GT_Battery_Lithium,
+ RECIPES_Machines.circuitTier3, machineTransformer_EV, RECIPES_Machines.circuitTier3,
+ GT_Battery_Lithium, RECIPES_Machines.cableTier4, GT_Battery_Lithium,
+ RECIPE_Battery_Lithium);
+
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPE_CONSTANTS.java b/src/Java/gtPlusPlus/core/recipe/RECIPE_CONSTANTS.java
new file mode 100644
index 0000000000..df945bf9ec
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPE_CONSTANTS.java
@@ -0,0 +1,116 @@
+package gtPlusPlus.core.recipe;
+
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import net.minecraft.item.ItemStack;
+
+public class RECIPE_CONSTANTS {
+
+ //Machine Components
+ public static ItemStack electricMotor_LuV;
+ public static ItemStack electricMotor_ZPM;
+ public static ItemStack electricMotor_UV;
+ public static ItemStack electricMotor_MAX;
+ public static ItemStack electricPump_LuV;
+ public static ItemStack electricPump_ZPM;
+ public static ItemStack electricPump_UV;
+ public static ItemStack electricPump_MAX;
+ public static ItemStack electricPiston_LuV;
+ public static ItemStack electricPiston_ZPM;
+ public static ItemStack electricPiston_UV ;
+ public static ItemStack electricPiston_MAX;
+ public static ItemStack robotArm_LuV;
+ public static ItemStack robotArm_ZPM;
+ public static ItemStack robotArm_UV;
+ public static ItemStack robotArm_MAX;
+ public static ItemStack conveyorModule_LuV;
+ public static ItemStack conveyorModule_ZPM;
+ public static ItemStack conveyorModule_UV;
+ public static ItemStack conveyorModule_MAX;
+ public static ItemStack emitter_LuV;
+ public static ItemStack emitter_ZPM;
+ public static ItemStack emitter_UV;
+ public static ItemStack emitter_MAX;
+ public static ItemStack fieldGenerator_LuV;
+ public static ItemStack fieldGenerator_ZPM;
+ public static ItemStack fieldGenerator_UV;
+ public static ItemStack fieldGenerator_MAX;
+ public static ItemStack sensor_LuV;
+ public static ItemStack sensor_ZPM;
+ public static ItemStack sensor_UV;
+ public static ItemStack sensor_MAX;
+
+ public static void initialise(){
+ if(CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ registerGTExperimentalComponents();
+ }
+ else {
+ registerGTStandardComponents();
+ }
+ }
+
+ private static void registerGTExperimentalComponents(){
+ //Machine Components
+ electricMotor_LuV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32606, 1);
+ electricMotor_ZPM = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32607, 1);
+ electricMotor_UV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32608, 1);
+ electricPump_LuV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32620, 1);
+ electricPump_ZPM = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32621, 1);
+ electricPump_UV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32622, 1);
+ electricPiston_LuV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32645, 1);
+ electricPiston_ZPM = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32646, 1);
+ electricPiston_UV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32647, 1);
+ robotArm_LuV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32655, 1);
+ robotArm_ZPM = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32656, 1);
+ robotArm_UV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32657, 1);
+ conveyorModule_LuV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32636, 1);
+ conveyorModule_ZPM = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32637, 1);
+ conveyorModule_UV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32638, 1);
+ emitter_LuV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32685, 1);
+ emitter_ZPM = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32686, 1);
+ emitter_UV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32687, 1);
+ fieldGenerator_LuV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32675, 1);
+ fieldGenerator_ZPM = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32676, 1);
+ fieldGenerator_UV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32677, 1);
+ sensor_LuV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32695, 1);
+ sensor_ZPM = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32696, 1);
+ sensor_UV = UtilsItems.simpleMetaStack("gregtech:gt.metaitem.01", 32697, 1);
+ }
+
+ private static void registerGTStandardComponents(){
+ electricMotor_LuV = GregtechItemList.Electric_Motor_LuV.get(1);
+ electricMotor_ZPM = GregtechItemList.Electric_Motor_ZPM.get(1);
+ electricMotor_UV = GregtechItemList.Electric_Motor_UV.get(1);
+ electricMotor_MAX = GregtechItemList.Electric_Motor_MAX.get(1);
+ electricPump_LuV = GregtechItemList.Electric_Pump_LuV.get(1);
+ electricPump_ZPM = GregtechItemList.Electric_Pump_ZPM.get(1);
+ electricPump_UV = GregtechItemList.Electric_Pump_UV.get(1);
+ electricPump_MAX = GregtechItemList.Electric_Pump_MAX.get(1);
+ electricPiston_LuV = GregtechItemList.Electric_Piston_LuV.get(1);
+ electricPiston_ZPM = GregtechItemList.Electric_Piston_ZPM.get(1);
+ electricPiston_UV = GregtechItemList.Electric_Piston_UV.get(1);
+ electricPiston_MAX = GregtechItemList.Electric_Piston_MAX.get(1);
+ robotArm_LuV = GregtechItemList.Robot_Arm_LuV.get(1);
+ robotArm_ZPM = GregtechItemList.Robot_Arm_ZPM.get(1);
+ robotArm_UV = GregtechItemList.Robot_Arm_UV.get(1);
+ robotArm_MAX = GregtechItemList.Robot_Arm_MAX.get(1);
+ conveyorModule_LuV = GregtechItemList.Conveyor_Module_LuV.get(1);
+ conveyorModule_ZPM = GregtechItemList.Conveyor_Module_ZPM.get(1);
+ conveyorModule_UV = GregtechItemList.Conveyor_Module_UV.get(1);
+ conveyorModule_MAX = GregtechItemList.Conveyor_Module_MAX.get(1);
+ emitter_LuV = GregtechItemList.Emitter_LuV.get(1);
+ emitter_ZPM = GregtechItemList.Emitter_ZPM.get(1);
+ emitter_UV = GregtechItemList.Emitter_UV.get(1);
+ emitter_MAX = GregtechItemList.Emitter_MAX.get(1);
+ fieldGenerator_LuV = GregtechItemList.Field_Generator_LuV.get(1);
+ fieldGenerator_ZPM = GregtechItemList.Field_Generator_ZPM.get(1);
+ fieldGenerator_UV = GregtechItemList.Field_Generator_UV.get(1);
+ fieldGenerator_MAX = GregtechItemList.Field_Generator_MAX.get(1);
+ sensor_LuV = GregtechItemList.Sensor_LuV.get(1);
+ sensor_ZPM = GregtechItemList.Sensor_ZPM.get(1);
+ sensor_UV = GregtechItemList.Sensor_UV.get(1);
+ sensor_MAX = GregtechItemList.Sensor_MAX.get(1);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/recipe/ShapedRecipeObject.java b/src/Java/gtPlusPlus/core/recipe/ShapedRecipeObject.java
new file mode 100644
index 0000000000..c6dc1ede1b
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/recipe/ShapedRecipeObject.java
@@ -0,0 +1,42 @@
+package gtPlusPlus.core.recipe;
+
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+import net.minecraft.item.ItemStack;
+
+public class ShapedRecipeObject {
+
+ public Object object_A;
+ public Object object_B;
+ public Object object_C;
+ public Object object_D;
+ public Object object_E;
+ public Object object_F;
+ public Object object_G;
+ public Object object_H;
+ public Object object_I;
+ public ItemStack object_OUTPUT;
+
+ public ShapedRecipeObject(
+ Object input_A,Object input_B,Object input_C,
+ Object input_D,Object input_E,Object input_F,
+ Object input_G,Object input_H,Object input_I,
+ ItemStack input_Output){
+ this.object_A = input_A;
+ this.object_B = input_B;
+ this.object_C = input_C;
+ this.object_D = input_D;
+ this.object_E = input_E;
+ this.object_F = input_F;
+ this.object_G = input_G;
+ this.object_H = input_H;
+ this.object_I = input_I;
+ this.object_OUTPUT = input_Output;
+ Utils.LOG_SPECIFIC_WARNING("ShapedRecipeObject", "New object created.", 36);
+ }
+
+ public void buildRecipe(){
+ UtilsRecipe.recipeBuilder(object_A, object_B, object_C, object_D, object_E, object_F, object_G, object_H, object_I, object_OUTPUT);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotFrame.java b/src/Java/gtPlusPlus/core/slots/SlotFrame.java
new file mode 100644
index 0000000000..13bc8fa717
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/slots/SlotFrame.java
@@ -0,0 +1,25 @@
+package gtPlusPlus.core.slots;
+
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import forestry.api.apiculture.IHiveFrame;
+
+public class SlotFrame extends Slot{
+
+ public SlotFrame(IInventory inventory, int x, int y, int z) {
+ super(inventory, x, y, z);
+
+ }
+
+ @Override
+ public boolean isItemValid(ItemStack itemstack) {
+ return itemstack.getItem() instanceof IHiveFrame;
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/slots/SlotItemBackpackInv.java b/src/Java/gtPlusPlus/core/slots/SlotItemBackpackInv.java
new file mode 100644
index 0000000000..7a22086949
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/slots/SlotItemBackpackInv.java
@@ -0,0 +1,28 @@
+package gtPlusPlus.core.slots;
+
+import gtPlusPlus.core.item.base.BaseItemBackpack;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class SlotItemBackpackInv extends Slot
+{
+ public SlotItemBackpackInv(IInventory inv, int index, int xPos, int yPos)
+ {
+ super(inv, index, xPos, yPos);
+ }
+
+ // This is the only method we need to override so that
+ // we can't place our inventory-storing Item within
+ // its own inventory (thus making it permanently inaccessible)
+ // as well as preventing abuse of storing backpacks within backpacks
+ /**
+ * Check if the stack is a valid item for this slot.
+ */
+ @Override
+ public boolean isItemValid(ItemStack itemstack)
+ {
+ // Everything returns true except an instance of our Item
+ return !(itemstack.getItem() instanceof BaseItemBackpack);
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/slots/SlotRTG.java b/src/Java/gtPlusPlus/core/slots/SlotRTG.java
new file mode 100644
index 0000000000..1f16463de2
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/slots/SlotRTG.java
@@ -0,0 +1,25 @@
+package gtPlusPlus.core.slots;
+
+import ic2.core.Ic2Items;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class SlotRTG extends Slot{
+
+ public SlotRTG(IInventory inventory, int x, int y, int z) {
+ super(inventory, x, y, z);
+
+ }
+
+ @Override
+ public boolean isItemValid(ItemStack itemstack) {
+ return itemstack.getItem().getClass() == Ic2Items.RTGPellets.getItem().getClass();
+ }
+
+ @Override
+ public int getSlotStackLimit() {
+ return 1;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java b/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java
new file mode 100644
index 0000000000..246c7ff285
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/tileentities/ModTileEntities.java
@@ -0,0 +1,17 @@
+package gtPlusPlus.core.tileentities;
+
+import gtPlusPlus.core.util.Utils;
+
+public class ModTileEntities {
+
+
+ public static void init(){
+ Utils.LOG_INFO("Registering Tile Entities.");
+ //GameRegistry.registerTileEntity(TileEntityReverter.class, "TE_blockGriefSaver");
+ //GameRegistry.registerTileEntity(TileEntityReverter.class, "Tower Reverter");
+ //GameRegistry.registerTileEntity(TileEntityNHG.class, "NuclearFueledHeliumGenerator");
+ //GameRegistry.registerTileEntity(TileEntityCharger.class, "TE_Charger");
+ // GameRegistry.registerTileEntity(TileEntityHeliumGenerator.class, "Helium");
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/tileentities/base/TILE_ENTITY_BASE.java b/src/Java/gtPlusPlus/core/tileentities/base/TILE_ENTITY_BASE.java
new file mode 100644
index 0000000000..67c592c79c
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/tileentities/base/TILE_ENTITY_BASE.java
@@ -0,0 +1,39 @@
+package gtPlusPlus.core.tileentities.base;
+
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.network.NetworkManager;
+import net.minecraft.network.Packet;
+import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
+import net.minecraft.tileentity.TileEntity;
+
+public class TILE_ENTITY_BASE extends TileEntity {
+
+ @Override
+ public void writeToNBT(NBTTagCompound tag) {
+ super.writeToNBT(tag);
+ writeCustomNBT(tag);
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound tag) {
+ super.readFromNBT(tag);
+ readCustomNBT(tag);
+ }
+
+ public void writeCustomNBT(NBTTagCompound tag) {}
+ public void readCustomNBT(NBTTagCompound tag) {}
+
+ @Override
+ public Packet getDescriptionPacket() {
+ NBTTagCompound tag = new NBTTagCompound();
+ writeCustomNBT(tag);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, tag);
+ }
+
+ @Override
+ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) {
+ super.onDataPacket(net, packet);
+ readCustomNBT(packet.func_148857_g());
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java
new file mode 100644
index 0000000000..8767b6607c
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/tileentities/general/TileEntityReverter.java
@@ -0,0 +1,310 @@
+package gtPlusPlus.core.tileentities.general;
+
+import gtPlusPlus.core.block.ModBlocks;
+
+import java.util.Random;
+
+import net.minecraft.block.Block;
+import net.minecraft.init.Blocks;
+import net.minecraft.tileentity.TileEntity;
+
+
+
+public class TileEntityReverter extends TileEntity
+{
+ private static final int REVERT_CHANCE = 10;
+ public int radius = 16;
+ public int diameter = 8 * this.radius + 4;
+ public double requiredPlayerRange = 64.0D;
+ public Random rand = new Random();
+ private int tickCount;
+ private boolean slowScan;
+ private int ticksSinceChange;
+ private Block[] blockData;
+ private byte[] metaData;
+
+ public boolean canUpdate(){
+ return true;
+ }
+
+ public void updateEntity()
+ {
+ if (anyPlayerInRange())
+ {
+ this.tickCount += 1;
+ if (this.worldObj.isRemote)
+ {
+ double var1 = this.xCoord + this.worldObj.rand.nextFloat();
+ double var3 = this.yCoord + this.worldObj.rand.nextFloat();
+ double var5 = this.zCoord + this.worldObj.rand.nextFloat();
+
+ this.worldObj.spawnParticle("enchantmenttable", var1, var3, var5, 0.0D, 0.0D, 0.0D);
+ if (this.rand.nextInt(5) == 0)
+ {
+ makeRandomOutline();
+ makeRandomOutline();
+ makeRandomOutline();
+ }
+ }
+ else
+ {
+ if ((this.blockData == null) || (this.metaData == null))
+ {
+ captureBlockData();
+ this.slowScan = true;
+ }
+ if ((!this.slowScan) || (this.tickCount % 20 == 0)) {
+ if (scanAndRevertChanges())
+ {
+ this.slowScan = false;
+ this.ticksSinceChange = 0;
+ }
+ else
+ {
+ this.ticksSinceChange += 1;
+ if (this.ticksSinceChange > 20) {
+ this.slowScan = true;
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ this.blockData = null;
+ this.metaData = null;
+
+ this.tickCount = 0;
+ }
+ }
+
+ private void makeRandomOutline()
+ {
+ makeOutline(this.rand.nextInt(12));
+ }
+
+ private void makeOutline(int outline)
+ {
+ double sx = this.xCoord;
+ double sy = this.yCoord;
+ double sz = this.zCoord;
+
+ double dx = this.xCoord;
+ double dy = this.yCoord;
+ double dz = this.zCoord;
+ switch (outline)
+ {
+ case 0:
+ sx -= this.radius;
+ dx -= this.radius;
+ sz -= this.radius;
+ dz += this.radius + 1;
+ case 8:
+ sx -= this.radius;
+ dx += this.radius + 1;
+ sz -= this.radius;
+ dz -= this.radius;
+ break;
+ case 1:
+ case 9:
+ sx -= this.radius;
+ dx -= this.radius;
+ sz -= this.radius;
+ dz += this.radius + 1;
+ break;
+ case 2:
+ case 10:
+ sx -= this.radius;
+ dx += this.radius + 1;
+ sz += this.radius + 1;
+ dz += this.radius + 1;
+ break;
+ case 3:
+ case 11:
+ sx += this.radius + 1;
+ dx += this.radius + 1;
+ sz -= this.radius;
+ dz += this.radius + 1;
+ break;
+ case 4:
+ sx -= this.radius;
+ dx -= this.radius;
+ sz -= this.radius;
+ dz -= this.radius;
+ break;
+ case 5:
+ sx += this.radius + 1;
+ dx += this.radius + 1;
+ sz -= this.radius;
+ dz -= this.radius;
+ break;
+ case 6:
+ sx += this.radius + 1;
+ dx += this.radius + 1;
+ sz += this.radius + 1;
+ dz += this.radius + 1;
+ break;
+ case 7:
+ sx -= this.radius;
+ dx -= this.radius;
+ sz += this.radius + 1;
+ dz += this.radius + 1;
+ }
+ switch (outline)
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ sy += this.radius + 1;
+ dy += this.radius + 1;
+ break;
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ sy -= this.radius;
+ dy += this.radius + 1;
+ break;
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ sy -= this.radius;
+ dy -= this.radius;
+ }
+ if (this.rand.nextBoolean()) {
+ drawParticleLine(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, dx, dy, dz);
+ } else {
+ drawParticleLine(sx, sy, sz, this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D);
+ }
+ drawParticleLine(sx, sy, sz, dx, dy, dz);
+ }
+
+ protected void drawParticleLine(double srcX, double srcY, double srcZ, double destX, double destY, double destZ)
+ {
+ int particles = 16;
+ for (int i = 0; i < particles; i++)
+ {
+ double trailFactor = i / (particles - 1.0D);
+
+ double tx = srcX + (destX - srcX) * trailFactor + this.rand.nextFloat() * 0.005D;
+ double ty = srcY + (destY - srcY) * trailFactor + this.rand.nextFloat() * 0.005D;
+ double tz = srcZ + (destZ - srcZ) * trailFactor + this.rand.nextFloat() * 0.005D;
+ this.worldObj.spawnParticle("portal", tx, ty, tz, 0.0D, 0.0D, 0.0D);
+ }
+ }
+
+ private boolean scanAndRevertChanges()
+ {
+ int index = 0;
+ boolean reverted = false;
+ for (int x = -this.radius; x <= this.radius; x++) {
+ for (int y = -this.radius; y <= this.radius; y++) {
+ for (int z = -this.radius; z <= this.radius; z++)
+ {
+ Block blockID = this.worldObj.getBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z);
+ byte meta = (byte)this.worldObj.getBlockMetadata(this.xCoord + x, this.yCoord + y, this.zCoord + z);
+ if (this.blockData[index] != blockID) {
+ if (revertBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z, blockID, meta, this.blockData[index], this.metaData[index]))
+ {
+ reverted = true;
+ }
+ else
+ {
+ this.blockData[index] = blockID;
+ this.metaData[index] = meta;
+ }
+ }
+ index++;
+ }
+ }
+ }
+ return reverted;
+ }
+
+ private boolean revertBlock(int x, int y, int z, Block thereBlockID, byte thereMeta, Block replaceBlockID, byte replaceMeta)
+ {
+ /*if ((thereBlockID == Blocks.air) && (!replaceBlockID.getMaterial().blocksMovement()))
+ {
+ System.out.println("Not replacing block " + replaceBlockID + " because it doesn't block movement");
+
+ return false;
+ }*/
+ if (isUnrevertable(thereBlockID, thereMeta, replaceBlockID, replaceMeta)) {
+ return false;
+ }
+ if (this.rand.nextInt(5) == 0)
+ {
+ if (replaceBlockID != Blocks.air)
+ {
+ //replaceBlockID = null;
+ replaceMeta = 4;
+ }
+ this.worldObj.setBlock(x, y, z, replaceBlockID, replaceMeta, 2);
+ if (thereBlockID == Blocks.air)
+ {
+ this.worldObj.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(replaceBlockID) + (replaceMeta << 12));
+ }
+ else if (replaceBlockID == Blocks.air)
+ {
+ this.worldObj.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(thereBlockID) + (thereMeta << 12));
+ thereBlockID.dropBlockAsItem(this.worldObj, x, y, z, thereMeta, 0);
+ }
+ }
+ return true;
+ }
+
+ private boolean isUnrevertable(Block thereBlockID, byte thereMeta, Block replaceBlockID, byte replaceMeta)
+ {
+ if ((thereBlockID == ModBlocks.blockGriefSaver) || (replaceBlockID == ModBlocks.blockGriefSaver)) {
+ return true;
+ }
+ /*if (((thereBlockID == towerTranslucent) && (thereMeta != 4)) || ((replaceBlockID == towerTranslucent) && (replaceMeta != 4))) {
+ return true;
+ }*/
+ if ((thereBlockID == Blocks.redstone_lamp) && (replaceBlockID == Blocks.lit_redstone_lamp)) {
+ return true;
+ }
+ if ((thereBlockID == Blocks.lit_redstone_lamp) && (replaceBlockID == Blocks.redstone_lamp)) {
+ return true;
+ }
+ /*if ((thereBlockID == Blocks.water) || (replaceBlockID == Blocks.flowing_water)) {
+ return true;
+ }
+ if ((thereBlockID == Blocks.flowing_water) || (replaceBlockID == Blocks.water)) {
+ return true;
+ }*/
+ if (replaceBlockID == Blocks.tnt) {
+ return true;
+ }
+ return false;
+ }
+
+ private void captureBlockData()
+ {
+ this.blockData = new Block[this.diameter * this.diameter * this.diameter];
+ this.metaData = new byte[this.diameter * this.diameter * this.diameter];
+
+ int index = 0;
+ for (int x = -this.radius; x <= this.radius; x++) {
+ for (int y = -this.radius; y <= this.radius; y++) {
+ for (int z = -this.radius; z <= this.radius; z++)
+ {
+ Block blockID = this.worldObj.getBlock(this.xCoord + x, this.yCoord + y, this.zCoord + z);
+ int meta = this.worldObj.getBlockMetadata(this.xCoord + x, this.yCoord + y, this.zCoord + z);
+
+ this.blockData[index] = blockID;
+ this.metaData[index] = ((byte)meta);
+
+ index++;
+ }
+ }
+ }
+ }
+
+ public boolean anyPlayerInRange()
+ {
+ return this.worldObj.getClosestPlayer(this.xCoord + 0.5D, this.yCoord + 0.5D, this.zCoord + 0.5D, this.requiredPlayerRange) != null;
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityCharger.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityCharger.java
new file mode 100644
index 0000000000..9ec6aa3b24
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityCharger.java
@@ -0,0 +1,186 @@
+package gtPlusPlus.core.tileentities.machines;
+
+import gtPlusPlus.core.item.base.BaseItemWithCharge;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraftforge.common.util.Constants;
+
+public class TileEntityCharger extends TileEntity implements IInventory
+{
+ private ItemStack[] items = new ItemStack[1]; //18
+ private int progress_Current = 1;
+ private int progress_Max = 1000;
+ public float charge_Current;
+ public float charge_Max = 10000;
+ private float tempItemChargeValue;
+
+ public float getCharge(){
+ return charge_Current;
+ }
+
+ public int getProgress(){
+ return progress_Current;
+ }
+
+ @Override
+ public int getSizeInventory()
+ {
+ return items.length;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int slot)
+ {
+ return items[slot];
+ }
+
+ @Override
+ public ItemStack decrStackSize(int slot, int amount)
+ {
+ if (items[slot] != null)
+ {
+ ItemStack itemstack;
+
+ if (items[slot].stackSize == amount)
+ {
+ itemstack = items[slot];
+ items[slot] = null;
+ markDirty();
+ return itemstack;
+ }
+ itemstack = items[slot].splitStack(amount);
+ if (items[slot].stackSize == 0) items[slot] = null;
+ markDirty();
+ return itemstack;
+ }
+ return null;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(int slot)
+ {
+ if (items[slot] != null)
+ {
+ ItemStack itemstack = items[slot];
+ items[slot] = null;
+ return itemstack;
+ }
+ return null;
+ }
+
+ @Override
+ public void setInventorySlotContents(int slot, ItemStack stack)
+ {
+ if (stack != null){
+ items[slot] = stack;
+ if (stack != null && stack.stackSize > getInventoryStackLimit())
+ {
+ stack.stackSize = getInventoryStackLimit();
+ }
+
+
+ markDirty();
+ }
+ }
+
+ @Override
+ public String getInventoryName()
+ {
+ return "container.Charger";
+ }
+
+ @Override
+ public boolean hasCustomInventoryName()
+ {
+ return false;
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ super.readFromNBT(nbt);
+ NBTTagList list = nbt.getTagList("Items", Constants.NBT.TAG_COMPOUND);
+ items = new ItemStack[getSizeInventory()];
+
+ for (int i = 0; i < list.tagCount(); ++i) { NBTTagCompound comp = list.getCompoundTagAt(i); int j = comp.getByte("Slot") & 255; if (j >= 0 && j < items.length)
+ {
+ items[j] = ItemStack.loadItemStackFromNBT(comp);
+ }
+ }
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ super.writeToNBT(nbt);
+ NBTTagList list = new NBTTagList();
+
+ for (int i = 0; i < items.length; ++i)
+ {
+ if (items[i] != null)
+ {
+ NBTTagCompound comp = new NBTTagCompound();
+ comp.setByte("Slot", (byte)i);
+ items[i].writeToNBT(comp);
+ list.appendTag(comp);
+ }
+ }
+
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getInventoryStackLimit()
+ {
+ return 64;
+ }
+
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer player)
+ {
+ return worldObj.getTileEntity(xCoord, yCoord, zCoord) != this ? false : player.getDistanceSq((double)xCoord + 0.5D, (double)yCoord + 0.5D, (double)zCoord + 0.5D) <= 64.0D;
+ }
+
+ @Override
+ public void openInventory() {}
+
+ @Override
+ public void closeInventory() {}
+
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack stack)
+ {
+ return true;
+ }
+
+ @Override
+ public void updateEntity() {
+ if(!this.worldObj.isRemote){
+ if (progress_Current < progress_Max){
+ progress_Current++;
+ }
+ else if (progress_Current >= progress_Max){
+ if (charge_Current < charge_Max){
+ charge_Current = charge_Current+500;
+ }
+ if (getStackInSlot(0).getItem() instanceof BaseItemWithCharge){
+ float tempCharge;
+ ItemStack output = getStackInSlot(0).copy();
+ if (output.stackTagCompound != null){
+ tempCharge = output.stackTagCompound.getFloat("charge_Current");
+ output.stackTagCompound = new NBTTagCompound();
+ output.stackTagCompound.setFloat("charge_Current", tempCharge+40);
+ this.charge_Current = charge_Current-40;
+ tempCharge = 0;
+ }
+ }
+ progress_Current = 0;
+ }
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityNHG.java b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityNHG.java
new file mode 100644
index 0000000000..3a9dbbd4c7
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/tileentities/machines/TileEntityNHG.java
@@ -0,0 +1,502 @@
+package gtPlusPlus.core.tileentities.machines;
+
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.item.general.fuelrods.FuelRod_Base;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.math.MathUtils;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraftforge.common.util.Constants;
+
+public class TileEntityNHG extends TileEntity implements IInventory
+{
+ private ItemStack[] items = new ItemStack[19]; //18
+ private int progress = 1;
+ private int maxProgress = 180;
+ private int heatCycleProgress = 12;
+ public float coreTemp;
+ public float maxTemp = 10000;
+ private boolean fuelrod_1 = false;
+ private boolean fuelrod_2 = false;
+ private boolean fuelrod_3 = false;
+ private boolean fuelrod_4 = false;
+ private boolean fuelrod_5 = false;
+ private boolean fuelrod_6 = false;
+ private boolean fuelrod_7 = false;
+ private boolean fuelrod_8 = false;
+ private boolean fuelrod_9 = false;
+ private boolean fuelrod_10 = false;
+ private boolean fuelrod_11 = false;
+ private boolean fuelrod_12 = false;
+ private boolean fuelrod_13 = false;
+ private boolean fuelrod_14 = false;
+ private boolean fuelrod_15 = false;
+ private boolean fuelrod_16 = false;
+ private boolean fuelrod_17 = false;
+ private boolean fuelrod_18 = false;
+
+ public float getCoreTemp(){
+ return coreTemp;
+ }
+
+ public int getProgress(){
+ return progress;
+ }
+
+ public boolean isValidFuelRod(ItemStack input){
+ if(!this.worldObj.isRemote){
+ if (input != null){
+ if (input.getItem() instanceof FuelRod_Base){
+ int fuelRodFuelLevel = getRodFuelValue(input);
+ float fuelRodHeatLevel = getRodHeatValue(input);
+ Utils.LOG_WARNING("Fuel Left: "+fuelRodFuelLevel+" Current Temp: "+fuelRodHeatLevel);
+ return true;
+ //return input.stackTagCompound.getInteger("code");
+ }
+ }
+
+ }
+ return false;
+ }
+
+ public ItemStack doFuelRodHeatDamage(ItemStack input){
+ if(!this.worldObj.isRemote){
+ if (input != null){
+ if (isValidFuelRod(input)){
+ int fuelRodFuelLevel = getRodFuelValue(input);
+ float fuelRodHeatLevel = getRodHeatValue(input);
+ if(fuelRodFuelLevel <= 0 || fuelRodFuelLevel == 0){
+ return null;
+ }
+ if(fuelRodHeatLevel == 0 && fuelRodFuelLevel > 0){
+ if(fuelRodFuelLevel >= 5){
+ int tempInt=fuelRodFuelLevel;
+ float tempFloat=fuelRodHeatLevel;
+ ItemStack output = input.copy();
+ if (input.stackTagCompound != null){
+ output.stackTagCompound = new NBTTagCompound();
+ output.stackTagCompound.setInteger("fuelRemaining", tempInt-40);
+ output.stackTagCompound.setFloat("heat", tempFloat+20);
+ }
+ return output;
+ }
+ return null;
+ }
+ else if(fuelRodHeatLevel >= 5 && fuelRodFuelLevel > 0){
+ int tempInt=fuelRodFuelLevel;
+ float tempFloat=fuelRodHeatLevel;
+ ItemStack output = input.copy();
+ if (input.stackTagCompound != null){
+ output.stackTagCompound = new NBTTagCompound();
+ output.stackTagCompound.setInteger("fuelRemaining", tempInt-5);
+ output.stackTagCompound.setFloat("heat", tempFloat+5);
+ }
+ return output;
+ }
+
+ else if(fuelRodHeatLevel >= 5 && fuelRodFuelLevel == 0){
+ ItemStack output = input.copy();
+ if (input.stackTagCompound != null){
+ output.stackTagCompound = new NBTTagCompound();
+ output.stackTagCompound.setInteger("heat", -5);
+ }
+ return output;
+ }
+ else {
+ return null;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public float getRodHeatValue(ItemStack value){
+ if (value != null){
+ if (value.stackTagCompound != null){
+ return value.stackTagCompound.getFloat("heat");
+ }
+ }
+ return 0f;
+ }
+
+ public int getRodFuelValue(ItemStack value){
+ if (value != null){
+ if (value.stackTagCompound != null){
+ int tempInt = value.stackTagCompound.getInteger("fuelRemaining");
+ return tempInt;
+ }
+ }
+ return 0;
+ }
+
+ public void checkFuelRods(){
+
+ if(!this.worldObj.isRemote){
+ for (int i = 0; i < getSizeInventory(); i++){
+ if (items[i] != null){
+ if (items[i].getItem() instanceof FuelRod_Base){
+ ItemStack fuelRodStack = getStackInSlot(i).copy();
+ //setInventorySlotContents(i, doFuelRodHeatDamage(fuelRodStack));
+ if (i == 0){
+ fuelrod_1 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+ else if (i == 1){
+ fuelrod_2 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+ else if (i == 2){
+ fuelrod_3 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+ else if (i == 3){
+ fuelrod_4 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+ else if (i == 4){
+ fuelrod_5 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+ else if (i == 5){
+ fuelrod_6 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+ else if (i == 6){
+ fuelrod_7 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+ else if (i == 7){
+ fuelrod_8 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+ else if (i == 8){
+ fuelrod_9 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+ else if (i == 9){
+ fuelrod_10 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+ else if (i == 10){
+ fuelrod_11 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+ else if (i == 11){
+ fuelrod_12 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+ else if (i == 12){
+ fuelrod_13 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+ else if (i == 13){
+ fuelrod_14 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+ else if (i == 14){
+ fuelrod_15 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+ else if (i == 15){
+ fuelrod_16 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+ else if (i == 16){
+ fuelrod_17 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+ else if (i == 17){
+ fuelrod_18 = true;
+ ItemStack r = doFuelRodHeatDamage(fuelRodStack);
+ setInventorySlotContents(i, r);
+ }
+
+
+ }
+ }
+ }
+ Utils.LOG_WARNING("|"+fuelrod_1+"|"+fuelrod_2+"|"+fuelrod_3+"| "+"|"+fuelrod_10+"|"+fuelrod_11+"|"+fuelrod_12+"|");
+ Utils.LOG_WARNING("|"+fuelrod_4+"|"+fuelrod_5+"|"+fuelrod_6+"| "+"|"+fuelrod_13+"|"+fuelrod_14+"|"+fuelrod_15+"|");
+ Utils.LOG_WARNING("|"+fuelrod_7+"|"+fuelrod_8+"|"+fuelrod_9+"| "+"|"+fuelrod_16+"|"+fuelrod_17+"|"+fuelrod_18+"|");
+ }
+
+ }
+
+ public boolean calculateHeat(){
+ /*if (!fuelrod_1 || !fuelrod_2 || !fuelrod_3 || !fuelrod_4 || !fuelrod_5 || !fuelrod_6 || !fuelrod_7 || !fuelrod_8 || !fuelrod_9 || !fuelrod_10 || !fuelrod_11 || !fuelrod_12 || !fuelrod_13 || !fuelrod_14 || !fuelrod_15 || !fuelrod_16 || !fuelrod_17 || !fuelrod_18){
+ coreTemp = 0;
+ }
+ else {*/
+ if(!this.worldObj.isRemote){
+ for (int i = 0; i < getSizeInventory(); i++){
+ if (items[i] != null){
+ if (items[i].getItem() instanceof FuelRod_Base){
+ ItemStack fuelRodStack = getStackInSlot(i).copy();
+ //if (fuelRodStack.stackTagCompound.getFloat("heat") != 0){
+ doFuelRodHeatDamage(fuelRodStack);
+ coreTemp = coreTemp+fuelRodStack.stackTagCompound.getFloat("heat");
+ return true;
+ //}
+ }
+ }
+ }
+ }
+ //}
+
+
+
+ return false;
+ }
+
+ @Override
+ public int getSizeInventory()
+ {
+ return items.length;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int slot)
+ {
+
+ return items[slot];
+
+ }
+
+ @Override
+ public ItemStack decrStackSize(int slot, int amount)
+ {
+ if (items[slot] != null)
+ {
+ ItemStack itemstack;
+
+ if (items[slot].stackSize == amount)
+ {
+ itemstack = items[slot];
+ items[slot] = null;
+ markDirty();
+ return itemstack;
+ }
+ itemstack = items[slot].splitStack(amount);
+ if (items[slot].stackSize == 0) items[slot] = null;
+ markDirty();
+ return itemstack;
+ }
+ return null;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(int slot)
+ {
+ if (items[slot] != null)
+ {
+ ItemStack itemstack = items[slot];
+ items[slot] = null;
+ return itemstack;
+ }
+ return null;
+ }
+
+ @Override
+ public void setInventorySlotContents(int slot, ItemStack stack)
+ {
+ if (stack != null){
+ items[slot] = stack;
+ if (stack != null && stack.stackSize > getInventoryStackLimit())
+ {
+ stack.stackSize = getInventoryStackLimit();
+ }
+
+
+ markDirty();
+ }
+ }
+
+ @Override
+ public String getInventoryName()
+ {
+ return "container.NHG";
+ }
+
+ @Override
+ public boolean hasCustomInventoryName()
+ {
+ return false;
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ super.readFromNBT(nbt);
+ NBTTagList list = nbt.getTagList("Items", Constants.NBT.TAG_COMPOUND);
+ items = new ItemStack[getSizeInventory()];
+
+ for (int i = 0; i < list.tagCount(); ++i) { NBTTagCompound comp = list.getCompoundTagAt(i); int j = comp.getByte("Slot") & 255; if (j >= 0 && j < items.length)
+ {
+ items[j] = ItemStack.loadItemStackFromNBT(comp);
+ }
+ }
+ }
+
+ @Override
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ super.writeToNBT(nbt);
+ NBTTagList list = new NBTTagList();
+
+ for (int i = 0; i < items.length; ++i)
+ {
+ if (items[i] != null)
+ {
+ NBTTagCompound comp = new NBTTagCompound();
+ comp.setByte("Slot", (byte)i);
+ items[i].writeToNBT(comp);
+ list.appendTag(comp);
+ }
+ }
+
+ nbt.setTag("Items", list);
+ }
+
+ @Override
+ public int getInventoryStackLimit()
+ {
+ return 64;
+ }
+
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer player)
+ {
+ return worldObj.getTileEntity(xCoord, yCoord, zCoord) != this ? false : player.getDistanceSq((double)xCoord + 0.5D, (double)yCoord + 0.5D, (double)zCoord + 0.5D) <= 64.0D;
+ }
+
+ @Override
+ public void openInventory() {}
+
+ @Override
+ public void closeInventory() {}
+
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack stack)
+ {
+ return true;
+ }
+
+ //Machine Code - TODO
+ private ItemStack neutrons;
+
+ @Override
+ public void updateEntity() {
+
+ if(!this.worldObj.isRemote){
+
+ if(progress >= heatCycleProgress){
+ //Utils.LOG_SPECIFIC_WARNING("NFHG", "Updating Entity "+this.getBlockType().getUnlocalizedName(), 376);
+ if (MathUtils.divideXintoY(heatCycleProgress, maxProgress)){
+ Utils.LOG_SPECIFIC_WARNING("NFHG", "Updating Entity "+this.getBlockType().getUnlocalizedName(), 378);
+ calculateHeat();
+ heatCycleProgress=0;
+ }
+ }
+
+ if(++progress >= maxProgress){
+
+
+ Utils.LOG_SPECIFIC_WARNING("NFHG", "Updating Entity "+this.getBlockType().getUnlocalizedName(), 338);
+ if (items[18] != null){
+ ItemStack checkOutput = getStackInSlot(18);
+ if(neutrons == null){
+ neutrons = new ItemStack(ModItems.itemHeliumBlob, 1);
+ if (checkOutput == null){
+ Utils.LOG_WARNING("ItemStack in Output slot is definitely null, making a new ItemStack.");
+ setInventorySlotContents(18, neutrons);
+ progress = 0;
+ markDirty();
+ }
+ else {
+ checkOutput.stackSize++;
+ Utils.LOG_WARNING("Found an ItemStack to increase the size of. Current size is "+neutrons.stackSize);
+
+ progress = 0;
+ markDirty();
+ }
+ }
+ else if(checkOutput.getItem() == ModItems.itemHeliumBlob && checkOutput.stackSize < 64){
+ checkOutput.stackSize++;
+ Utils.LOG_WARNING("Found an ItemStack to increase size of. Current size is "+checkOutput.stackSize);
+ progress = 0;
+ markDirty();
+ }
+ else if(checkOutput.getItem() == ModItems.itemHeliumBlob && checkOutput.stackSize == 64){
+ Utils.LOG_WARNING("Output stack is full.");
+ progress = 0;
+ markDirty();
+ }
+ }
+ else if (items[18] == null){
+ Utils.LOG_WARNING("ItemStack in Output slot is null");
+ neutrons = new ItemStack(ModItems.itemHeliumBlob, 1);
+ ItemStack checkOutput = getStackInSlot(18);
+ if (checkOutput == null){
+ Utils.LOG_WARNING("ItemStack in Output slot is definitely null, making a new ItemStack.");
+ setInventorySlotContents(18, neutrons);
+ progress = 0;
+ markDirty();
+ }
+ else {
+ Utils.LOG_WARNING("Found an ItemStack to increase the size of.");
+ checkOutput.stackSize++;
+ progress = 0;
+ markDirty();
+ }
+ }
+ checkFuelRods();
+ }
+ progress++;
+ }
+ }
+
+ public void readCustomNBT(NBTTagCompound tag)
+ {
+ this.neutrons = ItemStack.loadItemStackFromNBT(tag.getCompoundTag("Neutrons"));
+ this.progress = tag.getInteger("Progress");
+ this.coreTemp = tag.getFloat("coreTemp");
+ }
+
+ public void writeCustomNBT(NBTTagCompound tag)
+ {
+ tag.setInteger("Progress", this.progress);
+ tag.setFloat("coreTemp", this.coreTemp);
+ if(neutrons != null) {
+ NBTTagCompound produce = new NBTTagCompound();
+ neutrons.writeToNBT(produce);
+ tag.setTag("Neutrons", produce);
+ }
+ else
+ tag.removeTag("Neutrons");
+ }
+
+
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/util/BaseHandler.java b/src/Java/gtPlusPlus/core/util/BaseHandler.java
new file mode 100644
index 0000000000..63f22f3763
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/BaseHandler.java
@@ -0,0 +1,11 @@
+package gtPlusPlus.core.util;
+
+public abstract class BaseHandler {
+
+ public abstract void preInit();
+
+ public abstract void init();
+
+ public abstract void postInit();
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/ClassUtils.java b/src/Java/gtPlusPlus/core/util/ClassUtils.java
new file mode 100644
index 0000000000..ba3db748f9
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/ClassUtils.java
@@ -0,0 +1,78 @@
+package gtPlusPlus.core.util;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+public class ClassUtils {
+
+
+ /*@ if (isPresent("com.optionaldependency.DependencyClass")) {
+ // This block will never execute when the dependency is not present
+ // There is therefore no more risk of code throwing NoClassDefFoundException.
+ executeCodeLinkingToDependency();
+ }*/
+ public static boolean isPresent(String className) {
+ try {
+ Class.forName(className);
+ return true;
+ } catch (Throwable ex) {
+ // Class or one of its dependencies is not present...
+ return false;
+ }
+ }
+
+ public static Method getMethodViaReflection(Class<?> lookupClass, String methodName, boolean invoke) throws Exception{
+ Class<? extends Class> lookup = lookupClass.getClass();
+ Method m = lookup.getDeclaredMethod(methodName);
+ m.setAccessible(true);// Abracadabra
+ if (invoke){
+ m.invoke(lookup);// now its OK
+ }
+ return m;
+ }
+
+ public static Class getNonPublicClass(String className){
+ Class<?> c = null;
+ try {
+ c = Class.forName(className);
+ } catch (ClassNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ //full package name --------^^^^^^^^^^
+ //or simpler without Class.forName:
+ //Class<package1.A> c = package1.A.class;
+
+ if (null != c){
+ //In our case we need to use
+ Constructor<?> constructor = null;
+ try {
+ constructor = c.getDeclaredConstructor();
+ } catch (NoSuchMethodException | SecurityException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ //note: getConstructor() can return only public constructors
+ //so we needed to search for any Declared constructor
+
+ //now we need to make this constructor accessible
+ if (null != constructor){
+ constructor.setAccessible(true);//ABRACADABRA!
+
+ try {
+ Object o = constructor.newInstance();
+ return (Class) o;
+ } catch (InstantiationException | IllegalAccessException
+ | IllegalArgumentException | InvocationTargetException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+ return null;
+ }
+
+
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/Log.java b/src/Java/gtPlusPlus/core/util/Log.java
new file mode 100644
index 0000000000..ea7076e453
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/Log.java
@@ -0,0 +1,29 @@
+package gtPlusPlus.core.util;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public final class Log
+{
+ public static final Logger LOGGER = LogManager.getLogger("MiscUtils");
+
+ public static void warn(String msg)
+ {
+ LOGGER.warn(msg);
+ }
+
+ public static void error(String msg)
+ {
+ LOGGER.error(msg);
+ }
+
+ public static void info(String msg)
+ {
+ LOGGER.info(msg);
+ }
+
+ public static void debug(String msg)
+ {
+ LOGGER.debug(msg);
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/util/LoggingUtils.java b/src/Java/gtPlusPlus/core/util/LoggingUtils.java
new file mode 100644
index 0000000000..7783577ee2
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/LoggingUtils.java
@@ -0,0 +1,54 @@
+package gtPlusPlus.core.util;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Date;
+
+public class LoggingUtils {
+
+ public static void profileLog(Object o){
+ try {
+ String content;
+ File file = new File("GregtechTimingsTC.txt");
+ // if file doesnt exists, then create it
+ if (!file.exists()) {
+ file.createNewFile();
+ FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
+ BufferedWriter bw = new BufferedWriter(fw);
+ bw.write("============================================================");
+ bw.write(System.lineSeparator());
+ bw.close();
+ }
+ if (o instanceof String){
+ content = (String) o;
+ }
+ else {
+ content = o.toString();
+ }
+ FileWriter fw = new FileWriter(file.getAbsoluteFile(), true);
+ BufferedWriter bw = new BufferedWriter(fw);
+ bw.write(content);
+ bw.write(System.lineSeparator());
+ bw.close();
+ System.out.println("Data Logged.");
+
+ } catch (IOException e) {
+ System.out.println("Data logging failed.");
+ }
+ }
+
+ public static boolean logCurrentSystemTime(String message){
+ Date date = new Date(System.currentTimeMillis());
+ try {
+ profileLog(message+" | "+date.toString());
+ return true;
+ }
+ catch (Throwable r) {
+ return false;
+ }
+
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/Utils.java b/src/Java/gtPlusPlus/core/util/Utils.java
new file mode 100644
index 0000000000..f6430cc75d
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/Utils.java
@@ -0,0 +1,539 @@
+package gtPlusPlus.core.util;
+
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.TC_Aspects;
+import gregtech.api.enums.TC_Aspects.TC_AspectStack;
+import gtPlusPlus.GTplusplus;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.fluid.FluidUtils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.math.MathUtils;
+import ic2.core.IC2Potion;
+import ic2.core.Ic2Items;
+import ic2.core.init.InternalName;
+import ic2.core.item.armor.ItemArmorHazmat;
+import ic2.core.item.resources.ItemCell;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.UUID;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLiving;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.EnumCreatureType;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.Item.ToolMaterial;
+import net.minecraft.item.ItemStack;
+import net.minecraft.server.MinecraftServer;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.World;
+import net.minecraft.world.biome.BiomeGenBase;
+import net.minecraftforge.common.util.EnumHelper;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.oredict.OreDictionary;
+import cpw.mods.fml.common.FMLLog;
+import cpw.mods.fml.common.registry.EntityRegistry;
+
+public class Utils {
+
+ public static final int WILDCARD_VALUE = Short.MAX_VALUE;
+
+ static class ShortTimerTask extends TimerTask {
+ @Override
+ public void run() {
+ Utils.LOG_WARNING("Timer expired.");
+ }
+ }
+
+ public static TC_AspectStack getTcAspectStack (TC_Aspects aspect, int size){
+
+ TC_AspectStack returnValue = null;
+
+ if (aspect.name().toUpperCase() == "COGNITIO"){
+ //Adds in Compat for older GT Versions which Misspell aspects.
+ try {
+ returnValue = new TC_AspectStack(TC_Aspects.valueOf("COGNITIO"), size);
+ } catch (NoSuchFieldError r){
+ Utils.LOG_INFO("Fallback TC Aspect found - "+aspect.name()+" - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR");
+ returnValue = new TC_AspectStack(TC_Aspects.valueOf("COGNITO"), size);
+
+ }
+ }
+ else if (aspect.name().toUpperCase() == "EXANIMUS"){
+ //Adds in Compat for older GT Versions which Misspell aspects.
+ try {
+ returnValue = new TC_AspectStack(TC_Aspects.valueOf("EXANIMUS"), size);
+ } catch (NoSuchFieldError r){
+ Utils.LOG_INFO("Fallback TC Aspect found - "+aspect.name()+" - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR");
+ returnValue = new TC_AspectStack(TC_Aspects.valueOf("EXAMINIS"), size);
+ }
+ }
+ else if (aspect.name().toUpperCase() == "PRAECANTATIO"){
+ //Adds in Compat for older GT Versions which Misspell aspects.
+ try {
+ returnValue = new TC_AspectStack(TC_Aspects.valueOf("PRAECANTATIO"), size);
+ } catch (NoSuchFieldError r){
+ Utils.LOG_INFO("Fallback TC Aspect found - "+aspect.name()+" - PLEASE UPDATE GREGTECH TO A NEWER VERSION TO REMOVE THIS MESSAGE - THIS IS NOT AN ERROR");
+ returnValue = new TC_AspectStack(TC_Aspects.valueOf("PRAECANTIO"), size);
+ }
+ }
+ else {
+ returnValue = new TC_AspectStack(aspect, size);
+ }
+
+ return returnValue;
+ }
+
+ public static boolean containsMatch(boolean strict, ItemStack[] inputs, ItemStack... targets)
+ {
+ for (ItemStack input : inputs)
+ {
+ for (ItemStack target : targets)
+ {
+ if (itemMatches(target, input, strict))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public static boolean itemMatches(ItemStack target, ItemStack input, boolean strict)
+ {
+ if (input == null || target == null)
+ {
+ return false;
+ }
+ return (target.getItem() == input.getItem() && ((target.getItemDamage() == WILDCARD_VALUE && !strict) || target.getItemDamage() == input.getItemDamage()));
+ }
+
+ //TODO
+ public static void registerEntityToBiomeSpawns(Class<EntityLiving> classy, EnumCreatureType EntityType, BiomeGenBase baseBiomeGen){
+ EntityRegistry.addSpawn(classy, 6, 1, 5, EntityType, baseBiomeGen); //change the values to vary the spawn rarity, biome, etc.
+ }
+
+ //Non-Dev Comments
+ public static void LOG_INFO(String s){
+ //if (CORE.DEBUG){
+ FMLLog.info("GT++: "+s);
+ //}
+ }
+
+ //Developer Comments
+ public static void LOG_WARNING(String s){
+ if (CORE.DEBUG){
+ FMLLog.warning("GT++: "+s);
+ }
+ }
+
+ //Errors
+ public static void LOG_ERROR(String s){
+ if (CORE.DEBUG){
+ FMLLog.severe("GT++: "+s);
+ }
+ }
+
+ //Developer Logger
+ public static void LOG_SPECIFIC_WARNING(String whatToLog, String msg, int line){
+ if (CORE.DEBUG){
+ FMLLog.warning("GT++ |"+line+"| "+whatToLog+" | "+msg);
+ }
+ }
+
+ public static void paintBox(Graphics g, int MinA, int MinB, int MaxA, int MaxB){
+ g.drawRect (MinA, MinB, MaxA, MaxB);
+ }
+
+ public static void messagePlayer(EntityPlayer P, String S){
+ gregtech.api.util.GT_Utility.sendChatToPlayer(P, S);
+ }
+
+ /**
+ * Returns if that Liquid is IC2Steam.
+ */
+ public static boolean isIC2Steam(FluidStack aFluid) {
+ if (aFluid == null) return false;
+ return aFluid.isFluidEqual(getIC2Steam(1));
+ }
+
+ /**
+ * Returns a Liquid Stack with given amount of IC2Steam.
+ */
+ public static FluidStack getIC2Steam(long aAmount) {
+ return FluidRegistry.getFluidStack("ic2steam", (int)aAmount);
+ }
+
+
+
+ /*public static void recipeBuilderBlock(ItemStack slot_1, ItemStack slot_2, ItemStack slot_3, ItemStack slot_4, ItemStack slot_5, ItemStack slot_6, ItemStack slot_7, ItemStack slot_8, ItemStack slot_9, Block resultBlock){
+ GameRegistry.addRecipe(new ItemStack(resultBlock),
+ new Object[] {"ABC", "DEF", "GHI",
+ 'A',slot_1,'B',slot_2,'C',slot_3,
+ 'D',slot_4,'E',slot_5,'F',slot_6,
+ 'G',slot_7,'H',slot_8,'I',slot_9
+ });
+ }*/
+
+ public static String checkCorrectMiningToolForBlock(Block currentBlock, World currentWorld){
+ String correctTool = "";
+ if (!currentWorld.isRemote){
+ try {
+ correctTool = currentBlock.getHarvestTool(0);
+ Utils.LOG_WARNING(correctTool);
+
+ } catch (NullPointerException e){
+
+ }
+ }
+
+ return correctTool;
+ }
+
+ /**
+ *
+ * @param colorStr e.g. "#FFFFFF"
+ * @return String - formatted "rgb(0,0,0)"
+ */
+ public static String hex2Rgb(String hexString) {
+ Color c = new Color(
+ Integer.valueOf(hexString.substring(1, 3), 16),
+ Integer.valueOf(hexString.substring(3, 5), 16),
+ Integer.valueOf(hexString.substring(5, 7), 16));
+
+ StringBuffer sb = new StringBuffer();
+ sb.append("rgb(");
+ sb.append(c.getRed());
+ sb.append(",");
+ sb.append(c.getGreen());
+ sb.append(",");
+ sb.append(c.getBlue());
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public static Timer ShortTimer(int seconds) {
+ Timer timer;
+ timer = new Timer();
+ timer.schedule(new ShortTimerTask(), seconds * 1000);
+ return timer;
+ }
+
+ public static String byteToHex(byte b) {
+ int i = b & 0xFF;
+ return Integer.toHexString(i);
+ }
+
+ public static Object[] convertListToArray(List<Object> sourceList) {
+ Object[] targetArray = sourceList.toArray(new Object[sourceList.size()]);
+ return targetArray;
+ }
+
+ public static List<Object> convertArrayToListFixed(Object[] sourceArray) {
+ List<Object> targetList = Arrays.asList(sourceArray);
+ return targetList;
+ }
+
+ public static List<Object> convertArrayToList(Object[] sourceArray) {
+ List<Object> targetList = new ArrayList<Object>(Arrays.asList(sourceArray));
+ return targetList;
+ }
+
+ public static EntityPlayer getPlayerOnServerFromUUID(UUID parUUID){
+ if (parUUID == null)
+ {
+ return null;
+ }
+ List<EntityPlayerMP> allPlayers = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
+ for (EntityPlayerMP player : allPlayers)
+ {
+ if (player.getUniqueID().equals(parUUID))
+ {
+ return player;
+ }
+ }
+ return null;
+ }
+
+ @Deprecated
+ public static Block findBlockUnderEntityNonBoundingBox(Entity parEntity){
+ int blockX = MathHelper.floor_double(parEntity.posX);
+ int blockY = MathHelper.floor_double(parEntity.posY-0.2D - (double)parEntity.yOffset);
+ int blockZ = MathHelper.floor_double(parEntity.posZ);
+ return parEntity.worldObj.getBlock(blockX, blockY, blockZ);
+ }
+
+ public static Block findBlockUnderEntity(Entity parEntity){
+ int blockX = MathHelper.floor_double(parEntity.posX);
+ int blockY = MathHelper.floor_double(parEntity.boundingBox.minY)-1;
+ int blockZ = MathHelper.floor_double(parEntity.posZ);
+ return parEntity.worldObj.getBlock(blockX, blockY, blockZ);
+ }
+
+ public static int getFacingDirection(Entity entity){
+ int d = MathHelper.floor_double((double) (entity.rotationYaw * 4.0F / 360) + 0.50) & 3;
+ return d;
+ }
+
+ public static boolean isPlayerOP(EntityPlayer player){
+ if (player.canCommandSenderUseCommand(2, "")){
+ return true;
+ }
+ return false;
+ }
+
+ public static void setEntityOnFire(Entity entity, int length){
+ entity.setFire(length);
+ }
+
+ public static void spawnCustomParticle(Entity entity){
+ GTplusplus.proxy.generateMysteriousParticles(entity);
+ }
+
+ public static void spawnFX(World world, int x, int y, int z, String particleName, Object particleName2){
+ if (!world.isRemote){
+ if (particleName2 == null || particleName2.equals("")){
+ particleName2 = particleName;
+ }
+ int l = MathUtils.randInt(0, 4);
+ double d0 = (double)((float)x + 0.5F);
+ double d1 = (double)((float)y + 0.7F);
+ double d2 = (double)((float)z + 0.5F);
+ double d3 = 0.2199999988079071D;
+ double d4 = 0.27000001072883606D;
+
+ if (l == 1)
+ {
+ world.spawnParticle(particleName, d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
+ }
+ else if (l == 2)
+ {
+ world.spawnParticle((String) particleName2, d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
+ }
+ else if (l == 3)
+ {
+ world.spawnParticle(particleName, d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D);
+ }
+ else if (l == 4)
+ {
+ world.spawnParticle((String) particleName2, d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D);
+ }
+ else
+ {
+ world.spawnParticle(particleName, d0, d1, d2, 0.0D, 0.0D, 0.0D);
+ if (particleName2 != null){
+ world.spawnParticle((String) particleName2, d0, d1, d2, 0.0D, 0.0D, 0.0D);
+ }
+ }
+ }
+ }
+
+ public static int rgbtoHexValue(int r, int g, int b){
+ Color c = new Color(r,g,b);
+ String temp = Integer.toHexString( c.getRGB() & 0xFFFFFF ).toUpperCase();
+
+ //System.out.println( "hex: " + Integer.toHexString( c.getRGB() & 0xFFFFFF ) + " hex value:"+temp);
+ temp = Utils.appenedHexNotationToString(String.valueOf(temp));
+ Utils.LOG_WARNING("Made "+temp+" - Hopefully it's not a mess.");
+ Utils.LOG_WARNING("It will decode into "+Integer.decode(temp)+".");
+ return Integer.decode(temp);
+ }
+
+ /*
+ * http://javadevnotes.com/java-left-pad-string-with-zeros-examples
+ */
+ public static String leftPadWithZeroes(String originalString, int length) {
+ StringBuilder sb = new StringBuilder();
+ while (sb.length() + originalString.length() < length) {
+ sb.append('0');
+ }
+ sb.append(originalString);
+ String paddedString = sb.toString();
+ return paddedString;
+ }
+
+ /*
+ * Original Code by Chandana Napagoda - https://cnapagoda.blogspot.com.au/2011/03/java-hex-color-code-generator.html
+ */
+ public static Map<Integer, String> hexColourGenerator(int colorCount){
+ int maxColorValue = 16777215;
+ // this is decimal value of the "FFFFFF"
+ int devidedvalue = maxColorValue/colorCount;
+ int countValue = 0;
+ HashMap<Integer, String> hexColorMap = new HashMap<Integer, String>();
+ for(int a=0; a < colorCount && maxColorValue >= countValue ; a++){
+ if(a != 0){
+ countValue+=devidedvalue;
+ hexColorMap.put(a,Integer.toHexString( 0x10000 | countValue).substring(1).toUpperCase());
+ }
+ else {
+ hexColorMap.put(a,Integer.toHexString( 0x10000 | countValue).substring(1).toUpperCase());
+ }
+ }
+ return hexColorMap;
+ }
+
+ /*
+ * Original Code by Chandana Napagoda - https://cnapagoda.blogspot.com.au/2011/03/java-hex-color-code-generator.html
+ */
+ public static Map<Integer, String> hexColourGeneratorRandom(int colorCount){
+ HashMap<Integer, String> hexColorMap = new HashMap<Integer, String>();
+ for(int a=0;a < colorCount; a++){
+ String code = ""+(int)(Math.random()*256);
+ code = code+code+code;
+ int i = Integer.parseInt(code);
+ hexColorMap.put(a,Integer.toHexString( 0x1000000 | i).substring(1).toUpperCase());
+ Utils.LOG_INFO(""+Integer.toHexString( 0x1000000 | i).substring(1).toUpperCase());
+ }
+ return hexColorMap;
+ }
+
+ public static String appenedHexNotationToString(Object hexAsStringOrInt){
+ String hexChar = "0x";
+ String result;
+ if (hexAsStringOrInt.getClass() == String.class){
+
+ if (((String) hexAsStringOrInt).length() != 6){
+ String temp = leftPadWithZeroes((String) hexAsStringOrInt, 6);
+ result = temp;
+ }
+ result = hexChar+hexAsStringOrInt;
+ return result;
+ }
+ else if (hexAsStringOrInt.getClass() == Integer.class){
+ ;
+ if (((String) hexAsStringOrInt).length() != 6){
+ String temp = leftPadWithZeroes((String) hexAsStringOrInt, 6);
+ result = temp;
+ }
+ result = hexChar+String.valueOf(hexAsStringOrInt);
+ return result;
+ }
+ else {
+ return null;
+ }
+ }
+
+ public static Integer appenedHexNotationToInteger(int hexAsStringOrInt){
+ String hexChar = "0x";
+ String result;
+ Utils.LOG_INFO(String.valueOf(hexAsStringOrInt));
+ result = hexChar+String.valueOf(hexAsStringOrInt);
+ return Integer.getInteger(result);
+ }
+
+ public static boolean doesEntryExistAlreadyInOreDictionary(String OreDictName){
+ if (OreDictionary.getOres(OreDictName).size() != 0) {
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean invertBoolean(boolean booleans){
+ if (booleans == true){
+ return false;
+ }
+ return true;
+ }
+
+ public static boolean applyRadiationDamageToEntity(int damage, World world, Entity entityHolding){
+ if (!world.isRemote){
+ if (damage > 0 && (entityHolding instanceof EntityLivingBase)) {
+ EntityLivingBase entityLiving = (EntityLivingBase) entityHolding;
+ if (!ItemArmorHazmat.hasCompleteHazmat(entityLiving)) {
+ int duration;
+ if (entityLiving.getActivePotionEffect(IC2Potion.radiation) != null){
+ //Utils.LOG_INFO("t");
+ duration = (damage*5)+entityLiving.getActivePotionEffect(IC2Potion.radiation).getDuration();
+ }
+ else {
+ //Utils.LOG_INFO("f");
+ duration = damage*30;
+ }
+ IC2Potion.radiation.applyTo(entityLiving, duration, damage * 15);
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ private static short cellID = 15;
+ public static ItemStack createInternalNameAndFluidCell(String s){
+ Utils.LOG_WARNING("1");
+ InternalName yourName = EnumHelper.addEnum(InternalName.class, s, new Class[0], new Object[0]);
+ Utils.LOG_WARNING("2 "+yourName.name());
+ ItemCell item = (ItemCell)Ic2Items.cell.getItem();
+ Utils.LOG_WARNING("3 "+item.getUnlocalizedName());
+ try
+ {
+ Utils.LOG_WARNING("4");
+ Class<? extends ItemCell> clz = item.getClass();
+ Utils.LOG_WARNING("5 "+clz.getSimpleName());
+ Method methode = clz.getDeclaredMethod("addCell", int.class, InternalName.class, Block[].class);
+ Utils.LOG_WARNING("6 "+methode.getName());
+ methode.setAccessible(true);
+ Utils.LOG_WARNING("7 "+methode.isAccessible());
+ ItemStack temp = (ItemStack) methode.invoke(item, cellID++, yourName, new Block[0]);
+ Utils.LOG_INFO("Successfully created "+temp.getDisplayName()+"s.");
+ FluidContainerRegistry.registerFluidContainer(FluidUtils.getFluidStack(s.toLowerCase(), 0), temp.copy(), Ic2Items.cell.copy());
+ UtilsItems.addItemToOreDictionary(temp.copy(), "cell"+s);
+ return temp;
+ }
+ catch(Exception e){
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public static String sanitizeString(String input){
+ String temp;
+ String output;
+
+ temp = input.replace(" ", "");
+ temp = temp.replace("-", "");
+ temp = temp.replace("_", "");
+ temp = temp.replace("?", "");
+ temp = temp.replace("!", "");
+ temp = temp.replace("@", "");
+ temp = temp.replace("#", "");
+ temp = temp.replace("(", "");
+ temp = temp.replace(")", "");
+ temp = temp.replace("{", "");
+ temp = temp.replace("}", "");
+ temp = temp.replace("[", "");
+ temp = temp.replace("]", "");
+ output = temp;
+ return output;
+
+ }
+
+ public static ToolMaterial generateMaterialFromGT(Materials gtMaterial){
+ String name = gtMaterial.name();
+ int harvestLevel = gtMaterial.mToolQuality;
+ int durability = gtMaterial.mDurability;
+ float damage = gtMaterial.mToolQuality;
+ int efficiency = (int) gtMaterial.mToolSpeed;
+ int enchantability = gtMaterial.mEnchantmentToolsLevel;
+ ToolMaterial temp = EnumHelper.addToolMaterial(name, harvestLevel, durability, efficiency, damage, enchantability);
+ return temp;
+
+ }
+
+
+}
+
+
diff --git a/src/Java/gtPlusPlus/core/util/UtilsChatFormatting.java b/src/Java/gtPlusPlus/core/util/UtilsChatFormatting.java
new file mode 100644
index 0000000000..9e358b3074
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/UtilsChatFormatting.java
@@ -0,0 +1,156 @@
+package gtPlusPlus.core.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public enum UtilsChatFormatting
+{
+ BLACK('0'),
+ DARK_BLUE('1'),
+ DARK_GREEN('2'),
+ DARK_AQUA('3'),
+ DARK_RED('4'),
+ DARK_PURPLE('5'),
+ GOLD('6'),
+ GRAY('7'),
+ DARK_GRAY('8'),
+ BLUE('9'),
+ GREEN('a'),
+ AQUA('b'),
+ RED('c'),
+ LIGHT_PURPLE('d'),
+ YELLOW('e'),
+ WHITE('f'),
+ OBFUSCATED('k', true),
+ BOLD('l', true),
+ STRIKETHROUGH('m', true),
+ UNDERLINE('n', true),
+ ITALIC('o', true),
+ RESET('r');
+ /** Maps a formatting code (e.g., 'f') to its corresponding enum value (e.g., WHITE). */
+ private static final Map<Character, UtilsChatFormatting> formattingCodeMapping = new HashMap<Character, UtilsChatFormatting>();
+ /** Maps a name (e.g., 'underline') to its corresponding enum value (e.g., UNDERLINE). */
+ private static final Map<String, UtilsChatFormatting> nameMapping = new HashMap<String, UtilsChatFormatting>();
+ /**
+ * Matches formatting codes that indicate that the client should treat the following text as bold, recolored,
+ * obfuscated, etc.
+ */
+ private static final Pattern formattingCodePattern = Pattern.compile("(?i)" + String.valueOf('\u00a7') + "[0-9A-FK-OR]");
+ /** The formatting code that produces this format. */
+ private final char formattingCode;
+ private final boolean fancyStyling;
+ /**
+ * The control string (section sign + formatting code) that can be inserted into client-side text to display
+ * subsequent text in this format.
+ */
+ private final String controlString;
+
+ private UtilsChatFormatting(char p_i1336_3_)
+ {
+ this(p_i1336_3_, false);
+ }
+
+ private UtilsChatFormatting(char p_i1337_3_, boolean p_i1337_4_)
+ {
+ this.formattingCode = p_i1337_3_;
+ this.fancyStyling = p_i1337_4_;
+ this.controlString = "\u00a7" + p_i1337_3_;
+ }
+
+ /**
+ * Gets the formatting code that produces this format.
+ */
+ public char getFormattingCode()
+ {
+ return this.formattingCode;
+ }
+
+ /**
+ * False if this is just changing the color or resetting; true otherwise.
+ */
+ public boolean isFancyStyling()
+ {
+ return this.fancyStyling;
+ }
+
+ /**
+ * Checks if typo is a color.
+ */
+ public boolean isColor()
+ {
+ return !this.fancyStyling && this != RESET;
+ }
+
+ /**
+ * Gets the friendly name of this value.
+ */
+ public String getFriendlyName()
+ {
+ return this.name().toLowerCase();
+ }
+
+ @Override
+ public String toString()
+ {
+ return this.controlString;
+ }
+
+ /**
+ * Returns a copy of the given string, with formatting codes stripped away.
+ */
+ @SideOnly(Side.CLIENT)
+ public static String getTextWithoutFormattingCodes(String p_110646_0_)
+ {
+ return p_110646_0_ == null ? null : formattingCodePattern.matcher(p_110646_0_).replaceAll("");
+ }
+
+ /**
+ * Gets a value by its friendly name; null if the given name does not map to a defined value.
+ */
+ public static UtilsChatFormatting getValueByName(String p_96300_0_)
+ {
+ return p_96300_0_ == null ? null : (UtilsChatFormatting)nameMapping.get(p_96300_0_.toLowerCase());
+ }
+
+ /**
+ * Gets all the valid values. Args: @param par0: Whether or not to include color values. @param par1: Whether or not
+ * to include fancy-styling values (anything that isn't a color value or the "reset" value).
+ */
+ public static Collection<String> getValidValues(boolean p_96296_0_, boolean p_96296_1_)
+ {
+ ArrayList<String> arraylist = new ArrayList<String>();
+ UtilsChatFormatting[] aenumchatformatting = values();
+ int i = aenumchatformatting.length;
+
+ for (int j = 0; j < i; ++j)
+ {
+ UtilsChatFormatting enumchatformatting = aenumchatformatting[j];
+
+ if ((!enumchatformatting.isColor() || p_96296_0_) && (!enumchatformatting.isFancyStyling() || p_96296_1_))
+ {
+ arraylist.add(enumchatformatting.getFriendlyName());
+ }
+ }
+
+ return arraylist;
+ }
+
+ static
+ {
+ UtilsChatFormatting[] var0 = values();
+ int var1 = var0.length;
+
+ for (int var2 = 0; var2 < var1; ++var2)
+ {
+ UtilsChatFormatting var3 = var0[var2];
+ formattingCodeMapping.put(Character.valueOf(var3.getFormattingCode()), var3);
+ nameMapping.put(var3.getFriendlyName(), var3);
+ }
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/util/UtilsRarity.java b/src/Java/gtPlusPlus/core/util/UtilsRarity.java
new file mode 100644
index 0000000000..19339b7717
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/UtilsRarity.java
@@ -0,0 +1,23 @@
+package gtPlusPlus.core.util;
+
+import net.minecraft.util.EnumChatFormatting;
+
+public enum UtilsRarity
+{
+ T1_poor(EnumChatFormatting.GRAY, "Poor"),
+ T2_normal(EnumChatFormatting.WHITE, "Common"),
+ T3_uncommon(EnumChatFormatting.GREEN, "Uncommon"),
+ T4_magic(EnumChatFormatting.BLUE, "Magic"),
+ T5_rare(EnumChatFormatting.LIGHT_PURPLE, "Rare"),
+ T6_epic(EnumChatFormatting.YELLOW, "Epic"),
+ T8_unique(EnumChatFormatting.GOLD, "Unique");
+
+ public final EnumChatFormatting rarityColor;
+ public final String rarityName;
+
+ private UtilsRarity(EnumChatFormatting rarity, String name)
+ {
+ this.rarityColor = rarity;
+ this.rarityName = name;
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/util/UtilsText.java b/src/Java/gtPlusPlus/core/util/UtilsText.java
new file mode 100644
index 0000000000..e91fa95e4c
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/UtilsText.java
@@ -0,0 +1,32 @@
+package gtPlusPlus.core.util;
+
+public enum UtilsText {
+
+ blue('1'),
+ green('2'),
+ teal('3'),
+ maroon('4'),
+ purple('5'),
+ orange('6'),
+ lightGray('7'),
+ darkGray('8'),
+ lightBlue('9'),
+ black('0'),
+ lime('a'),
+ aqua('b'),
+ red('c'),
+ pink('d'),
+ yellow('e'),
+ white('f');
+
+ private char colourValue;
+ private UtilsText (char value)
+ {
+ this.colourValue = value;
+ }
+
+ public String colour() {
+ return "§"+colourValue;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/debug/DEBUG_BLOCK_ShapeSpawner.java b/src/Java/gtPlusPlus/core/util/debug/DEBUG_BLOCK_ShapeSpawner.java
new file mode 100644
index 0000000000..74df9f90ba
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/debug/DEBUG_BLOCK_ShapeSpawner.java
@@ -0,0 +1,139 @@
+package gtPlusPlus.core.util.debug;
+
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.core.util.Utils;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class DEBUG_BLOCK_ShapeSpawner extends DEBUG_MULTIBLOCK_ShapeSpawner {
+
+ private static boolean controller;
+
+ public DEBUG_BLOCK_ShapeSpawner(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public DEBUG_BLOCK_ShapeSpawner(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new DEBUG_BLOCK_ShapeSpawner(this.mName);
+ }
+
+
+ public String[] getDescription() {
+ return new String[]{
+ "Controller Block for the Testing",
+ "Create the shapes for Multiblocks.",};
+ }
+
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity arg0, byte arg1,
+ byte arg2, byte arg3, boolean arg4, boolean arg5) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean checkRecipe(ItemStack aStack) {
+ // TODO Auto-generated method stub
+ 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, 0, zDir)) {
+ return false;
+ }
+
+ int stepX = aBaseMetaTileEntity.getXCoord();
+ int stepY = aBaseMetaTileEntity.getYCoord();
+ int stepZ = aBaseMetaTileEntity.getZCoord();
+ int temp = 0;
+
+ Utils.LOG_INFO("Starting Block located @ "+"[X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]");
+
+ int tAmount = 0;
+ switch (xDir) {
+ case -1:
+ stepX++;
+ Utils.LOG_INFO("Modifying stepX + accomodate a "+xDir+" xDir - [X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]");
+ break;
+
+ case 1:
+ stepX--;
+ Utils.LOG_INFO("Modifying stepX - accomodate a "+xDir+" xDir - [X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]");
+ break;
+ }
+ switch (zDir) {
+ case -1:
+ stepZ++;
+ Utils.LOG_INFO("Modifying stepZ + accomodate a "+zDir+" zDir - [X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]");
+ break;
+
+ case 1:
+ stepZ--;
+ Utils.LOG_INFO("Modifying stepZ - accomodate a "+zDir+" zDir - [X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]");
+ break;
+ }
+
+ for (int i = stepX-1; i <= stepX+1; i++){
+ for (int j = stepZ-1; j <= stepZ+1; j++){
+ for (int h = stepY-1; h <= stepY+1; h++){
+
+
+ Utils.LOG_INFO("Block Facing - X:"+xDir+" Z:"+zDir);
+ Utils.LOG_INFO("(h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))");
+ Utils.LOG_INFO(" "+(h != 0)+" || "+(((xDir + i != 0)+" || "+(zDir + j != 0))+" && "+((i != 0)+" || "+(j != 0))));
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/debug/DEBUG_INIT.java b/src/Java/gtPlusPlus/core/util/debug/DEBUG_INIT.java
new file mode 100644
index 0000000000..440949471c
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/debug/DEBUG_INIT.java
@@ -0,0 +1,43 @@
+package gtPlusPlus.core.util.debug;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.item.base.BaseItemWithCharge;
+import gtPlusPlus.core.item.general.BedLocator_Base;
+import gtPlusPlus.core.lib.CORE;
+import net.minecraftforge.common.MinecraftForge;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class DEBUG_INIT {
+
+ public static void registerBlocks(){
+ //Debug Loading
+ if (CORE.DEBUG){
+
+ }
+ }
+
+ public static void registerItems(){
+ ModItems.itemDebugShapeSpawner = new DEBUG_ITEM_ShapeSpawner("itemDebugShapeSpawner", AddToCreativeTab.tabMisc, 1, 500);
+ GameRegistry.registerItem(ModItems.itemDebugShapeSpawner, "itemDebugShapeSpawner");
+ ModItems.itemBedLocator_Base = new BedLocator_Base("itemBedLocator_Base");
+ GameRegistry.registerItem(ModItems.itemBedLocator_Base, "itemBedLocator_Base");
+ ModItems.itemBaseItemWithCharge = new BaseItemWithCharge("itemBaseItemWithCharge", 0, 1000);
+ GameRegistry.registerItem(ModItems.itemBaseItemWithCharge, "itemBaseItemWithCharge");
+ }
+
+ public static void registerTEs(){
+
+ }
+
+ public static void registerMisc(){
+
+
+
+ }
+
+ public static void registerHandlers(){
+ MinecraftForge.EVENT_BUS.register(new DEBUG_ScreenOverlay());
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/debug/DEBUG_ITEM_ShapeSpawner.java b/src/Java/gtPlusPlus/core/util/debug/DEBUG_ITEM_ShapeSpawner.java
new file mode 100644
index 0000000000..bfaa7404e1
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/debug/DEBUG_ITEM_ShapeSpawner.java
@@ -0,0 +1,55 @@
+package gtPlusPlus.core.util.debug;
+
+import static net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK;
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.BaseItemGeneric;
+import gtPlusPlus.core.util.Utils;
+
+import java.util.List;
+
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.world.World;
+import net.minecraftforge.event.entity.player.PlayerInteractEvent;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+
+public class DEBUG_ITEM_ShapeSpawner extends BaseItemGeneric{
+
+ public DEBUG_ITEM_ShapeSpawner(String s, CreativeTabs c, int stackSize, int maxDmg) {
+ super(s, c, stackSize, maxDmg);
+ s = "itemDebugShapeSpawner";
+ c = AddToCreativeTab.tabMisc;
+ stackSize = 1;
+ maxDmg = 500;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){
+
+ if (!world.isRemote){
+ Utils.LOG_INFO("Constructing the shape for the "+"VACUUM FREEZER");
+ Thread thread = new Thread(new DEBUG_TimerThread(world, player));
+ thread.start();
+ }
+ return stack;
+ }
+
+
+
+ @SuppressWarnings("static-method")
+ @SubscribeEvent
+ public void playerInteractEventHandler(PlayerInteractEvent event)
+ {
+ if (event.isCanceled() || event.world.isRemote || event.action != RIGHT_CLICK_BLOCK) return;
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void addInformation(ItemStack stack, EntityPlayer aPlayer, List list, boolean bool) {
+ list.add(EnumChatFormatting.GOLD+"For Testing Gregtech Shapes!");
+ super.addInformation(stack, aPlayer, list, bool);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/debug/DEBUG_MULTIBLOCK_ShapeSpawner.java b/src/Java/gtPlusPlus/core/util/debug/DEBUG_MULTIBLOCK_ShapeSpawner.java
new file mode 100644
index 0000000000..78acb27cfb
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/debug/DEBUG_MULTIBLOCK_ShapeSpawner.java
@@ -0,0 +1,805 @@
+package gtPlusPlus.core.util.debug;
+
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.gui.GT_Container_MultiMachine;
+import gregtech.api.gui.GT_GUIContainer_MultiMachine;
+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.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.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.items.GT_MetaGenerated_Tool_01;
+
+import java.util.ArrayList;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.fluids.FluidStack;
+
+public abstract class DEBUG_MULTIBLOCK_ShapeSpawner extends MetaTileEntity {
+
+ public static boolean disableMaintenance;
+ public boolean mMachine = false, mWrench = false, mScrewdriver = false, mSoftHammer = false, mHardHammer = false, mSolderingTool = false, 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 DEBUG_MULTIBLOCK_ShapeSpawner(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, 2);
+ this.disableMaintenance = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "MultiBlockMachines.disableMaintenance", false);
+ }
+
+ public DEBUG_MULTIBLOCK_ShapeSpawner(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 GT_Container_MultiMachine(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_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 = false;
+ 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 (!isCorrectMachinePart(mInventory[1]) || 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 = false;
+ 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;
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/util/debug/DEBUG_ScreenOverlay.java b/src/Java/gtPlusPlus/core/util/debug/DEBUG_ScreenOverlay.java
new file mode 100644
index 0000000000..9153543eaf
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/debug/DEBUG_ScreenOverlay.java
@@ -0,0 +1,45 @@
+package gtPlusPlus.core.util.debug;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.gui.Gui;
+import net.minecraft.client.gui.ScaledResolution;
+import net.minecraft.item.Item;
+import net.minecraftforge.client.event.RenderGameOverlayEvent;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+
+public class DEBUG_ScreenOverlay extends Gui {
+
+ int width, height;
+ Minecraft mc = Minecraft.getMinecraft();
+
+ @SubscribeEvent
+ public void eventHandler(RenderGameOverlayEvent.Text event)
+ {
+
+ //if (mc.thePlayer.getHeldItem().equals(ModItems.itemStaballoyPickaxe)){
+ ScaledResolution res = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
+ FontRenderer fontRender = mc.fontRenderer;
+ this.width = res.getScaledWidth();
+ this.height = res.getScaledHeight();
+ Minecraft.getMinecraft().entityRenderer.setupOverlayRendering();
+ String str = "Words";
+ Item heldItem = null;
+
+ try{heldItem = mc.thePlayer.getHeldItem().getItem();
+
+ if (heldItem != null){
+ /*if (heldItem instanceof StaballoyPickaxe){
+
+ int dmg =((StaballoyPickaxe) heldItem).getDamage(((StaballoyPickaxe) heldItem).thisPickaxe);
+
+ ((StaballoyPickaxe) heldItem).checkFacing(((StaballoyPickaxe) heldItem).localWorld);
+ str = "DAMAGE: "+ dmg +" | FACING: "+((StaballoyPickaxe) heldItem).FACING+" | FACING_HORIZONTAL: "+((StaballoyPickaxe) heldItem).FACING_HORIZONTAL+" | LOOKING DIRECTION: "+((StaballoyPickaxe) heldItem).lookingDirection;
+
+ drawString(fontRender, str, (this.width - fontRender.getStringWidth(str)) / 2, this.height / 10, 0xFFAA00);
+ }*/
+ }
+ }catch(NullPointerException e){}
+
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/util/debug/DEBUG_TimerThread.java b/src/Java/gtPlusPlus/core/util/debug/DEBUG_TimerThread.java
new file mode 100644
index 0000000000..1eb69eb11b
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/debug/DEBUG_TimerThread.java
@@ -0,0 +1,64 @@
+package gtPlusPlus.core.util.debug;
+
+import gtPlusPlus.core.util.Utils;
+
+import java.util.concurrent.TimeUnit;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class DEBUG_TimerThread implements Runnable {
+
+ private World world;
+ private EntityPlayer player;
+
+
+ public DEBUG_TimerThread(World WORLD, EntityPlayer PLAYER) {
+ world = WORLD;
+ player = PLAYER;
+ }
+
+ @Override
+ public void run(){
+ int xDir = ForgeDirection.getOrientation(player.getPlayerCoordinates().posX).offsetX;
+ int zDir = ForgeDirection.getOrientation(player.getPlayerCoordinates().posZ).offsetZ;
+
+ int stepX = Minecraft.getMinecraft().objectMouseOver.blockX;
+ int stepY = Minecraft.getMinecraft().objectMouseOver.blockY;
+ int stepZ = Minecraft.getMinecraft().objectMouseOver.blockZ;
+ Utils.LOG_INFO("Clicked on a Block @ "+"[X:"+stepX+"][Y:"+stepY+"][Z:"+stepZ+"]"+" with xDir:"+xDir+" zDir:"+zDir);
+ world.setBlock(stepX, stepY, stepZ, Blocks.bedrock,0,3);
+ Utils.LOG_INFO("Makng it Bedrock for future investment.");
+ //for (int i = -1; i <= 1; i++) {
+ //stepX = stepX+i;
+ for (int i = stepX-1; i <= stepX+1; i++){
+ for (int j = stepZ-1; j <= stepZ+1; j++){
+ for (int h = stepY-1; h <= stepY+1; h++){
+
+ xDir = ForgeDirection.getOrientation(player.getPlayerCoordinates().posX).offsetX;
+ zDir = ForgeDirection.getOrientation(player.getPlayerCoordinates().posZ).offsetZ;
+
+ //for (int j = -1; j <= 1; j++) {
+ //stepZ = stepZ+j;
+ //for (int h = -1; h <= 1; h++) {
+ //stepY = stepY+h;
+ Utils.LOG_INFO("Placing Block @ "+"[X:"+i+"][Y:"+h+"][Z:"+j+"]"+" with xDir:"+xDir+" zDir:"+zDir);
+ if ((h != 0) || (((xDir + i != 0) || (zDir + j != 0)) && ((i != 0) || (j != 0)))) {
+ world.setBlock(i, h, j, Blocks.stone,0,3);
+ }
+ else {
+ Utils.LOG_INFO("Not even sure what this is for, but I got here.");
+ }
+ try {
+ TimeUnit.MILLISECONDS.sleep(500);
+ } catch (InterruptedException e1) {
+ e1.printStackTrace();
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/util/debug/UtilityGL11Debug.java b/src/Java/gtPlusPlus/core/util/debug/UtilityGL11Debug.java
new file mode 100644
index 0000000000..59c652d73b
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/debug/UtilityGL11Debug.java
@@ -0,0 +1,343 @@
+package gtPlusPlus.core.util.debug;
+
+import java.nio.ByteBuffer;
+
+import org.lwjgl.BufferUtils;
+import org.lwjgl.opengl.GL11;
+
+
+/**
+ * User: The Grey Ghost
+ * Date: 9/02/14
+ */
+public class UtilityGL11Debug
+{
+ public class GLproperty
+ {
+ public GLproperty(int init_gLconstant, String init_name, String init_description, String init_category, String init_fetchCommand) {
+ gLconstant = init_gLconstant;
+ name = init_name;
+ description = init_description;
+ category = init_category;
+ fetchCommand = init_fetchCommand;
+ }
+
+ public int gLconstant;
+ public String name;
+ public String description;
+ public String category;
+ public String fetchCommand;
+ }
+
+ public static UtilityGL11Debug instance = new UtilityGL11Debug();
+
+ public GLproperty[] propertyList =
+
+ {
+ new GLproperty(GL11.GL_CURRENT_COLOR, "GL_CURRENT_COLOR", "Current color", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_INDEX, "GL_CURRENT_INDEX", "Current color index", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_TEXTURE_COORDS, "GL_CURRENT_TEXTURE_COORDS", "Current texture coordinates", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_NORMAL, "GL_CURRENT_NORMAL", "Current normal", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_RASTER_POSITION, "GL_CURRENT_RASTER_POSITION", "Current raster position", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_RASTER_DISTANCE, "GL_CURRENT_RASTER_DISTANCE", "Current raster distance", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_RASTER_COLOR, "GL_CURRENT_RASTER_COLOR", "Color associated with raster position", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_RASTER_INDEX, "GL_CURRENT_RASTER_INDEX", "Color index associated with raster position", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_RASTER_TEXTURE_COORDS, "GL_CURRENT_RASTER_TEXTURE_COORDS", "Texture coordinates associated with raster position", "current", "glGetFloatv()"),
+ new GLproperty(GL11.GL_CURRENT_RASTER_POSITION_VALID, "GL_CURRENT_RASTER_POSITION_VALID", "Raster position valid bit", "current", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_EDGE_FLAG, "GL_EDGE_FLAG", "Edge flag", "current", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_VERTEX_ARRAY, "GL_VERTEX_ARRAY", "Vertex array enable", "vertex-array", "glIsEnabled()"),
+ new GLproperty(GL11.GL_VERTEX_ARRAY_SIZE, "GL_VERTEX_ARRAY_SIZE", "Coordinates per vertex", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_VERTEX_ARRAY_TYPE, "GL_VERTEX_ARRAY_TYPE", "Type of vertex coordinates", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_VERTEX_ARRAY_STRIDE, "GL_VERTEX_ARRAY_STRIDE", "Stride between vertices", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_VERTEX_ARRAY_POINTER, "GL_VERTEX_ARRAY_POINTER", "Pointer to the vertex array", "vertex-array", "glGetPointerv()"),
+ new GLproperty(GL11.GL_NORMAL_ARRAY, "GL_NORMAL_ARRAY", "Normal array enable", "vertex-array", "glIsEnabled()"),
+ new GLproperty(GL11.GL_NORMAL_ARRAY_TYPE, "GL_NORMAL_ARRAY_TYPE", "Type of normal coordinates", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_NORMAL_ARRAY_STRIDE, "GL_NORMAL_ARRAY_STRIDE", "Stride between normals", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_NORMAL_ARRAY_POINTER, "GL_NORMAL_ARRAY_POINTER", "Pointer to the normal array", "vertex-array", "glGetPointerv()"),
+ new GLproperty(GL11.GL_COLOR_ARRAY, "GL_COLOR_ARRAY", "RGBA color array enable", "vertex-array", "glIsEnabled()"),
+ new GLproperty(GL11.GL_COLOR_ARRAY_SIZE, "GL_COLOR_ARRAY_SIZE", "Colors per vertex", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_COLOR_ARRAY_TYPE, "GL_COLOR_ARRAY_TYPE", "Type of color components", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_COLOR_ARRAY_STRIDE, "GL_COLOR_ARRAY_STRIDE", "Stride between colors", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_COLOR_ARRAY_POINTER, "GL_COLOR_ARRAY_POINTER", "Pointer to the color array", "vertex-array", "glGetPointerv()"),
+ new GLproperty(GL11.GL_INDEX_ARRAY, "GL_INDEX_ARRAY", "Color-index array enable", "vertex-array", "glIsEnabled()"),
+ new GLproperty(GL11.GL_INDEX_ARRAY_TYPE, "GL_INDEX_ARRAY_TYPE", "Type of color indices", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_INDEX_ARRAY_STRIDE, "GL_INDEX_ARRAY_STRIDE", "Stride between color indices", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_INDEX_ARRAY_POINTER, "GL_INDEX_ARRAY_POINTER", "Pointer to the index array", "vertex-array", "glGetPointerv()"),
+ new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY, "GL_TEXTURE_COORD_ARRAY", "Texture coordinate array enable", "vertex-array", "glIsEnabled()"),
+ new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY_SIZE, "GL_TEXTURE_COORD_ARRAY_SIZE", "Texture coordinates per element", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY_TYPE, "GL_TEXTURE_COORD_ARRAY_TYPE", "Type of texture coordinates", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY_STRIDE, "GL_TEXTURE_COORD_ARRAY_STRIDE", "Stride between texture coordinates", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_TEXTURE_COORD_ARRAY_POINTER, "GL_TEXTURE_COORD_ARRAY_POINTER", "Pointer to the texture coordinate array", "vertex-array", "glGetPointerv()"),
+ new GLproperty(GL11.GL_EDGE_FLAG_ARRAY, "GL_EDGE_FLAG_ARRAY", "Edge flag array enable", "vertex-array", "glIsEnabled()"),
+ new GLproperty(GL11.GL_EDGE_FLAG_ARRAY_STRIDE, "GL_EDGE_FLAG_ARRAY_STRIDE", "Stride between edge flags", "vertex-array", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_EDGE_FLAG_ARRAY_POINTER, "GL_EDGE_FLAG_ARRAY_POINTER", "Pointer to the edge flag array", "vertex-array", "glGetPointerv()"),
+ new GLproperty(GL11.GL_MODELVIEW_MATRIX, "GL_MODELVIEW_MATRIX", "Modelview matrix stack", "matrix", "glGetFloatv()"),
+ new GLproperty(GL11.GL_PROJECTION_MATRIX, "GL_PROJECTION_MATRIX", "Projection matrix stack", "matrix", "glGetFloatv()"),
+ new GLproperty(GL11.GL_TEXTURE_MATRIX, "GL_TEXTURE_MATRIX", "Texture matrix stack", "matrix", "glGetFloatv()"),
+ new GLproperty(GL11.GL_VIEWPORT, "GL_VIEWPORT", "Viewport origin and extent", "viewport", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_DEPTH_RANGE, "GL_DEPTH_RANGE", "Depth range near and far", "viewport", "glGetFloatv()"),
+ new GLproperty(GL11.GL_MODELVIEW_STACK_DEPTH, "GL_MODELVIEW_STACK_DEPTH", "Modelview matrix stack pointer", "matrix", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_PROJECTION_STACK_DEPTH, "GL_PROJECTION_STACK_DEPTH", "Projection matrix stack pointer", "matrix", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_TEXTURE_STACK_DEPTH, "GL_TEXTURE_STACK_DEPTH", "Texture matrix stack pointer", "matrix", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MATRIX_MODE, "GL_MATRIX_MODE", "Current matrix mode", "transform", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_NORMALIZE, "GL_NORMALIZE", "Current normal normalization on/off", "transform/ enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_FOG_COLOR, "GL_FOG_COLOR", "Fog color", "fog", "glGetFloatv()"),
+ new GLproperty(GL11.GL_FOG_INDEX, "GL_FOG_INDEX", "Fog index", "fog", "glGetFloatv()"),
+ new GLproperty(GL11.GL_FOG_DENSITY, "GL_FOG_DENSITY", "Exponential fog density", "fog", "glGetFloatv()"),
+ new GLproperty(GL11.GL_FOG_START, "GL_FOG_START", "Linear fog start", "fog", "glGetFloatv()"),
+ new GLproperty(GL11.GL_FOG_END, "GL_FOG_END", "Linear fog end", "fog", "glGetFloatv()"),
+ new GLproperty(GL11.GL_FOG_MODE, "GL_FOG_MODE", "Fog mode", "fog", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_FOG, "GL_FOG", "True if fog enabled", "fog/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_SHADE_MODEL, "GL_SHADE_MODEL", "glShadeModel() setting", "lighting", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_LIGHTING, "GL_LIGHTING", "True if lighting is enabled", "lighting/e nable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_COLOR_MATERIAL, "GL_COLOR_MATERIAL", "True if color tracking is enabled", "lighting", "glIsEnabled()"),
+ new GLproperty(GL11.GL_COLOR_MATERIAL_PARAMETER, "GL_COLOR_MATERIAL_PARAMETER", "Material properties tracking current color", "lighting", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_COLOR_MATERIAL_FACE, "GL_COLOR_MATERIAL_FACE", "Face(s) affected by color tracking", "lighting", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_AMBIENT, "GL_AMBIENT", "Ambient material color", "lighting", "glGetMaterialfv()"),
+ new GLproperty(GL11.GL_DIFFUSE, "GL_DIFFUSE", "Diffuse material color", "lighting", "glGetMaterialfv()"),
+ new GLproperty(GL11.GL_SPECULAR, "GL_SPECULAR", "Specular material color", "lighting", "glGetMaterialfv()"),
+ new GLproperty(GL11.GL_EMISSION, "GL_EMISSION", "Emissive material color", "lighting", "glGetMaterialfv()"),
+ new GLproperty(GL11.GL_SHININESS, "GL_SHININESS", "Specular exponent of material", "lighting", "glGetMaterialfv()"),
+ new GLproperty(GL11.GL_LIGHT_MODEL_AMBIENT, "GL_LIGHT_MODEL_AMBIENT", "Ambient scene color", "lighting", "glGetFloatv()"),
+ new GLproperty(GL11.GL_LIGHT_MODEL_LOCAL_VIEWER, "GL_LIGHT_MODEL_LOCAL_VIEWER", "Viewer is local", "lighting", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_LIGHT_MODEL_TWO_SIDE, "GL_LIGHT_MODEL_TWO_SIDE", "Use two-sided lighting", "lighting", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_AMBIENT, "GL_AMBIENT", "Ambient intensity of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_DIFFUSE, "GL_DIFFUSE", "Diffuse intensity of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_SPECULAR, "GL_SPECULAR", "Specular intensity of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_POSITION, "GL_POSITION", "Position of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_CONSTANT_ATTENUATION, "GL_CONSTANT_ATTENUATION", "Constant attenuation factor", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_LINEAR_ATTENUATION, "GL_LINEAR_ATTENUATION", "Linear attenuation factor", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_QUADRATIC_ATTENUATION, "GL_QUADRATIC_ATTENUATION", "Quadratic attenuation factor", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_SPOT_DIRECTION, "GL_SPOT_DIRECTION", "Spotlight direction of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_SPOT_EXPONENT, "GL_SPOT_EXPONENT", "Spotlight exponent of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_SPOT_CUTOFF, "GL_SPOT_CUTOFF", "Spotlight angle of light i", "lighting", "glGetLightfv()"),
+ new GLproperty(GL11.GL_LIGHT0, "GL_LIGHT0", "True if light 0 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT1, "GL_LIGHT1", "True if light 1 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT2, "GL_LIGHT2", "True if light 2 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT3, "GL_LIGHT3", "True if light 3 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT4, "GL_LIGHT4", "True if light 4 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT5, "GL_LIGHT5", "True if light 5 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT6, "GL_LIGHT6", "True if light 6 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LIGHT7, "GL_LIGHT7", "True if light 7 enabled", "lighting/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_COLOR_INDEXES, "GL_COLOR_INDEXES", "ca, cd, and cs for color-index lighting", "lighting/e nable", "glGetMaterialfv()"),
+ new GLproperty(GL11.GL_POINT_SIZE, "GL_POINT_SIZE", "Point size", "point", "glGetFloatv()"),
+ new GLproperty(GL11.GL_POINT_SMOOTH, "GL_POINT_SMOOTH", "Point antialiasing on", "point/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LINE_WIDTH, "GL_LINE_WIDTH", "Line width", "line", "glGetFloatv()"),
+ new GLproperty(GL11.GL_LINE_SMOOTH, "GL_LINE_SMOOTH", "Line antialiasing on", "line/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LINE_STIPPLE_PATTERN, "GL_LINE_STIPPLE_PATTERN", "Line stipple", "line", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_LINE_STIPPLE_REPEAT, "GL_LINE_STIPPLE_REPEAT", "Line stipple repeat", "line", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_LINE_STIPPLE, "GL_LINE_STIPPLE", "Line stipple enable", "line/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_CULL_FACE, "GL_CULL_FACE", "Polygon culling enabled", "polygon/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_CULL_FACE_MODE, "GL_CULL_FACE_MODE", "Cull front-/back-facing polygons", "polygon", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_FRONT_FACE, "GL_FRONT_FACE", "Polygon front-face CW/CCW indicator", "polygon", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_POLYGON_SMOOTH, "GL_POLYGON_SMOOTH", "Polygon antialiasing on", "polygon/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_POLYGON_MODE, "GL_POLYGON_MODE", "Polygon rasterization mode (front and back)", "polygon", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_POLYGON_OFFSET_FACTOR, "GL_POLYGON_OFFSET_FACTOR", "Polygon offset factor", "polygon", "glGetFloatv()"),
+ new GLproperty(GL11.GL_POLYGON_OFFSET_POINT, "GL_POLYGON_OFFSET_POINT", "Polygon offset enable for GL_POINT mode rasterization", "polygon/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_POLYGON_OFFSET_LINE, "GL_POLYGON_OFFSET_LINE", "Polygon offset enable for GL_LINE mode rasterization", "polygon/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_POLYGON_OFFSET_FILL, "GL_POLYGON_OFFSET_FILL", "Polygon offset enable for GL_FILL mode rasterization", "polygon/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_POLYGON_STIPPLE, "GL_POLYGON_STIPPLE", "Polygon stipple enable", "polygon/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_TEXTURE_1D, "GL_TEXTURE_1D", "True if 1-D texturing enabled ", "texture/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_TEXTURE_2D, "GL_TEXTURE_2D", "True if 2-D texturing enabled ", "texture/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_TEXTURE_BINDING_1D, "GL_TEXTURE_BINDING_1D", "Texture object bound to GL_TEXTURE_1D", "texture", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_TEXTURE_BINDING_2D, "GL_TEXTURE_BINDING_2D", "Texture object bound to GL_TEXTURE_2D", "texture", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_TEXTURE, "GL_TEXTURE", "x-D texture image at level of detail i", "UNUSED", "glGetTexImage()"),
+ new GLproperty(GL11.GL_TEXTURE_WIDTH, "GL_TEXTURE_WIDTH", "x-D texture image i's width", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_HEIGHT, "GL_TEXTURE_HEIGHT", "x-D texture image i's height", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_BORDER, "GL_TEXTURE_BORDER", "x-D texture image i's border width", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_RED_SIZE, "GL_TEXTURE_RED_SIZE", "x-D texture image i's red resolution", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_GREEN_SIZE, "GL_TEXTURE_GREEN_SIZE", "x-D texture image i's green resolution", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_BLUE_SIZE, "GL_TEXTURE_BLUE_SIZE", "x-D texture image i's blue resolution", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_ALPHA_SIZE, "GL_TEXTURE_ALPHA_SIZE", "x-D texture image i's alpha resolution", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_LUMINANCE_SIZE, "GL_TEXTURE_LUMINANCE_SIZE", "x-D texture image i's luminance resolution", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_INTENSITY_SIZE, "GL_TEXTURE_INTENSITY_SIZE", "x-D texture image i's intensity resolution", "UNUSED", "glGetTexLevelParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_BORDER_COLOR, "GL_TEXTURE_BORDER_COLOR", "Texture border color", "texture", "glGetTexParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_MIN_FILTER, "GL_TEXTURE_MIN_FILTER", "Texture minification function", "texture", "glGetTexParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_MAG_FILTER, "GL_TEXTURE_MAG_FILTER", "Texture magnification function", "texture", "glGetTexParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_WRAP_S, "GL_TEXTURE_WRAP_S", "Texture wrap mode (x is S or T)", "texture", "glGetTexParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_WRAP_T, "GL_TEXTURE_WRAP_T", "Texture wrap mode (x is S or T)", "texture", "glGetTexParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_PRIORITY, "GL_TEXTURE_PRIORITY", "Texture object priority", "texture", "glGetTexParameter*()"),
+ new GLproperty(GL11.GL_TEXTURE_ENV_MODE, "GL_TEXTURE_ENV_MODE", "Texture application function", "texture", "glGetTexEnviv()"),
+ new GLproperty(GL11.GL_TEXTURE_ENV_COLOR, "GL_TEXTURE_ENV_COLOR", "Texture environment color", "texture", "glGetTexEnvfv()"),
+ new GLproperty(GL11.GL_TEXTURE_GEN_S, "GL_TEXTURE_GEN_S", "Texgen enabled (x is S, T, R, or Q)", "texture/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_TEXTURE_GEN_T, "GL_TEXTURE_GEN_T", "Texgen enabled (x is S, T, R, or Q)", "texture/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_TEXTURE_GEN_R, "GL_TEXTURE_GEN_R", "Texgen enabled (x is S, T, R, or Q)", "texture/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_TEXTURE_GEN_Q, "GL_TEXTURE_GEN_Q", "Texgen enabled (x is S, T, R, or Q)", "texture/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_EYE_PLANE, "GL_EYE_PLANE", "Texgen plane equation coefficients", "texture", "glGetTexGenfv()"),
+ new GLproperty(GL11.GL_OBJECT_PLANE, "GL_OBJECT_PLANE", "Texgen object linear coefficients", "texture", "glGetTexGenfv()"),
+ new GLproperty(GL11.GL_TEXTURE_GEN_MODE, "GL_TEXTURE_GEN_MODE", "Function used for texgen", "texture", "glGetTexGeniv()"),
+ new GLproperty(GL11.GL_SCISSOR_TEST, "GL_SCISSOR_TEST", "Scissoring enabled", "scissor/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_SCISSOR_BOX, "GL_SCISSOR_BOX", "Scissor box", "scissor", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ALPHA_TEST, "GL_ALPHA_TEST", "Alpha test enabled", "color-buffer/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_ALPHA_TEST_FUNC, "GL_ALPHA_TEST_FUNC", "Alpha test function", "color-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ALPHA_TEST_REF, "GL_ALPHA_TEST_REF", "Alpha test reference value", "color-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_STENCIL_TEST, "GL_STENCIL_TEST", "Stenciling enabled", "stencil-buffer/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_STENCIL_FUNC, "GL_STENCIL_FUNC", "Stencil function", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_STENCIL_VALUE_MASK, "GL_STENCIL_VALUE_MASK", "Stencil mask", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_STENCIL_REF, "GL_STENCIL_REF", "Stencil reference value", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_STENCIL_FAIL, "GL_STENCIL_FAIL", "Stencil fail action", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_STENCIL_PASS_DEPTH_FAIL, "GL_STENCIL_PASS_DEPTH_FAIL", "Stencil depth buffer fail action", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_STENCIL_PASS_DEPTH_PASS, "GL_STENCIL_PASS_DEPTH_PASS", "Stencil depth buffer pass action", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_DEPTH_TEST, "GL_DEPTH_TEST", "Depth buffer enabled", "depth-buffer/ena ble", "glIsEnabled()"),
+ new GLproperty(GL11.GL_DEPTH_FUNC, "GL_DEPTH_FUNC", "Depth buffer test function", "depth-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_BLEND, "GL_BLEND", "Blending enabled", "color-buffer/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_BLEND_SRC, "GL_BLEND_SRC", "Blending source function", "color-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_BLEND_DST, "GL_BLEND_DST", "Blending destination function", "color-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_DITHER, "GL_DITHER", "Dithering enabled", "color-buffer/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_INDEX_LOGIC_OP, "GL_INDEX_LOGIC_OP", "Color index logical operation enabled", "color-buffer/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_COLOR_LOGIC_OP, "GL_COLOR_LOGIC_OP", "RGBA color logical operation enabled", "color-buffer/enable", "glIsEnabled()"),
+ new GLproperty(GL11.GL_LOGIC_OP_MODE, "GL_LOGIC_OP_MODE", "Logical operation function", "color-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_DRAW_BUFFER, "GL_DRAW_BUFFER", "Buffers selected for drawing", "color-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_INDEX_WRITEMASK, "GL_INDEX_WRITEMASK", "Color-index writemask", "color-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_COLOR_WRITEMASK, "GL_COLOR_WRITEMASK", "Color write enables; R, G, B, or A", "color-buffer", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_DEPTH_WRITEMASK, "GL_DEPTH_WRITEMASK", "Depth buffer enabled for writing", "depth-buffer", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_STENCIL_WRITEMASK, "GL_STENCIL_WRITEMASK", "Stencil-buffer writemask", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_COLOR_CLEAR_VALUE, "GL_COLOR_CLEAR_VALUE", "Color-buffer clear value (RGBA mode)", "color-buffer", "glGetFloatv()"),
+ new GLproperty(GL11.GL_INDEX_CLEAR_VALUE, "GL_INDEX_CLEAR_VALUE", "Color-buffer clear value (color-index mode)", "color-buffer", "glGetFloatv()"),
+ new GLproperty(GL11.GL_DEPTH_CLEAR_VALUE, "GL_DEPTH_CLEAR_VALUE", "Depth-buffer clear value", "depth-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_STENCIL_CLEAR_VALUE, "GL_STENCIL_CLEAR_VALUE", "Stencil-buffer clear value", "stencil-buffer", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ACCUM_CLEAR_VALUE, "GL_ACCUM_CLEAR_VALUE", "Accumulation-buffer clear value", "accum-buffer", "glGetFloatv()"),
+ new GLproperty(GL11.GL_UNPACK_SWAP_BYTES, "GL_UNPACK_SWAP_BYTES", "Value of GL_UNPACK_SWAP_BYTES", "pixel-store", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_UNPACK_LSB_FIRST, "GL_UNPACK_LSB_FIRST", "Value of GL_UNPACK_LSB_FIRST", "pixel-store", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_UNPACK_ROW_LENGTH, "GL_UNPACK_ROW_LENGTH", "Value of GL_UNPACK_ROW_LENGTH", "pixel-store", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_UNPACK_SKIP_ROWS, "GL_UNPACK_SKIP_ROWS", "Value of GL_UNPACK_SKIP_ROWS", "pixel-store", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_UNPACK_SKIP_PIXELS, "GL_UNPACK_SKIP_PIXELS", "Value of GL_UNPACK_SKIP_PIXELS", "pixel-store", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_UNPACK_ALIGNMENT, "GL_UNPACK_ALIGNMENT", "Value of GL_UNPACK_ALIGNMENT", "pixel-store", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_PACK_SWAP_BYTES, "GL_PACK_SWAP_BYTES", "Value of GL_PACK_SWAP_BYTES", "pixel-store", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_PACK_LSB_FIRST, "GL_PACK_LSB_FIRST", "Value of GL_PACK_LSB_FIRST", "pixel-store", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_PACK_ROW_LENGTH, "GL_PACK_ROW_LENGTH", "Value of GL_PACK_ROW_LENGTH", "pixel-store", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_PACK_SKIP_ROWS, "GL_PACK_SKIP_ROWS", "Value of GL_PACK_SKIP_ROWS", "pixel-store", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_PACK_SKIP_PIXELS, "GL_PACK_SKIP_PIXELS", "Value of GL_PACK_SKIP_PIXELS", "pixel-store", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_PACK_ALIGNMENT, "GL_PACK_ALIGNMENT", "Value of GL_PACK_ALIGNMENT", "pixel-store", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAP_COLOR, "GL_MAP_COLOR", "True if colors are mapped", "pixel", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_MAP_STENCIL, "GL_MAP_STENCIL", "True if stencil values are mapped", "pixel", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_INDEX_SHIFT, "GL_INDEX_SHIFT", "Value of GL_INDEX_SHIFT", "pixel", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_INDEX_OFFSET, "GL_INDEX_OFFSET", "Value of GL_INDEX_OFFSET", "pixel", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ZOOM_X, "GL_ZOOM_X", "x zoom factor", "pixel", "glGetFloatv()"),
+ new GLproperty(GL11.GL_ZOOM_Y, "GL_ZOOM_Y", "y zoom factor", "pixel", "glGetFloatv()"),
+ new GLproperty(GL11.GL_READ_BUFFER, "GL_READ_BUFFER", "Read source buffer", "pixel", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ORDER, "GL_ORDER", "1D map order", "capability", "glGetMapiv()"),
+ new GLproperty(GL11.GL_ORDER, "GL_ORDER", "2D map orders", "capability", "glGetMapiv()"),
+ new GLproperty(GL11.GL_COEFF, "GL_COEFF", "1D control points", "capability", "glGetMapfv()"),
+ new GLproperty(GL11.GL_COEFF, "GL_COEFF", "2D control points", "capability", "glGetMapfv()"),
+ new GLproperty(GL11.GL_DOMAIN, "GL_DOMAIN", "1D domain endpoints", "capability", "glGetMapfv()"),
+ new GLproperty(GL11.GL_DOMAIN, "GL_DOMAIN", "2D domain endpoints", "capability", "glGetMapfv()"),
+ new GLproperty(GL11.GL_MAP1_GRID_DOMAIN, "GL_MAP1_GRID_DOMAIN", "1D grid endpoints", "eval", "glGetFloatv()"),
+ new GLproperty(GL11.GL_MAP2_GRID_DOMAIN, "GL_MAP2_GRID_DOMAIN", "2D grid endpoints", "eval", "glGetFloatv()"),
+ new GLproperty(GL11.GL_MAP1_GRID_SEGMENTS, "GL_MAP1_GRID_SEGMENTS", "1D grid divisions", "eval", "glGetFloatv()"),
+ new GLproperty(GL11.GL_MAP2_GRID_SEGMENTS, "GL_MAP2_GRID_SEGMENTS", "2D grid divisions", "eval", "glGetFloatv()"),
+ new GLproperty(GL11.GL_AUTO_NORMAL, "GL_AUTO_NORMAL", "True if automatic normal generation enabled", "eval", "glIsEnabled()"),
+ new GLproperty(GL11.GL_PERSPECTIVE_CORRECTION_HINT, "GL_PERSPECTIVE_CORRECTION_HINT", "Perspective correction hint", "hint", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_POINT_SMOOTH_HINT, "GL_POINT_SMOOTH_HINT", "Point smooth hint", "hint", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_LINE_SMOOTH_HINT, "GL_LINE_SMOOTH_HINT", "Line smooth hint", "hint", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_POLYGON_SMOOTH_HINT, "GL_POLYGON_SMOOTH_HINT", "Polygon smooth hint", "hint", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_FOG_HINT, "GL_FOG_HINT", "Fog hint", "hint", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_LIGHTS, "GL_MAX_LIGHTS", "Maximum number of lights", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_CLIP_PLANES, "GL_MAX_CLIP_PLANES", "Maximum number of user clipping planes", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_MODELVIEW_STACK_DEPTH, "GL_MAX_MODELVIEW_STACK_DEPTH", "Maximum modelview-matrix stack depth", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_PROJECTION_STACK_DEPTH, "GL_MAX_PROJECTION_STACK_DEPTH", "Maximum projection-matrix stack depth", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_TEXTURE_STACK_DEPTH, "GL_MAX_TEXTURE_STACK_DEPTH", "Maximum depth of texture matrix stack", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_SUBPIXEL_BITS, "GL_SUBPIXEL_BITS", "Number of bits of subpixel precision in x and y", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_TEXTURE_SIZE, "GL_MAX_TEXTURE_SIZE", "See discussion in Texture Proxy in Chapter 9", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_PIXEL_MAP_TABLE, "GL_MAX_PIXEL_MAP_TABLE", "Maximum size of a glPixelMap() translation table", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_NAME_STACK_DEPTH, "GL_MAX_NAME_STACK_DEPTH", "Maximum selection-name stack depth", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_LIST_NESTING, "GL_MAX_LIST_NESTING", "Maximum display-list call nesting", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_EVAL_ORDER, "GL_MAX_EVAL_ORDER", "Maximum evaluator polynomial order", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_VIEWPORT_DIMS, "GL_MAX_VIEWPORT_DIMS", "Maximum viewport dimensions", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_ATTRIB_STACK_DEPTH, "GL_MAX_ATTRIB_STACK_DEPTH", "Maximum depth of the attribute stack", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_MAX_CLIENT_ATTRIB_STACK_DEPTH, "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH", "Maximum depth of the client attribute stack", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_AUX_BUFFERS, "GL_AUX_BUFFERS", "Number of auxiliary buffers", "capability", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_RGBA_MODE, "GL_RGBA_MODE", "True if color buffers store RGBA", "capability", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_INDEX_MODE, "GL_INDEX_MODE", "True if color buffers store indices", "capability", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_DOUBLEBUFFER, "GL_DOUBLEBUFFER", "True if front and back buffers exist", "capability", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_STEREO, "GL_STEREO", "True if left and right buffers exist", "capability", "glGetBooleanv()"),
+ new GLproperty(GL11.GL_POINT_SIZE_RANGE, "GL_POINT_SIZE_RANGE", "Range (low to high) of antialiased point sizes", "capability", "glGetFloatv()"),
+ new GLproperty(GL11.GL_POINT_SIZE_GRANULARITY, "GL_POINT_SIZE_GRANULARITY", "Antialiased point-size granularity", "capability", "glGetFloatv()"),
+ new GLproperty(GL11.GL_LINE_WIDTH_RANGE, "GL_LINE_WIDTH_RANGE", "Range (low to high) of antialiased line widths", "capability", "glGetFloatv()"),
+ new GLproperty(GL11.GL_LINE_WIDTH_GRANULARITY, "GL_LINE_WIDTH_GRANULARITY", "Antialiased line-width granularity", "capability", "glGetFloatv()"),
+ new GLproperty(GL11.GL_RED_BITS, "GL_RED_BITS", "Number of bits per red component in color buffers", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_GREEN_BITS, "GL_GREEN_BITS", "Number of bits per green component in color buffers", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_BLUE_BITS, "GL_BLUE_BITS", "Number of bits per blue component in color buffers", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ALPHA_BITS, "GL_ALPHA_BITS", "Number of bits per alpha component in color buffers", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_INDEX_BITS, "GL_INDEX_BITS", "Number of bits per index in color buffers", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_DEPTH_BITS, "GL_DEPTH_BITS", "Number of depth-buffer bitplanes", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_STENCIL_BITS, "GL_STENCIL_BITS", "Number of stencil bitplanes", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ACCUM_RED_BITS, "GL_ACCUM_RED_BITS", "Number of bits per red component in the accumulation buffer", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ACCUM_GREEN_BITS, "GL_ACCUM_GREEN_BITS", "Number of bits per green component in the accumulation buffer", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ACCUM_BLUE_BITS, "GL_ACCUM_BLUE_BITS", "Number of bits per blue component in the accumulation buffer", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ACCUM_ALPHA_BITS, "GL_ACCUM_ALPHA_BITS", "Number of bits per alpha component in the accumulation buffer", "capability", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_LIST_BASE, "GL_LIST_BASE", "Setting of glListBase()", "list", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_LIST_INDEX, "GL_LIST_INDEX", "Number of display list under construction; 0 if none", "current", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_LIST_MODE, "GL_LIST_MODE", "Mode of display list under construction; undefined if none", "current", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_ATTRIB_STACK_DEPTH, "GL_ATTRIB_STACK_DEPTH", "Attribute stack pointer", "current", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_CLIENT_ATTRIB_STACK_DEPTH, "GL_CLIENT_ATTRIB_STACK_DEPTH", "Client attribute stack pointer", "current", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_NAME_STACK_DEPTH, "GL_NAME_STACK_DEPTH", "Name stack depth", "current", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_RENDER_MODE, "GL_RENDER_MODE", "glRenderMode() setting", "current", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_SELECTION_BUFFER_POINTER, "GL_SELECTION_BUFFER_POINTER", "Pointer to selection buffer", "select", "glGetPointerv()"),
+ new GLproperty(GL11.GL_SELECTION_BUFFER_SIZE, "GL_SELECTION_BUFFER_SIZE", "Size of selection buffer", "select", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_FEEDBACK_BUFFER_POINTER, "GL_FEEDBACK_BUFFER_POINTER", "Pointer to feedback buffer", "feedback", "glGetPointerv()"),
+ new GLproperty(GL11.GL_FEEDBACK_BUFFER_SIZE, "GL_FEEDBACK_BUFFER_SIZE", "Size of feedback buffer", "feedback", "glGetIntegerv()"),
+ new GLproperty(GL11.GL_FEEDBACK_BUFFER_TYPE, "GL_FEEDBACK_BUFFER_TYPE", "Type of feedback buffer", "feedback", "glGetIntegerv()"),
+ };
+
+ public static void dumpOpenGLstate()
+ {
+ }
+
+ public static void dumpAllIsEnabled() //Call This
+ {
+ for (int i = 0; i < instance.propertyList.length; ++i)
+
+ {
+ if (instance.propertyList[i].fetchCommand == "glIsEnabled()")
+
+ {
+ System.out.print(instance.propertyList[i].name + ":");
+ System.out.print(GL11.glIsEnabled(instance.propertyList[i].gLconstant));
+ System.out.println(" (" + instance.propertyList[i].description + ")");
+ }
+ }
+ }
+
+ public static void dumpAllType(String type)
+
+ {
+ for (int i = 0; i < instance.propertyList.length; ++i)
+
+ {
+ if (instance.propertyList[i].category.equals(type))
+
+ {
+ System.out.print(instance.propertyList[i].name + ":");
+ System.out.println(getPropertyAsString(i));
+ System.out.println(" (" + instance.propertyList[i].description + ")");
+ }
+ }
+ }
+
+ private static String getPropertyAsString(int propertyListIndex)
+ {
+ int gLconstant = instance.propertyList[propertyListIndex].gLconstant;
+ if (instance.propertyList[propertyListIndex].fetchCommand.equals("glIsEnabled()")) {
+ return "" + GL11.glIsEnabled(gLconstant);
+ }
+
+ if (instance.propertyList[propertyListIndex].fetchCommand == "glGetBooleanv()")
+
+ {
+ ByteBuffer params = BufferUtils.createByteBuffer(16);
+
+ GL11.glGetBoolean(gLconstant, params);
+ String out = "";
+ for (int i = 0; i < params.capacity(); ++i)
+
+ {
+ out += (i == 0 ? "" : ", ") + params.get(i);
+ }
+ return out;
+ }
+
+ return "";
+ }
+}
+
diff --git a/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java b/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java
new file mode 100644
index 0000000000..53873c6e4e
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/fluid/FluidUtils.java
@@ -0,0 +1,44 @@
+package gtPlusPlus.core.util.fluid;
+
+import gtPlusPlus.core.util.Utils;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
+public class FluidUtils {
+
+ public static FluidStack getFluidStack(String fluidName, int amount){
+ Utils.LOG_WARNING("Trying to get a fluid stack of "+fluidName);
+ try {
+ return FluidRegistry.getFluidStack(fluidName, amount).copy();
+ }
+ catch (Throwable e){
+ return null;
+ }
+
+ }
+
+ public static FluidStack[] getFluidStackArray(String fluidName, int amount){
+ Utils.LOG_WARNING("Trying to get a fluid stack of "+fluidName);
+ try {
+ FluidStack[] singleFluid = {FluidRegistry.getFluidStack(fluidName, amount)};
+ return singleFluid;
+ }
+ catch (Throwable e){
+ return null;
+ }
+
+ }
+
+ public static FluidStack[] getFluidStackArray(FluidStack fluidName, int amount){
+ Utils.LOG_WARNING("Trying to get a fluid stack of "+fluidName);
+ try {
+ FluidStack[] singleFluid = {FluidRegistry.getFluidStack(fluidName.getLocalizedName(), amount)};
+ return singleFluid;
+ }
+ catch (Throwable e){
+ return null;
+ }
+
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java b/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java
new file mode 100644
index 0000000000..d1857ffefc
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java
@@ -0,0 +1,87 @@
+package gtPlusPlus.core.util.gregtech.recipehandlers;
+
+import gregtech.api.util.GT_ModHandler;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+
+import java.lang.reflect.Method;
+
+import net.minecraft.item.ItemStack;
+
+public final class GregtechRecipe {
+
+ public LibraryProxy ourProxy;
+ public GregtechRecipe(){
+ Utils.LOG_INFO("Initializing a recipe handler for different versions of Gregtech 5.");
+ try {
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ this.ourProxy = new LibProxy1();
+ Utils.LOG_INFO("Selecting GT 5.7/5.8 Recipe Set");
+ }
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ this.ourProxy = new LibProxy2();
+ Utils.LOG_INFO("Selecting GT 5.9 Recipe Set");
+ }
+ } catch (NoSuchMethodException e) {
+ this.ourProxy = null;
+ }
+ }
+
+ public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aInput, ItemStack aOutput) {
+ Utils.LOG_INFO("Adding a GT Furnace/Alloy Smelter Recipe");
+ return ourProxy.addSmeltingAndAlloySmeltingRecipe(aInput, aOutput);
+ }
+
+}
+
+abstract class LibraryProxy { // can also be interface unless you want to have common code here
+ abstract public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aInput, ItemStack aOutput);
+}
+
+class LibProxy1 extends LibraryProxy {
+ final Method m1;
+
+ public LibProxy1() throws NoSuchMethodException {
+ m1 = GT_ModHandler.class.getDeclaredMethod("addSmeltingAndAlloySmeltingRecipe", ItemStack.class, ItemStack.class);
+ }
+
+ @Override
+ public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aInput, ItemStack aOutput) {
+ try {
+ Utils.LOG_INFO("Trying with Gt 5.7/5.8 Method.");
+ return (boolean) m1.invoke(null, aInput, aOutput);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
+
+class LibProxy2 extends LibraryProxy {
+ final Method m2;
+
+ public LibProxy2() throws NoSuchMethodException {
+ m2 = GT_ModHandler.class.getDeclaredMethod("addSmeltingAndAlloySmeltingRecipe", ItemStack.class, ItemStack.class, boolean.class);
+ }
+
+ @Override
+ public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aInput, ItemStack aOutput) {
+ try {
+ Utils.LOG_INFO("Trying with Gt 5.9 Method.");
+ return (boolean) m2.invoke(null, aInput, aOutput, true);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
+
+/*class Lib { // v1
+ public static void addRecipe(ItemStack aInput, ItemStack aOutput) {
+ System.out.println("shit totally happened v1");
+ }
+}
+
+class Lib2 { // v2
+ public static void addRecipe(ItemStack aInput, ItemStack aOutput, boolean hidden) {
+ System.out.println("shit totally happened v2");
+ }
+}*/ \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/core/util/item/UtilsItems.java b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java
new file mode 100644
index 0000000000..623fc1707c
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/item/UtilsItems.java
@@ -0,0 +1,361 @@
+package gtPlusPlus.core.util.item;
+
+import gregtech.api.enums.Materials;
+import gregtech.api.util.GT_OreDictUnificator;
+import gtPlusPlus.core.block.base.BlockBaseModular;
+import gtPlusPlus.core.block.base.BasicBlock.BlockTypes;
+import gtPlusPlus.core.item.ModItems;
+import gtPlusPlus.core.item.base.BasicSpawnEgg;
+import gtPlusPlus.core.item.base.bolts.BaseItemBolt;
+import gtPlusPlus.core.item.base.dusts.BaseItemDust;
+import gtPlusPlus.core.item.base.gears.BaseItemGear;
+import gtPlusPlus.core.item.base.ingots.BaseItemIngot;
+import gtPlusPlus.core.item.base.ingots.BaseItemIngotHot;
+import gtPlusPlus.core.item.base.plates.BaseItemPlate;
+import gtPlusPlus.core.item.base.rings.BaseItemRing;
+import gtPlusPlus.core.item.base.rods.BaseItemRod;
+import gtPlusPlus.core.item.base.rods.BaseItemRodLong;
+import gtPlusPlus.core.item.base.rotors.BaseItemRotor;
+import gtPlusPlus.core.item.base.screws.BaseItemScrew;
+import gtPlusPlus.core.item.tool.staballoy.MultiPickaxeBase;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.lib.MaterialInfo;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.wrapper.var;
+
+import java.util.ArrayList;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.item.Item;
+import net.minecraft.item.Item.ToolMaterial;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.oredict.OreDictionary;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class UtilsItems {
+
+ public static ItemStack getItemStackOfItem(Boolean modToCheck, String mod_itemname_meta){
+ if (modToCheck){
+ try{
+ Item em = null;
+
+ Item em1 = getItem(mod_itemname_meta);
+ Utils.LOG_WARNING("Found: "+em1.toString());
+ if (em1 != null){
+ em = em1;
+ }
+ if (em != null ){
+ ItemStack returnStack = new ItemStack(em,1);
+ return returnStack;
+ }
+ Utils.LOG_WARNING(mod_itemname_meta+" not found.");
+ return null;
+ } catch (NullPointerException e) {
+ Utils.LOG_ERROR(mod_itemname_meta+" not found. [NULL]");
+ return null;
+ }
+ }
+ return null;
+ }
+
+ public static ItemStack getSimpleStack(Item x){
+ return getSimpleStack(x, 1);
+ }
+
+ public static ItemStack getSimpleStack(Item x, int i){
+ try {
+ ItemStack r = new ItemStack(x, i);
+ return r;
+ } catch(Throwable e){
+ return null;
+ }
+ }
+
+ public static ItemStack getSimpleStack(ItemStack x, int i){
+ try {
+ ItemStack r = x.copy();
+ r.stackSize = i;
+ return r;
+ } catch(Throwable e){
+ return null;
+ }
+ }
+
+
+ public static void getItemForOreDict(String FQRN, String oreDictName, String itemName, int meta){
+ try {
+ Item em = null;
+ Item em1 = getItem(FQRN);
+ Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
+ if (em1 != null){
+ em = em1;
+ }
+ if (em != null){
+
+ ItemStack metaStack = new ItemStack(em,1,meta);
+ GT_OreDictUnificator.registerOre(oreDictName, metaStack);
+
+ /*ItemStack itemStackWithMeta = new ItemStack(em,1,meta);
+ GT_OreDictUnificator.registerOre(oreDictName, new ItemStack(itemStackWithMeta.getItem()));*/
+ }
+ } catch (NullPointerException e) {
+ Utils.LOG_ERROR(itemName+" not found. [NULL]");
+ }
+ }
+
+ public static void addItemToOreDictionary(ItemStack stack, String oreDictName){
+ try {
+ GT_OreDictUnificator.registerOre(oreDictName, stack);
+ } catch (NullPointerException e) {
+ Utils.LOG_ERROR(stack.getDisplayName()+" not registered. [NULL]");
+ }
+ }
+
+ @SuppressWarnings("unused")
+ public static ItemStack getItemStackWithMeta(boolean MOD, String FQRN, String itemName, int meta, int itemstackSize){
+ if (MOD){
+ try {
+ Item em = null;
+ Item em1 = getItem(FQRN);
+ Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
+ if (em1 != null){
+ if (null == em){
+ em = em1;
+ }
+ if (em != null){
+ ItemStack metaStack = new ItemStack(em,itemstackSize,meta);
+ return metaStack;
+ }
+ }
+ return null;
+ } catch (NullPointerException e) {
+ Utils.LOG_ERROR(itemName+" not found. [NULL]");
+ return null;
+ }
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unused")
+ public static ItemStack simpleMetaStack(String FQRN, int meta, int itemstackSize){
+ try {
+ Item em = null;
+ Item em1 = getItem(FQRN);
+ Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
+ if (em1 != null){
+ if (null == em){
+ em = em1;
+ }
+ if (em != null){
+ ItemStack metaStack = new ItemStack(em,itemstackSize,meta);
+ return metaStack;
+ }
+ }
+ return null;
+ } catch (NullPointerException e) {
+ Utils.LOG_ERROR(FQRN+" not found. [NULL]");
+ return null;
+ }
+ }
+
+ @SuppressWarnings("unused")
+ public static ItemStack simpleMetaStack(Item item, int meta, int itemstackSize){
+ try {
+ Item em = item;
+ Item em1 = item;
+ Utils.LOG_WARNING("Found: "+em1.getUnlocalizedName()+":"+meta);
+ if (em1 != null){
+ if (null == em){
+ em = em1;
+ }
+ if (em != null){
+ ItemStack metaStack = new ItemStack(em,itemstackSize,meta);
+ return metaStack;
+ }
+ }
+ return null;
+ } catch (NullPointerException e) {
+ Utils.LOG_ERROR(item.getUnlocalizedName()+" not found. [NULL]");
+ return null;
+ }
+ }
+
+ public static ItemStack getCorrectStacktype(String fqrn, int stackSize){
+ String oreDict = "ore:";
+ ItemStack temp;
+ if (fqrn.toLowerCase().contains(oreDict.toLowerCase())){
+ String sanitizedName = fqrn.replace(oreDict, "");
+ temp = UtilsItems.getItemStack(sanitizedName, stackSize);
+ return temp;
+ }
+ String[] fqrnSplit = fqrn.split(":");
+ if(fqrnSplit[2] == null){fqrnSplit[2] = "0";}
+ temp = UtilsItems.getItemStackWithMeta(LoadedMods.MiscUtils, fqrn, fqrnSplit[1], Integer.parseInt(fqrnSplit[2]), stackSize);
+ return temp;
+ }
+
+ public static ItemStack getCorrectStacktype(Object item_Input, int stackSize) {
+ if (item_Input instanceof String){
+ return getCorrectStacktype(item_Input, stackSize);
+ }
+ else if (item_Input instanceof ItemStack){
+ return (ItemStack) item_Input;
+ }
+ if (item_Input instanceof var){
+ return ((var) item_Input).getStack(stackSize);
+ }
+ return null;
+ }
+
+ public static Item getItem(String fqrn) // fqrn = fully qualified resource name
+ {
+ String[] fqrnSplit = fqrn.split(":");
+ return GameRegistry.findItem(fqrnSplit[0], fqrnSplit[1]);
+ }
+
+ public static ItemStack getItemStack(String fqrn, int Size) // fqrn = fully qualified resource name
+ {
+ String[] fqrnSplit = fqrn.split(":");
+ return GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size);
+ }
+
+ // TODO
+ /*public static FluidStack getFluidStack(Materials m, int Size) // fqrn = fully qualified resource name
+ {
+ String[] fqrnSplit = fqrn.split(":");
+
+ FluidStack x = (FluidStack) "Materials."+m+".getFluid"(Size);
+
+ return GameRegistry.findItemStack(fqrnSplit[0], fqrnSplit[1], Size);
+ }*/
+
+ public static Item getItemInPlayersHand(){
+ Minecraft mc = Minecraft.getMinecraft();
+ Item heldItem = null;
+
+ try{heldItem = mc.thePlayer.getHeldItem().getItem();
+ }catch(NullPointerException e){return null;}
+
+ if (heldItem != null){
+ return heldItem;
+ }
+
+ return null;
+ }
+
+ public static void generateSpawnEgg(String entityModID, String parSpawnName, int colourEgg, int colourOverlay){
+ Item itemSpawnEgg = new BasicSpawnEgg(entityModID, parSpawnName, colourEgg, colourOverlay).setUnlocalizedName("spawn_egg_"+parSpawnName.toLowerCase()).setTextureName(CORE.MODID+":spawn_egg");
+ GameRegistry.registerItem(itemSpawnEgg, "spawnEgg"+parSpawnName);
+ }
+
+ public static ItemStack getItemStackOfAmountFromOreDict(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 getSimpleStack(ModItems.AAA_Broken, amount);
+ }
+
+ public static void generateItemsFromMaterial(String unlocalizedName, String materialName, int materialTier, MaterialInfo matInfo, int Colour, boolean hotIngot){
+ if (materialTier > 10 || materialTier <= 0){
+ materialTier = 2;
+ }
+ int sRadiation = 0;
+
+ if (materialName.toLowerCase().contains("uranium")){
+ sRadiation = 2;
+ }
+ else if (materialName.toLowerCase().contains("plutonium")){
+ sRadiation = 4;
+ }
+ else if (materialName.toLowerCase().contains("thorium")){
+ sRadiation = 1;
+ }
+ if (sRadiation >= 1){
+ Item temp;
+ Block tempBlock;
+ tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour);
+ temp = new BaseItemIngot("itemIngot"+unlocalizedName, materialName, Colour, sRadiation);
+
+ temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", hotIngot, materialTier, sRadiation);
+ temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", hotIngot, materialTier, sRadiation);
+ temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", hotIngot, materialTier, sRadiation);
+
+ temp = new BaseItemPlate("itemPlate"+unlocalizedName, materialName, Colour, materialTier, sRadiation);
+ temp = new BaseItemRod("itemRod"+unlocalizedName, materialName, Colour, materialTier, sRadiation);
+ temp = new BaseItemRodLong("itemRodLong"+unlocalizedName, materialName, Colour, materialTier, sRadiation);
+ }
+
+ else {
+ Item temp;
+ Block tempBlock;
+ tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.STANDARD, Colour);
+ tempBlock = new BlockBaseModular(unlocalizedName, materialName,BlockTypes.FRAME, Colour);
+ temp = new BaseItemIngot("itemIngot"+unlocalizedName, materialName, Colour, sRadiation);
+ if (hotIngot){
+ Item tempIngot = temp;
+ temp = new BaseItemIngotHot("itemHotIngot"+unlocalizedName, materialName, UtilsItems.getSimpleStack(tempIngot, 1), materialTier);
+ }
+ temp = new BaseItemDust("itemDust"+unlocalizedName, materialName, matInfo, Colour, "Dust", hotIngot, materialTier, sRadiation);
+ temp = new BaseItemDust("itemDustTiny"+unlocalizedName, materialName, matInfo, Colour, "Tiny", hotIngot, materialTier, sRadiation);
+ temp = new BaseItemDust("itemDustSmall"+unlocalizedName, materialName, matInfo, Colour, "Small", hotIngot, materialTier, sRadiation);
+
+ temp = new BaseItemPlate("itemPlate"+unlocalizedName, materialName, Colour, materialTier, sRadiation);
+ temp = new BaseItemRod("itemRod"+unlocalizedName, materialName, Colour, materialTier, sRadiation);
+ temp = new BaseItemRodLong("itemRodLong"+unlocalizedName, materialName, Colour, materialTier, sRadiation);
+ temp = new BaseItemRing("itemRing"+unlocalizedName, materialName, Colour, materialTier);
+ temp = new BaseItemBolt("itemBolt"+unlocalizedName, materialName, Colour, materialTier);
+ temp = new BaseItemScrew("itemScrew"+unlocalizedName, materialName, Colour, materialTier);
+ temp = new BaseItemRotor("itemRotor"+unlocalizedName, materialName, Colour);
+ temp = new BaseItemGear("itemGear"+unlocalizedName, materialName, Colour, materialTier);
+ }
+
+ }
+
+ public static MultiPickaxeBase generateMultiPick(Materials material){
+ ToolMaterial customMaterial = Utils.generateMaterialFromGT(material);
+ short[] rgb;
+ rgb = material.getRGBA();
+ int dur = customMaterial.getMaxUses();
+
+ if (dur <= 0){
+ dur = material.mDurability;
+ }
+
+ MultiPickaxeBase MP_Redstone = new MultiPickaxeBase(
+ material.name()+" Multipick",
+ (customMaterial),
+ dur,
+ Utils.rgbtoHexValue(rgb[0],rgb[1],rgb[2])
+ );
+
+ return MP_Redstone;
+
+ }
+
+ public static String getArrayStackNames(ItemStack[] aStack){
+ String itemNames = "Item Array: ";
+ for (ItemStack alph : aStack){
+ String temp = itemNames;
+ itemNames = temp + ", " + alph.getDisplayName() + " x" + alph.stackSize;
+ }
+ return itemNames;
+
+ }
+
+ public static String getFluidArrayStackNames(FluidStack[] aStack){
+ String itemNames = "Fluid Array: ";
+ for (FluidStack alph : aStack){
+ String temp = itemNames;
+ itemNames = temp + ", " + alph.getFluid().getName() + " x" + alph.amount;
+ }
+ return itemNames;
+
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java
new file mode 100644
index 0000000000..69548eb49a
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/materials/MaterialUtils.java
@@ -0,0 +1,87 @@
+package gtPlusPlus.core.util.materials;
+
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.TC_Aspects.TC_AspectStack;
+import gregtech.api.enums.TextureSet;
+import gregtech.api.objects.MaterialStack;
+import gtPlusPlus.core.lib.MaterialInfo;
+import gtPlusPlus.core.util.Utils;
+
+import java.util.List;
+
+import net.minecraftforge.common.util.EnumHelper;
+
+public class MaterialUtils {
+
+ public static short firstID = 791;
+
+ private static Class[][] commonTypes =
+ {{Materials.class, int.class, TextureSet.class, float.class, int.class,
+ int.class, int.class, int.class, int.class, int.class, int.class,
+ String.class, int.class, int.class, int.class, int.class, boolean.class,
+ boolean.class, int.class, int.class, int.class, Dyes.class, int.class,
+ List.class , List.class}};
+
+ public static Materials addGtMaterial(String enumNameForMaterial, 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)
+ {
+ Utils.LOG_INFO("Attempting to add GT material: "+enumNameForMaterial);
+ return EnumHelper.addEnum(Materials.class, enumNameForMaterial, commonTypes, firstID++, aIconSet, aToolSpeed, aToolDurability, aToolQuality, aTypes, aR, aG, aB, aA, aLocalName,
+ aFuelType, aFuelPower, aMeltingPoint, aBlastFurnaceTemp, aBlastFurnaceRequired, aTransparent, aOreValue, aDensityMultiplier, aDensityDivider,
+ aColor, aExtraData, aMaterialList, aAspects);
+ }
+
+
+ /*
+ * That's shown, many times, in the EnumHelper code, all the add functions just wrap the addEnum function.
+ You need the target enum class, and 2 arrays, 1 holding the types for the constructor arguments,
+ and the other holding the constructor argument values (the things being passed to the constructor)
+
+ The 'decompiled' Boolean should be set to true if the class you're adding to has been decompiled/recompiled again.
+ (it adds a 2nd enum arguments that need to be accounted for, but isn't actually useful to you)
+
+ *
+ *new Class[{int.class, TextureSet.class, float.class, int.class,
+ int.class, int.class, int.class, int.class, int.class, int.class,
+ String.class, int.class, int.class, int.class, int.class, boolean.class,
+ boolean.class, int.class, int.class, int.class, Dyes.class, int.class,
+ List.class , List.class}],
+ */
+
+
+
+ public static Materials GenerateGtMaterialForSingleUse(MaterialInfo s){
+
+ Materials yourName = EnumHelper.addEnum(
+
+ Materials.class, s.name(),
+
+
+
+ new Object[0]
+
+ );
+ try
+ {
+
+
+
+ /*Class<? extends ItemCell> clz = item.getClass();
+ Method methode = clz.getDeclaredMethod("addCell", int.class, InternalName.class, Block[].class);
+ methode.setAccessible(true);
+ ItemStack temp = (ItemStack) methode.invoke(item, cellID++, yourName, new Block[0]);*/
+
+
+
+
+
+
+ return Materials.Abyssal;
+ }
+ catch(Exception e){
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/math/MathUtils.java b/src/Java/gtPlusPlus/core/util/math/MathUtils.java
new file mode 100644
index 0000000000..3df5693bc3
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/math/MathUtils.java
@@ -0,0 +1,213 @@
+package gtPlusPlus.core.util.math;
+
+import gtPlusPlus.core.util.Utils;
+
+import java.util.Map;
+import java.util.Random;
+
+public class MathUtils {
+
+ /**
+ * Returns a psuedo-random number between min and max, inclusive.
+ * The difference between min and max can be at most
+ * Integer.MAX_VALUE - 1.
+ *
+ * @param min Minimim value
+ * @param max Maximim value. Must be greater than min.
+ * @return Integer between min and max, inclusive.
+ * @see java.util.Random#nextInt(int)
+ */
+ public static int randInt(int min, int max) {
+
+ // Usually this can be a field rather than a method variable
+ Random rand = new Random();
+
+ // nextInt is normally exclusive of the top value,
+ // so add 1 to make it inclusive
+ int randomNum = rand.nextInt((max - min) + 1) + min;
+
+ return randomNum;
+ }
+
+
+ /**
+ * Returns a psuedo-random number between min and max, inclusive.
+ * The difference between min and max can be at most
+ * Long.MAX_VALUE - 1.
+ *
+ * @param min Minimim value
+ * @param max Maximim value. Must be greater than min.
+ * @return Long between min and max, inclusive.
+ * @see java.util.Random#nextLong(long)
+ */
+ public static long randLong(long min, long max) {
+ // Usually this can be a field rather than a method variable
+ Random rand = new Random();
+
+ // nextInt is normally exclusive of the top value,
+ // so add 1 to make it inclusive
+ long randomNum = MathUtils.nextLong(rand,(max - min) + 1) + min;
+
+ return randomNum;
+ }
+ private static long nextLong(Random rng, long n) {
+ // error checking and 2^x checking removed for simplicity.
+ long bits, val;
+ do {
+ bits = (rng.nextLong() << 1) >>> 1;
+ val = bits % n;
+ } while (bits-val+(n-1) < 0L);
+ return val;
+ }
+
+
+ /**
+ * Returns a percentage.
+ * The returned number is the % of X in Y.
+ * Supports Doubles.
+ *
+ * @param current Current value.
+ * @param max Maximim value. Must be greater than min.
+ * @return double between min and max, inclusive.
+ */
+ public static double findPercentage(double current, double max){
+ double c = ((double) current / max) * 100;
+ double roundOff = Math.round(c * 100.00) / 100.00;
+ return roundOff;
+ }
+
+
+ //Smooth Rounding Function
+ /**
+ * Returns a double.
+ * The returned number is d rounded to the nearest d.01.
+ * Supports Doubles.
+ *
+ * @param current Current value.
+ * @return double Rounded value.
+ */
+ public static double decimalRounding(double d) {
+ return Math.round(d * 2) / 2.0;
+ }
+
+
+ //Smooth Rounding Function (Nearest 5)
+ /**
+ * Returns a double.
+ * The returned number is d rounded to the nearest d.5.
+ * Supports Doubles.
+ *
+ * @param current Current value.
+ * @return double Rounded value.
+ */
+ public static double decimalRoundingToWholes(double d) {
+ return 5*(Math.round(d/5));
+ }
+
+
+ /**
+ * Returns a boolean.
+ * The returned boolean is wether or not X evenly fits in to Y.
+ * Supports ints.
+ *
+ * @param x Value A.
+ * @param y Value B. Must be greater than min.
+ * @return boolean Whether or not it divides evenly.
+ */
+ public static boolean divideXintoY(int x, int y){
+ if ((x % y) == 0)
+ {
+ return true;
+ }
+ return false;
+ }
+
+
+ /**
+ * Returns a boolean.
+ * The returned boolean is based on the odd/eveness of the input.
+ * Supports ints.
+ *
+ * @param x Value A.
+ * @return boolean Whether or not it divides evenly.
+ */
+ public static boolean isNumberEven(int x){
+ if ((x % 2) == 0)
+ {
+ return true;
+ }
+ return false;
+ }
+
+
+
+ /**
+ * Returns an int.
+ * The returned number is the value on i + 273.15F.
+ * Supports ints.
+ *
+ * @param i Temp in Celcius.
+ * @return int The celcius temp returned as Kelvin, rounded to the readest whole.
+ */
+ public static float celsiusToKelvin(int i){
+ double f = i + 273.15F;
+ return (int)decimalRoundingToWholes(f);
+ }
+
+
+ /**
+ * Returns a hexInteger.
+ * The returned number is the hex value of the input.
+ * Supports ints.
+ *
+ * @param input Current value.
+ * @return hexInteger.
+ */
+ public static int getHexNumberFromInt(int input){
+ String result = Integer.toHexString(input);
+ int resultINT = Integer.getInteger(result);
+ return resultINT;
+ }
+
+
+ /**
+ * Returns a hexInteger.
+ * The returned value is between min and max.
+ * Supports ints.
+ *
+ * @param min Minimum value.
+ * @param max Maximium value. Must be greater than min.
+ * @return hexInteger between min and max, inclusive.
+ */
+ public static int generateRandomHexValue(int min, int max){
+ int result = getHexNumberFromInt(randInt(min, max));
+ return result;
+ }
+
+
+ /**
+ * Returns a random hex value.
+ * The returned value is between 000000-ffffff.
+ *
+ * @return hexInteger between min and max, inclusive.
+ */
+ public static int generateSingularRandomHexValue(){
+ String temp;
+ int randomInt = randInt(1, 5);
+ final Map<Integer, String> colours = Utils.hexColourGeneratorRandom(5);
+
+ if (colours.get(randomInt) != null && colours.size() > 0){
+ temp = colours.get(randomInt);
+ }
+ else {
+ temp = "0F0F0F";
+ }
+
+ Utils.LOG_WARNING("Operating with "+temp);
+ temp = Utils.appenedHexNotationToString(String.valueOf(temp));
+ Utils.LOG_WARNING("Made "+temp+" - Hopefully it's not a mess.");
+ Utils.LOG_WARNING("It will decode into "+Integer.decode(temp)+".");
+ return Integer.decode(temp);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/particles/EntityParticleFXMysterious.java b/src/Java/gtPlusPlus/core/util/particles/EntityParticleFXMysterious.java
new file mode 100644
index 0000000000..2c704e48a6
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/particles/EntityParticleFXMysterious.java
@@ -0,0 +1,17 @@
+package gtPlusPlus.core.util.particles;
+
+import net.minecraft.client.particle.EntityAuraFX;
+import net.minecraft.world.World;
+
+public class EntityParticleFXMysterious extends EntityAuraFX
+{
+ public EntityParticleFXMysterious(World parWorld,
+ double parX, double parY, double parZ,
+ double parMotionX, double parMotionY, double parMotionZ)
+ {
+ super(parWorld, parX, parY, parZ, parMotionX, parMotionY, parMotionZ);
+ setParticleTextureIndex(82); // same as happy villager
+ particleScale = 2.0F;
+ setRBGColorF(0x88, 0x00, 0x88);
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/util/player/PlayerCache.java b/src/Java/gtPlusPlus/core/util/player/PlayerCache.java
new file mode 100644
index 0000000000..095eb543db
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/player/PlayerCache.java
@@ -0,0 +1,190 @@
+package gtPlusPlus.core.util.player;
+
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Objects;
+import java.util.Properties;
+import java.util.UUID;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.world.World;
+
+public class PlayerCache {
+
+ private static final File cache = new File("PlayerCache.dat");
+
+ public static final void initCache() {
+ if (CORE.PlayerCache == null || CORE.PlayerCache.equals(null)){
+ try {
+
+ if (cache != null){
+ CORE.PlayerCache = PlayerCache.readPropertiesFileAsMap();
+ Utils.LOG_INFO("Loaded PlayerCache.dat");
+ }
+
+
+ } catch (Exception e) {
+ Utils.LOG_INFO("Failed to initialise PlayerCache.dat");
+ PlayerCache.createPropertiesFile("PLAYER_", "DATA");
+ //e.printStackTrace();
+ }
+ }
+ }
+
+ public static void createPropertiesFile(String playerName, String playerUUIDasString) {
+ try {
+ Properties props = new Properties();
+ props.setProperty(playerName+" ", playerUUIDasString);
+ OutputStream out = new FileOutputStream(cache);
+ props.store(out, "Player Cache.");
+ Utils.LOG_INFO("PlayerCache.dat created for future use.");
+ }
+ catch (Exception e ) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void appendParamChanges(String playerName, String playerUUIDasString) {
+ HashMap<String, UUID> playerInfo = new HashMap<String, UUID>();
+ playerInfo.put(playerName, UUID.fromString(playerUUIDasString));
+
+ /*try {
+ Utils.LOG_INFO("Attempting to load "+cache.getName());
+ properties.load(new FileInputStream(cache));
+ if (properties == null || properties.equals(null)){
+ Utils.LOG_INFO("Please wait.");
+ }
+ else {
+ Utils.LOG_INFO("Loaded PlayerCache.dat");
+ properties.setProperty(playerName+"_", playerUUIDasString);
+ FileOutputStream fr=new FileOutputStream(cache);
+ properties.store(fr, "Player Cache.");
+ fr.close();
+ }
+
+ } */
+
+ try
+ {
+ FileOutputStream fos = new FileOutputStream("PlayerCache.dat");
+ ObjectOutputStream oos = new ObjectOutputStream(fos);
+ oos.writeObject(playerInfo);
+ oos.close();
+ fos.close();
+ Utils.LOG_INFO("Serialized Player data saved in PlayerCache.dat");
+ }
+
+ catch (IOException e) {
+ Utils.LOG_INFO("No PlayerCache file found, creating one.");
+ createPropertiesFile(playerName, playerUUIDasString);
+ }
+ }
+
+ /**
+ * Reads a "properties" file, and returns it as a Map
+ * (a collection of key/value pairs).
+ *
+ * Credit due to Alvin Alexander - http://alvinalexander.com/java/java-properties-file-map-example?nocache=1#comment-8215
+ * Changed slightly as the filename and delimiter are constant in my case.
+ *
+ * @param filename The properties filename to read.
+ * @param delimiter The string (or character) that separates the key
+ * from the value in the properties file.
+ * @return The Map that contains the key/value pairs.
+ * @throws Exception
+ */
+ @Deprecated
+ public static Map<String, String> readPropertiesFileAsMapOld() throws Exception {
+ String delimiter = "=";
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ Map<String, String> map = new HashMap<String, String>();
+ BufferedReader reader = new BufferedReader(new FileReader(cache));
+ String line;
+ while ((line = reader.readLine()) != null)
+ {
+ if (line.trim().length()==0) continue;
+ if (line.charAt(0)=='#') continue;
+ // assumption here is that proper lines are like "String : <a href="http://xxx.yyy.zzz/foo/bar"" title="http://xxx.yyy.zzz/foo/bar"">http://xxx.yyy.zzz/foo/bar"</a>,
+ // and the ":" is the delimiter
+ int delimPosition = line.indexOf(delimiter);
+ String key = line.substring(0, delimPosition-1).trim();
+ String value = line.substring(delimPosition+1).trim();
+ map.put(key, value);
+ }
+ reader.close();
+ CORE.PlayerCache = map;
+ return map;
+ }
+
+ public static HashMap<String, UUID> readPropertiesFileAsMap() {
+ HashMap<String, UUID> map = null;
+ try
+ {
+ FileInputStream fis = new FileInputStream(cache);
+ ObjectInputStream ois = new ObjectInputStream(fis);
+ map = (HashMap<String, UUID>) ois.readObject();
+ ois.close();
+ fis.close();
+ }catch(IOException ioe)
+ {
+ ioe.printStackTrace();
+ return null;
+ }catch(ClassNotFoundException c)
+ {
+ Utils.LOG_INFO("Class not found");
+ c.printStackTrace();
+ return null;
+ }
+ Utils.LOG_WARNING("Deserialized PlayerCache..");
+ return map;
+ }
+
+ public static String lookupPlayerByUUID(UUID UUID){
+
+ try {
+ World worldw = Minecraft.getMinecraft().thePlayer.worldObj;
+ //if (!worldw.isRemote){
+
+
+ try {
+ Map<String, UUID> map = null;
+ try {
+ map = readPropertiesFileAsMap();
+ } catch (Exception e) {
+ Utils.LOG_INFO("With "+e.getCause()+" as cause, Caught Exception: "+e.toString());
+ //e.printStackTrace();
+ }
+ for (Entry<String, UUID> entry : map.entrySet()) {
+ if (Objects.equals(UUID, entry.getValue())) {
+ return entry.getKey();
+ }
+ }
+ return null;
+ } catch (NullPointerException e) {
+ Utils.LOG_INFO("With "+e.getCause()+" as cause, Caught Exception: "+e.toString());
+ //e.printStackTrace();
+ }
+
+
+ //}
+
+
+ } catch (Throwable r){
+ Utils.LOG_INFO("With "+r.getCause()+" as cause, Caught Exception: "+r.toString());
+ }
+ return null;
+ }
+}
diff --git a/src/Java/gtPlusPlus/core/util/player/UtilsMining.java b/src/Java/gtPlusPlus/core/util/player/UtilsMining.java
new file mode 100644
index 0000000000..1b6b957b32
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/player/UtilsMining.java
@@ -0,0 +1,180 @@
+package gtPlusPlus.core.util.player;
+
+import gtPlusPlus.core.util.Utils;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+
+public class UtilsMining {
+
+ private static boolean durabilityDamage = false;
+ private static ItemStack stack;
+
+ public static Boolean canPickaxeBlock(Block currentBlock, World currentWorld){
+ String correctTool = "";
+ if (!currentWorld.isRemote){
+ try {
+ correctTool = currentBlock.getHarvestTool(0);
+ //Utils.LOG_WARNING(correctTool);
+ if (correctTool.equals("pickaxe")){
+ return true;}
+ } catch (NullPointerException e){
+ return false;}
+ }
+ return false;
+ }
+
+ private static void removeBlockAndDropAsItem(World world, int X, int Y, int Z){
+ try {
+ Block block = world.getBlock(X, Y, Z);
+ if (canPickaxeBlock(block, world)){
+ if((block != Blocks.bedrock) && (block.getBlockHardness(world, X, Y, Z) != -1) && (block.getBlockHardness(world, X, Y, Z) <= 100) && (block != Blocks.water) && (block != Blocks.lava)){
+ block.dropBlockAsItem(world, X, Y, Z, world.getBlockMetadata(X, Y, Z), 0);
+ world.setBlockToAir(X, Y, Z);
+
+ }
+ else {
+ Utils.LOG_WARNING("Incorrect Tool for mining this block.");
+ }
+ }
+ } catch (NullPointerException e){
+
+ }
+ }
+
+ public static void customMine(World world, String FACING, EntityPlayer aPlayer){
+
+ float DURABILITY_LOSS = 0;
+ if (!world.isRemote){
+ int X = 0;
+ int Y = 0;
+ int Z = 0;
+
+ if (FACING.equals("below") || FACING.equals("above")){
+
+ //Set Player Facing
+ X = (int) aPlayer.posX;
+ Utils.LOG_WARNING("Setting Variable X: "+X);
+ if (FACING.equals("above")){
+ Z = (int) aPlayer.posY + 1;
+ Utils.LOG_WARNING("Setting Variable Y: "+Y);
+ }
+ else {
+ Z = (int) aPlayer.posY - 1;
+ Utils.LOG_WARNING("Setting Variable Y: "+Y);}
+ Z = (int) aPlayer.posZ;
+ Utils.LOG_WARNING("Setting Variable Z: "+Z);
+
+ DURABILITY_LOSS = 0;
+ for(int i = -2; i < 3; i++) {
+ for(int j = -2; j < 3; j++) {
+ for(int k = -2; k < 3; k++) {
+/*// float dur = calculateDurabilityLoss(world, X + i, Y + k, Z + j);
+// DURABILITY_LOSS = (DURABILITY_LOSS + dur);
+// Utils.LOG_WARNING("Added Loss: "+dur);
+*/ removeBlockAndDropAsItem(world, X + i, Y + k, Z + j);
+ }
+ }
+ }
+ }
+
+ else if (FACING.equals("facingEast") || FACING.equals("facingWest")){
+
+ //Set Player Facing
+ Z = (int) aPlayer.posZ;
+ Y = (int) aPlayer.posY;
+ if (FACING.equals("facingEast")){
+ X = (int) aPlayer.posX + 1;}
+ else {
+ X = (int) aPlayer.posX - 1;}
+
+
+ DURABILITY_LOSS = 0;
+ for(int i = -1; i < 2; i++) {
+ for(int j = -1; j < 2; j++) {
+ for(int k = -1; k < 2; k++) {
+ /*float dur = calculateDurabilityLoss(world, X+k, Y + i, Z + j);
+ DURABILITY_LOSS = (DURABILITY_LOSS + dur);
+ Utils.LOG_WARNING("Added Loss: "+dur);*/
+ removeBlockAndDropAsItem(world, X+k, Y + i, Z + j);
+ }
+ }
+ }
+ }
+
+ else if (FACING.equals("facingNorth") || FACING.equals("facingSouth")){
+
+ //Set Player Facing
+ X = (int) aPlayer.posX;
+ Y = (int) aPlayer.posY;
+
+ if (FACING.equals("facingNorth")){
+ Z = (int) aPlayer.posZ + 1;}
+ else {
+ Z = (int) aPlayer.posZ - 1;}
+
+ DURABILITY_LOSS = 0;
+ for(int i = -1; i < 2; i++) {
+ for(int j = -1; j < 2; j++) {
+ for(int k = -1; k < 2; k++) {
+ /*float dur = calculateDurabilityLoss(world, X + j, Y + i, Z+k);
+ DURABILITY_LOSS = (DURABILITY_LOSS + dur);
+ Utils.LOG_WARNING("Added Loss: "+dur);*/
+ removeBlockAndDropAsItem(world, X + j, Y + i, Z+k);
+ }
+ }
+ }
+ }
+
+ //Set Durability damage to the item
+ if (durabilityDamage == true){
+ Utils.LOG_WARNING("Total Loss: "+(int)DURABILITY_LOSS);
+ if (stack.getItemDamage() < (stack.getMaxDamage()-DURABILITY_LOSS)){
+ stack.damageItem((int) DURABILITY_LOSS, aPlayer);
+ }
+ }
+ DURABILITY_LOSS = 0;
+ }
+ }
+
+
+ public static boolean getBlockType(Block block){
+ final String LIQUID = "liquid";
+ final String BLOCK = "block";
+ final String ORE = "ore";
+ final String AIR = "air";
+ String blockClass = "";
+
+ try {
+ blockClass = block.getClass().toString().toLowerCase();
+ Utils.LOG_WARNING(blockClass);
+ if (blockClass.toLowerCase().contains(LIQUID)){
+ Utils.LOG_WARNING(block.toString()+" is a Liquid.");
+ return false;
+ }
+ else if (blockClass.toLowerCase().contains(ORE)){
+ Utils.LOG_WARNING(block.toString()+" is an Ore.");
+ return true;
+ }
+ else if (blockClass.toLowerCase().contains(AIR)){
+ Utils.LOG_WARNING(block.toString()+" is Air.");
+ return false;
+ }
+ else if (blockClass.toLowerCase().contains(BLOCK)){
+ Utils.LOG_WARNING(block.toString()+" is a block of some kind.");
+ return false;
+ }
+ else {
+ Utils.LOG_WARNING(block.toString()+" is mystery.");
+ return false;
+ }
+ }
+ catch(NullPointerException e){
+ return false;
+ }
+ }
+
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java b/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java
new file mode 100644
index 0000000000..997aaa95c9
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/recipe/UtilsRecipe.java
@@ -0,0 +1,370 @@
+package gtPlusPlus.core.util.recipe;
+
+import gregtech.api.util.GT_ModHandler;
+import gtPlusPlus.core.handler.COMPAT_HANDLER;
+import gtPlusPlus.core.handler.Recipes.LateRegistrationHandler;
+import gtPlusPlus.core.handler.Recipes.RegistrationHandler;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.item.crafting.CraftingManager;
+import net.minecraft.item.crafting.IRecipe;
+import net.minecraftforge.oredict.OreDictionary;
+import net.minecraftforge.oredict.ShapedOreRecipe;
+import net.minecraftforge.oredict.ShapelessOreRecipe;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class UtilsRecipe {
+
+ public static void recipeBuilder(Object slot_1, Object slot_2, Object slot_3, Object slot_4, Object slot_5, Object slot_6, Object slot_7, Object slot_8, Object slot_9, ItemStack resultItem){
+
+ ArrayList<Object> validSlots = new ArrayList<Object>();
+
+ Utils.LOG_INFO("Trying to add a recipe for "+resultItem.toString());
+ String a,b,c,d,e,f,g,h,i;
+ if (slot_1 == null){ a = " ";} else { a = "1";validSlots.add('1');validSlots.add(slot_1);}
+ Utils.LOG_WARNING(a);
+ if (slot_2 == null){ b = " ";} else { b = "2";validSlots.add('2');validSlots.add(slot_2);}
+ Utils.LOG_WARNING(b);
+ if (slot_3 == null){ c = " ";} else { c = "3";validSlots.add('3');validSlots.add(slot_3);}
+ Utils.LOG_WARNING(c);
+ if (slot_4 == null){ d = " ";} else { d = "4";validSlots.add('4');validSlots.add(slot_4);}
+ Utils.LOG_WARNING(d);
+ if (slot_5 == null){ e = " ";} else { e = "5";validSlots.add('5');validSlots.add(slot_5);}
+ Utils.LOG_WARNING(e);
+ if (slot_6 == null){ f = " ";} else { f = "6";validSlots.add('6');validSlots.add(slot_6);}
+ Utils.LOG_WARNING(f);
+ if (slot_7 == null){ g = " ";} else { g = "7";validSlots.add('7');validSlots.add(slot_7);}
+ Utils.LOG_WARNING(g);
+ if (slot_8 == null){ h = " ";} else { h = "8";validSlots.add('8');validSlots.add(slot_8);}
+ Utils.LOG_WARNING(h);
+ if (slot_9 == null){ i = " ";} else { i = "9";validSlots.add('9');validSlots.add(slot_9);}
+ Utils.LOG_WARNING(i);
+
+
+ Utils.LOG_ERROR("_______");
+ String lineOne = a+b+c;
+ Utils.LOG_ERROR("|"+a+"|"+b+"|"+c+"|");
+ Utils.LOG_ERROR("_______");
+ String lineTwo = d+e+f;
+ Utils.LOG_ERROR("|"+d+"|"+e+"|"+f+"|");
+ Utils.LOG_ERROR("_______");
+ String lineThree = g+h+i;
+ Utils.LOG_ERROR("|"+g+"|"+h+"|"+i+"|");
+ Utils.LOG_ERROR("_______");
+
+ validSlots.add(0, lineOne);
+ validSlots.add(1, lineTwo);
+ validSlots.add(2, lineThree);
+ boolean advancedLog = false;
+ if (CORE.DEBUG){
+ advancedLog = true;
+ }
+ if (advancedLog){
+ int j = 0;
+ int l = validSlots.size();
+ Utils.LOG_WARNING("l:"+l);
+ while (j <= l) {
+ Utils.LOG_WARNING("j:"+j);
+ if (j <= 2){
+ Utils.LOG_WARNING("ArrayList Values: "+validSlots.get(j));
+ Utils.LOG_WARNING("Adding 1.");
+ j++;
+ }
+ else if (j >= 3){
+ Utils.LOG_WARNING("ArrayList Values: '"+validSlots.get(j)+"' "+validSlots.get(j+1));
+ if (j < (l-2)){
+ Utils.LOG_WARNING("Adding 2.");
+ j=j+2;
+ }
+ else {
+ Utils.LOG_WARNING("Done iteration.");
+ break;
+ }
+ }
+ else if (j == l){
+ Utils.LOG_WARNING("Done iteration.");
+ break;
+ }
+ if (validSlots.get(j) instanceof String || validSlots.get(j) instanceof ItemStack){
+ //Utils.LOG_WARNING("Is Valid: "+validSlots.get(j));
+ }
+ }
+ }
+
+ try {
+ GameRegistry.addRecipe(new ShapedOreRecipe(resultItem.copy(), (Object[]) validSlots.toArray()));
+ Utils.LOG_INFO("Success! Added a recipe for "+resultItem.toString());
+ if (!COMPAT_HANDLER.areInitItemsLoaded){
+ RegistrationHandler.recipesSuccess++;
+ }
+ else {
+ LateRegistrationHandler.recipesSuccess++;
+ }
+ }
+ catch(NullPointerException | ClassCastException k){
+ k.getMessage();
+ k.getClass();
+ k.printStackTrace();
+ k.getLocalizedMessage();
+ Utils.LOG_WARNING("@@@: Invalid Recipe detected for: "+resultItem.getUnlocalizedName());
+ if (!COMPAT_HANDLER.areInitItemsLoaded){
+ RegistrationHandler.recipesFailed++;
+ }
+ else {
+ LateRegistrationHandler.recipesFailed++;
+ }
+ }
+ }
+
+ public static void shapelessBuilder(ItemStack Output, Object slot_1, Object slot_2, Object slot_3, Object slot_4, Object slot_5, Object slot_6, Object slot_7, Object slot_8, Object slot_9){
+ //Item output_ITEM = Output.getItem();
+
+ ArrayList<Object> validSlots = new ArrayList<Object>();
+
+ Utils.LOG_INFO("Trying to add a recipe for "+Output.toString());
+ String a,b,c,d,e,f,g,h,i;
+ if (slot_1 == null){ a = " ";} else { a = "1";validSlots.add('1');validSlots.add(slot_1);}
+ Utils.LOG_WARNING(a);
+ if (slot_2 == null){ b = " ";} else { b = "2";validSlots.add('2');validSlots.add(slot_2);}
+ Utils.LOG_WARNING(b);
+ if (slot_3 == null){ c = " ";} else { c = "3";validSlots.add('3');validSlots.add(slot_3);}
+ Utils.LOG_WARNING(c);
+ if (slot_4 == null){ d = " ";} else { d = "4";validSlots.add('4');validSlots.add(slot_4);}
+ Utils.LOG_WARNING(d);
+ if (slot_5 == null){ e = " ";} else { e = "5";validSlots.add('5');validSlots.add(slot_5);}
+ Utils.LOG_WARNING(e);
+ if (slot_6 == null){ f = " ";} else { f = "6";validSlots.add('6');validSlots.add(slot_6);}
+ Utils.LOG_WARNING(f);
+ if (slot_7 == null){ g = " ";} else { g = "7";validSlots.add('7');validSlots.add(slot_7);}
+ Utils.LOG_WARNING(g);
+ if (slot_8 == null){ h = " ";} else { h = "8";validSlots.add('8');validSlots.add(slot_8);}
+ Utils.LOG_WARNING(h);
+ if (slot_9 == null){ i = " ";} else { i = "9";validSlots.add('9');validSlots.add(slot_9);}
+ Utils.LOG_WARNING(i);
+
+
+ Utils.LOG_ERROR("_______");
+ Utils.LOG_ERROR("|"+a+"|"+b+"|"+c+"|");
+ Utils.LOG_ERROR("_______");
+ Utils.LOG_ERROR("|"+d+"|"+e+"|"+f+"|");
+ Utils.LOG_ERROR("_______");
+ Utils.LOG_ERROR("|"+g+"|"+h+"|"+i+"|");
+ Utils.LOG_ERROR("_______");
+
+ validSlots.add(0, a);
+ validSlots.add(1, b);
+ validSlots.add(2, c);
+ validSlots.add(3, d);
+ validSlots.add(4, e);
+ validSlots.add(5, f);
+ validSlots.add(6, g);
+ validSlots.add(7, h);
+ validSlots.add(8, i);
+
+ try {
+ //GameRegistry.addRecipe(new ShapelessOreRecipe(Output, outputAmount), (Object[]) validSlots.toArray());
+ GameRegistry.addRecipe(new ShapelessOreRecipe(Output, (Object[]) validSlots.toArray()));
+ //GameRegistry.addShapelessRecipe(new ItemStack(output_ITEM, 1), new Object[] {slot_1, slot_2});
+ Utils.LOG_INFO("Success! Added a recipe for "+Output.toString());
+ RegistrationHandler.recipesSuccess++;
+ }
+ catch(RuntimeException k){
+ k.getMessage();
+ k.getClass();
+ k.printStackTrace();
+ k.getLocalizedMessage();
+ Utils.LOG_WARNING("@@@: Invalid Recipe detected for: "+Output.getUnlocalizedName());
+ RegistrationHandler.recipesFailed++;
+ }
+
+
+ //GameRegistry.addShapelessRecipe(new ItemStack(output_ITEM, 1), new Object[] {slot_1, slot_2});
+ }
+
+ public static void recipeBuilder(Object[] array, ItemStack outPut) {
+ Utils.LOG_SPECIFIC_WARNING("object Array - recipeBuilder", "Attempting to build a recipe using an object array as an input, splitting it, then running the normal recipeBuilder() method.", 396);
+ Object a=null;
+ Object b=null;
+ Object c=null;
+ Object d=null;
+ Object e=null;
+ Object f=null;
+ Object g=null;
+ Object h=null;
+ Object i=null;
+ for(int z =0; z <= array.length; z++){
+ array[z].toString();
+ switch(z)
+ {
+ case 0:
+ a = array[z];
+ break;
+ case 1:
+ b = array[z];
+ break;
+ case 2:
+ c = array[z];
+ break;
+ case 3:
+ d = array[z];
+ break;
+ case 4:
+ e = array[z];
+ break;
+ case 5:
+ f = array[z];
+ break;
+ case 6:
+ g = array[z];
+ break;
+ case 7:
+ h = array[z];
+ break;
+ case 8:
+ i = array[z];
+ break;
+ default:
+ break;
+ }
+ recipeBuilder(a, b, c, d, e, f, g, h, i, outPut);
+ }
+ }
+
+ public static boolean removeCraftingRecipe(Object x){
+ if (null == x){return false;}
+ if (x instanceof String){
+ Item R = UtilsItems.getItem((String) x);
+ if (R != null){
+ x = R;
+ }
+ else {
+ return false;
+ }
+ }
+ if (x instanceof Item || x instanceof ItemStack){
+ if (x instanceof Item){
+ ItemStack r = new ItemStack((Item) x);
+ Utils.LOG_INFO("Removing Recipe for "+r.getUnlocalizedName());
+ }
+ else {
+ Utils.LOG_INFO("Removing Recipe for "+((ItemStack) x).getUnlocalizedName());
+ }
+ if (x instanceof ItemStack){
+ Item r = ((ItemStack) x).getItem();
+ if (null != r){
+ x = r;
+ }
+ else {
+ Utils.LOG_INFO("Recipe removal failed - Tell Alkalus.");
+ return false;
+ }
+ }
+ if (UtilsRecipe.attemptRecipeRemoval((Item) x)){
+ Utils.LOG_INFO("Recipe removal successful");
+ return true;
+ }
+ Utils.LOG_INFO("Recipe removal failed - Tell Alkalus.");
+ return false;
+ }
+ return false;
+ }
+
+ private static boolean attemptRecipeRemoval(Item I){
+ Utils.LOG_WARNING("Create list of recipes.");
+ List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
+ Iterator<IRecipe> items = recipes.iterator();
+ Utils.LOG_WARNING("Begin list iteration.");
+ while (items.hasNext()) {
+ ItemStack is = items.next().getRecipeOutput();
+ if (is != null && is.getItem() == I){
+ items.remove();
+ Utils.LOG_INFO("Remove a recipe with "+I.getUnlocalizedName()+" as output.");
+ continue;
+ }
+ }
+ Utils.LOG_WARNING("All recipes should be gone?");
+ if (!items.hasNext()){
+ Utils.LOG_WARNING("We iterated once, let's try again to double check.");
+ Iterator<IRecipe> items2 = recipes.iterator();
+ while (items2.hasNext()) {
+ ItemStack is = items2.next().getRecipeOutput();
+ if (is != null && is.getItem() == I){
+ items.remove();
+ Utils.LOG_WARNING("REMOVING MISSED RECIPE - RECHECK CONSTRUCTORS");
+ return true;
+ }
+ }
+ Utils.LOG_WARNING("Should be all gone now after double checking, so return true.");
+ return true;
+ }
+ Utils.LOG_INFO("Return false, because something went wrong.");
+ return false;
+ }
+
+
+
+
+
+
+ public static void addShapedGregtechRecipe(
+ Object InputItem1, Object InputItem2, Object InputItem3,
+ Object InputItem4, Object InputItem5, Object InputItem6,
+ Object InputItem7, Object InputItem8, Object InputItem9,
+ ItemStack OutputItem){
+
+ if ((!(InputItem1 instanceof ItemStack) && !(InputItem1 instanceof String) && (InputItem1 != null)) ||
+ (!(InputItem2 instanceof ItemStack) && !(InputItem2 instanceof String) && (InputItem2 != null)) ||
+ (!(InputItem3 instanceof ItemStack) && !(InputItem3 instanceof String) && (InputItem3 != null)) ||
+ (!(InputItem4 instanceof ItemStack) && !(InputItem4 instanceof String) && (InputItem4 != null)) ||
+ (!(InputItem5 instanceof ItemStack) && !(InputItem5 instanceof String) && (InputItem5 != null)) ||
+ (!(InputItem6 instanceof ItemStack) && !(InputItem6 instanceof String) && (InputItem6 != null)) ||
+ (!(InputItem7 instanceof ItemStack) && !(InputItem7 instanceof String) && (InputItem7 != null)) ||
+ (!(InputItem8 instanceof ItemStack) && !(InputItem8 instanceof String) && (InputItem8 != null)) ||
+ (!(InputItem9 instanceof ItemStack) && !(InputItem9 instanceof String) && (InputItem9 != null))){
+ Utils.LOG_INFO("One Input item was not an ItemStack of an OreDict String.");
+ return;
+ }
+
+ GT_ModHandler.addCraftingRecipe(OutputItem,
+ GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.NOT_REMOVABLE |
+ GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED,
+ new Object[]{"ABC", "DEF", "GHI",
+ 'A', InputItem1,
+ 'B', InputItem2,
+ 'C', InputItem3,
+ 'D', InputItem4,
+ 'E', InputItem5,
+ 'F', InputItem6,
+ 'G', InputItem7,
+ 'H', InputItem8,
+ 'I', InputItem9});
+ }
+
+ public static void addShapelessGregtechRecipe(ItemStack OutputItem, Object... inputItems){
+
+ for(Object whatever : inputItems){
+ if (!(whatever instanceof ItemStack) && !(whatever instanceof String)){
+ Utils.LOG_INFO("One Input item was not an ItemStack of an OreDict String.");
+ return;
+ }
+ }
+
+ GT_ModHandler.addShapelessCraftingRecipe(OutputItem,
+ GT_ModHandler.RecipeBits.BUFFERED | GT_ModHandler.RecipeBits.NOT_REMOVABLE,
+ new Object[]{inputItems});
+ }
+
+ public static ItemStack getItemStackFromOreDict(String oredictName){
+ ArrayList<ItemStack> oreDictList = OreDictionary.getOres(oredictName);
+ return oreDictList.get(0);
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/core/util/wrapper/var.java b/src/Java/gtPlusPlus/core/util/wrapper/var.java
new file mode 100644
index 0000000000..d5e55bd658
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/util/wrapper/var.java
@@ -0,0 +1,67 @@
+package gtPlusPlus.core.util.wrapper;
+
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import net.minecraft.item.ItemStack;
+
+public class var{
+
+ private ItemStack temp = null;
+ private String sanitizedName;
+ private String fqrn;
+
+ public var(String o){
+ String t = sanitize('<', o);
+ String t2 = sanitize('>', t);
+ sanitizedName = t2;
+ o = sanitize('"', t2);
+ fqrn = o;
+ }
+
+ private String sanitize(char token, String input){
+ for (int i=0;i<input.length();i++) {
+ if (input.charAt(i) == token) {
+ input = input.replace(input.charAt(i), ' ');
+ Utils.LOG_WARNING("MATCH FOUND");
+ }
+ input = input.replaceAll(" ", "");
+ }
+ String output = input;
+ return output;
+ }
+
+ public String getFQRN(){
+ String s = fqrn;
+ return s;
+ }
+
+ public String getsanitizedName(){
+ String s = sanitizedName;
+ return s;
+ }
+
+ private ItemStack getOreDictStack(int stackSize){
+ ItemStack v = UtilsItems.getItemStack(sanitizedName, stackSize);
+ return v;
+ }
+
+ public ItemStack getStack(int stackSize){
+ String oreDict = "ore:";
+ if (fqrn.toLowerCase().contains(oreDict.toLowerCase())){
+ ItemStack v = getOreDictStack(stackSize);
+ return v;
+ }
+ String[] fqrnSplit = fqrn.split(":");
+ String meta = "0";
+ try {
+ if(fqrnSplit[2] != null){meta = fqrnSplit[2];}
+ temp = UtilsItems.getItemStackWithMeta(LoadedMods.MiscUtils, fqrn, fqrnSplit[1], Integer.parseInt(meta), stackSize);
+ }
+ catch (ArrayIndexOutOfBoundsException a){
+ temp = UtilsItems.getItemStackWithMeta(LoadedMods.MiscUtils, fqrn, fqrnSplit[1], Integer.parseInt(meta), stackSize);
+ }
+ return temp;
+ }
+
+ } \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java b/src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
new file mode 100644
index 0000000000..ff26064e98
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
@@ -0,0 +1,34 @@
+package gtPlusPlus.xmod.forestry;
+
+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 preInit(){
+ if (LoadedMods.Forestry){
+ FR_ItemRegistry.Register();
+ if (CORE.configSwitches.enableCustomAlvearyBlocks){
+ GameRegistry.registerTileEntity(TileAlvearyFrameHousing.class, "FrameHousing");
+ }
+ //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/FR_AlvearyFrameBlock.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_AlvearyFrameBlock.java
new file mode 100644
index 0000000000..2f4437afd1
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_AlvearyFrameBlock.java
@@ -0,0 +1,45 @@
+package gtPlusPlus.xmod.forestry.bees.alveary;
+
+import net.minecraft.util.ChunkCoordinates;
+
+import com.mojang.authlib.GameProfile;
+
+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{
+
+ @Override
+ public ChunkCoordinates getCoordinates() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public GameProfile getOwner() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void onMachineAssembled(IMultiblockController arg0,
+ ChunkCoordinates arg1, ChunkCoordinates arg2) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onMachineBroken() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ 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
new file mode 100644
index 0000000000..f087ad75f4
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_BlockAlveary.java
@@ -0,0 +1,274 @@
+package gtPlusPlus.xmod.forestry.bees.alveary;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+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,
+
+ //Placeholder Values
+ HEATER, HYGRO, STABILIZER, SIEVE;
+
+ public static final Type[] VALUES = values();
+
+ private Type() {}
+ }
+
+ public FR_BlockAlveary()
+ {
+ super(new MaterialBeehive(false));
+ setHardness(1.0F);
+ setCreativeTab(AddToCreativeTab.tabBlock);
+ setHarvestLevel("axe", 0);
+
+ }
+
+ @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)
+ 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));
+ }
+ }
+ }
+
+ @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 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(World world, int metadata)
+ {
+ if ((metadata < 0) || (metadata > Type.VALUES.length)) {
+ return null;
+ }
+
+
+
+ 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();
+ }
+ }
+
+ @Override
+ public Block setBlockName(String name) {
+ //int meta = this.
+ return super.setBlockName(name);
+ }
+
+ @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 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 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(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);
+ }
+ 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 switchForSide(42, side);
+ }
+ return switchForSide(41, side);
+ }
+ return this.getIcon(side, meta);
+ } else if (blockXP != this && blockXM == this) {
+ if (world.getBlockMetadata(x - 1, y, z) == 1) {
+ if (world.getBlock(x, y, z + 1) != this) {
+ return switchForSide(41, side);
+ }
+ return switchForSide(42, side);
+ }
+ return this.getIcon(side, meta);
+ }
+ return this.getIcon(side, meta);
+ }
+ @SideOnly(Side.CLIENT)
+ 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)];
+ }
+ @SideOnly(Side.CLIENT)
+ 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 void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
+ super.onNeighborBlockChange(world, x, y, z, block);
+ TileEntity tileEntity = world.getTileEntity(x, y, z);
+ if (tileEntity instanceof FR_TileAlveary) {
+ FR_TileAlveary tileAlveary = (FR_TileAlveary) tileEntity;
+ // We must check that the slabs on top were not removed
+ tileAlveary.getMultiblockLogic().getController().reassemble();
+ }
+ }
+ 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
new file mode 100644
index 0000000000..b5b3b73e6b
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/FR_TileAlveary.java
@@ -0,0 +1,199 @@
+package gtPlusPlus.xmod.forestry.bees.alveary;
+
+import java.io.IOException;
+import java.util.List;
+
+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.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.DataInputStreamForestry;
+import forestry.core.network.DataOutputStreamForestry;
+import forestry.core.network.IStreamableGui;
+import forestry.core.tiles.IClimatised;
+import forestry.core.tiles.ITitled;
+
+public abstract class FR_TileAlveary
+extends MultiblockTileEntityForestry<MultiblockLogicAlveary>
+implements IBeeHousing, IAlvearyComponent, IRestrictedAccess, IStreamableGui, ITitled, IClimatised, IHintSource, IGuiHandlerForestry
+{
+ private final String unlocalizedTitle;
+
+ protected FR_TileAlveary()
+ {
+ this(FR_BlockAlveary.Type.ERROR);
+ }
+
+ protected FR_TileAlveary(FR_BlockAlveary.Type type)
+ {
+ super(new MultiblockLogicAlveary());
+ this.unlocalizedTitle = ("advanced.tile.for.alveary." + type.ordinal() + ".name");
+
+ }
+
+ public int getIcon(int side)
+ {
+ return 0;
+ }
+
+ @Override
+ 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 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 BiomeGenBase getBiome()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBiome();
+ }
+
+ @Override
+ public Iterable<IBeeModifier> getBeeModifiers()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeeModifiers();
+ }
+
+ @Override
+ public Iterable<IBeeListener> getBeeListeners()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeeListeners();
+ }
+
+ @Override
+ public IBeeHousingInventory getBeeInventory()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeeInventory();
+ }
+
+ @Override
+ public IBeekeepingLogic getBeekeepingLogic()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeekeepingLogic();
+ }
+
+ @Override
+ public Vec3 getBeeFXCoordinates()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeeFXCoordinates();
+ }
+
+ @Override
+ public EnumTemperature getTemperature()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getTemperature();
+ }
+
+ @Override
+ public EnumHumidity getHumidity()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getHumidity();
+ }
+
+ @Override
+ public int getBlockLightValue()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBlockLightValue();
+ }
+
+ @Override
+ public boolean canBlockSeeTheSky()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().canBlockSeeTheSky();
+ }
+
+ @Override
+ public IErrorLogic getErrorLogic()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getErrorLogic();
+ }
+
+ @Override
+ public IAccessHandler getAccessHandler()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getAccessHandler();
+ }
+
+ @Override
+ public void onSwitchAccess(EnumAccess oldAccess, EnumAccess newAccess)
+ {
+ ((MultiblockLogicAlveary)getMultiblockLogic()).getController().onSwitchAccess(oldAccess, newAccess);
+ }
+
+ @Override
+ public IInventoryAdapter getInternalInventory()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getInternalInventory();
+ }
+
+ @Override
+ public String getUnlocalizedTitle()
+ {
+ return this.unlocalizedTitle;
+ }
+
+ @Override
+ public List<String> getHints()
+ {
+ return Config.hints.get("apiary");
+ }
+
+ @Override
+ public float getExactTemperature()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getExactTemperature();
+ }
+
+ @Override
+ public float getExactHumidity()
+ {
+ return ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getExactHumidity();
+ }
+
+ @Override
+ public void writeGuiData(DataOutputStreamForestry data)
+ throws IOException
+ {
+ ((MultiblockLogicAlveary)getMultiblockLogic()).getController().writeGuiData(data);
+ }
+
+ @Override
+ 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
new file mode 100644
index 0000000000..b55d2d37a6
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/IAlvearyComponentAdvanced.java
@@ -0,0 +1,28 @@
+package gtPlusPlus.xmod.forestry.bees.alveary;
+
+import forestry.api.apiculture.IBeeModifier;
+import forestry.api.core.IClimateControlled;
+import forestry.api.multiblock.IMultiblockComponent;
+import forestry.api.multiblock.IMultiblockLogicAlveary;
+
+public abstract interface IAlvearyComponentAdvanced<T extends IMultiblockLogicAlveary>
+extends IMultiblockComponent
+{
+ @Override
+ public abstract T getMultiblockLogic();
+
+
+ public static abstract interface FrameHouse
+ extends IAlvearyComponentAdvanced
+ {
+ public abstract void changeClimate(int paramInt, IClimateControlled paramIClimateControlled);
+ }
+
+
+ public static abstract interface BeeModifier
+ extends IAlvearyComponentAdvanced
+ {
+ public abstract IBeeModifier getBeeModifier();
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/ISidedFrameWearingInventory.java b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/ISidedFrameWearingInventory.java
new file mode 100644
index 0000000000..523c3e2434
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/ISidedFrameWearingInventory.java
@@ -0,0 +1,10 @@
+package gtPlusPlus.xmod.forestry.bees.alveary;
+
+import net.minecraft.inventory.ISidedInventory;
+import forestry.api.apiculture.IBeeHousing;
+
+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
new file mode 100644
index 0000000000..12f97b5f0c
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/TileAlvearyFrameHousing.java
@@ -0,0 +1,301 @@
+package gtPlusPlus.xmod.forestry.bees.alveary;
+
+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 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.IBee;
+import forestry.api.apiculture.IBeeHousing;
+import forestry.api.apiculture.IBeeModifier;
+import forestry.api.apiculture.IBeekeepingMode;
+import forestry.api.apiculture.IHiveFrame;
+import forestry.api.multiblock.IAlvearyComponent;
+import forestry.apiculture.ApiaryBeeModifier;
+import forestry.apiculture.multiblock.MultiblockLogicAlveary;
+import forestry.apiculture.network.packets.PacketActiveUpdate;
+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;
+import forestry.core.proxy.Proxies;
+import forestry.core.tiles.IActivatable;
+import forestry.core.utils.ItemStackUtil;
+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
+{
+ private final InventoryFrameHousing inventory;
+ private final Stack<ItemStack> pendingSpawns = new Stack<ItemStack>();
+ private boolean active;
+
+ public TileAlvearyFrameHousing()
+ {
+ super(FR_BlockAlveary.Type.FRAME);
+ this.inventory = new InventoryFrameHousing(this);
+
+ }
+
+ @Override
+ public IInventoryAdapter getInternalInventory()
+ {
+ return this.inventory;
+ }
+
+ @Override
+ public boolean allowsAutomation()
+ {
+ return true;
+ }
+
+ @Override
+ public void updateServer(int tickCount)
+ {
+
+ if (getInternalInventory() == null) {
+ return;
+ }
+
+ if (this.inventory.getStackInSlot(0) != null)
+ {
+ setActive(true);
+ if (tickCount % 1000 == 0) {
+ wearOutFrames(this, 1);
+ }
+ }
+ else
+ {
+ setActive(false);
+ }
+ if (tickCount % 500 != 0) {
+ return;
+ }
+
+ }
+
+ @Override
+ public void updateClient(int tickCount) {}
+
+ private ItemStack getPrincessStack()
+ {
+ ItemStack princessStack = ((MultiblockLogicAlveary)getMultiblockLogic()).getController().getBeeInventory().getQueen();
+ if (BeeManager.beeRoot.isMated(princessStack)) {
+ return princessStack;
+ }
+ return null;
+ }
+
+ private int consumeInducerAndGetChance()
+ {
+ if (getInternalInventory() == null) {
+ return 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;
+ }
+
+ private void trySpawnSwarm()
+ {
+ ItemStack toSpawn = (ItemStack)this.pendingSpawns.peek();
+ HiveDescriptionSwarmer hiveDescription = new HiveDescriptionSwarmer(new ItemStack[] { toSpawn });
+ Hive hive = new Hive(hiveDescription);
+
+ 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();
+ }
+ }
+
+ @Override
+ protected void encodeDescriptionPacket(NBTTagCompound packetData)
+ {
+ super.encodeDescriptionPacket(packetData);
+ packetData.setBoolean("Active", this.active);
+ }
+
+ @Override
+ protected void decodeDescriptionPacket(NBTTagCompound packetData)
+ {
+ super.decodeDescriptionPacket(packetData);
+ setActive(packetData.getBoolean("Active"));
+ }
+
+ @Override
+ public int getIcon(int side)
+ {
+ if ((side == 0) || (side == 1)) {
+ return 2;
+ }
+ if (this.active) {
+ return 6;
+ }
+ return 5;
+ }
+
+ @Override
+ public void readFromNBT(NBTTagCompound nbttagcompound)
+ {
+ super.readFromNBT(nbttagcompound);
+ setActive(nbttagcompound.getBoolean("Active"));
+
+ 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));
+ }
+ }
+
+ @Override
+ 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 boolean isActive()
+ {
+ return this.active;
+ }
+
+ @Override
+ public void setActive(boolean active)
+ {
+ if (this.active == active) {
+ return;
+ }
+ this.active = active;
+ if (!this.worldObj.isRemote) {
+ Proxies.net.sendNetworkPacket(new PacketActiveUpdate(this), this.worldObj);
+ }
+ }
+
+ @Override
+ public Object getGui(EntityPlayer player, int data)
+ {
+ return new GUI_FrameHousing(this, player);
+ }
+
+ @Override
+ public Object getContainer(EntityPlayer player, int data)
+ {
+ return new CONTAINER_FrameHousing(this, player);
+ }
+
+ private final IBeeModifier beeModifier = new ApiaryBeeModifier();
+ //private final IBeeListener beeListener = new ApiaryBeeListener(this);
+
+ @Override
+ public Collection<IBeeModifier> getBeeModifiers()
+ {
+ List<IBeeModifier> beeModifiers = new ArrayList<IBeeModifier>();
+
+ beeModifiers.add(this.beeModifier);
+ for (IHiveFrame frame : getFrames(this.inventory)) {
+ beeModifiers.add(frame.getBeeModifier());
+ }
+ return beeModifiers;
+ }
+
+ 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);
+ }
+ }
+ }
+ 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(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;
+
+ ItemStack queenStack = getQueenStack();
+ IBee queen = BeeManager.beeRoot.getMember(queenStack);
+ ItemStack usedFrame = hiveFrame.frameUsed(beeHousing, hiveFrameStack, queen, wear);
+
+ setInventorySlotContents(i, usedFrame);
+ }
+ }
+ }
+ }
+}
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
new file mode 100644
index 0000000000..c685482266
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/CONTAINER_FrameHousing.java
@@ -0,0 +1,98 @@
+package gtPlusPlus.xmod.forestry.bees.alveary.gui;
+
+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
+{
+ private TileAlvearyFrameHousing te;
+
+ 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;
+
+ public CONTAINER_FrameHousing(TileAlvearyFrameHousing te, EntityPlayer player)
+ {
+ this.te = te;
+ this.beeFrameSlot = new SlotFrame(te, slotID++, 80, 35);
+
+ //Fuel Slot A
+ beeFrameSlot.setBackgroundIconTexture(beeFrameIcon);
+
+ addSlotToContainer(beeFrameSlot);
+
+ //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++)
+ {
+ addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
+ }
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw)
+ {
+ ItemStack stack = null;
+ Slot slot = (Slot)inventorySlots.get(slotRaw);
+
+ 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:
+ // Check that the item is the right type
+ if (!(stack.getItem() instanceof IHiveFrame)){
+ return null;
+ }
+
+ if (slotRaw < 1)
+ {
+ if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true))
+ {
+ return null;
+ }
+ }
+ else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false))
+ {
+ return null;
+ }
+
+ if (stackInSlot.stackSize == 0)
+ {
+ slot.putStack((ItemStack)null);
+ }
+ 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
new file mode 100644
index 0000000000..dcf8da3a1a
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/GUI_FrameHousing.java
@@ -0,0 +1,49 @@
+package gtPlusPlus.xmod.forestry.bees.alveary.gui;
+
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.xmod.forestry.bees.alveary.TileAlvearyFrameHousing;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.client.resources.I18n;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.util.ResourceLocation;
+
+import org.lwjgl.opengl.GL11;
+
+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
new file mode 100644
index 0000000000..406c3c47cb
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/alveary/gui/InventoryFrameHousing.java
@@ -0,0 +1,21 @@
+package gtPlusPlus.xmod.forestry.bees.alveary.gui;
+
+import net.minecraft.item.ItemStack;
+import forestry.api.apiculture.BeeManager;
+import forestry.core.inventory.InventoryAdapterTile;
+import forestry.core.utils.ItemStackUtil;
+import gtPlusPlus.xmod.forestry.bees.alveary.TileAlvearyFrameHousing;
+
+public class InventoryFrameHousing extends InventoryAdapterTile<TileAlvearyFrameHousing>
+{
+ public InventoryFrameHousing(TileAlvearyFrameHousing alvearyFrame)
+ {
+ super(alvearyFrame, 1, "FrameHousingInv");
+ }
+
+ @Override
+ public boolean canSlotAccept(int slotIndex, ItemStack itemStack)
+ {
+ return ItemStackUtil.containsItemStack(BeeManager.inducers.keySet(), itemStack);
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java b/src/Java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java
new file mode 100644
index 0000000000..edd04661d7
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/items/FR_ItemRegistry.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2011-2014 SirSengir.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the GNU Lesser Public License v3
+ * which accompanies this distribution, and is available at
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Various Contributors including, but not limited to:
+ * 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;
+
+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
+ 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 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
new file mode 100644
index 0000000000..69065bec24
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/items/FR_StringUtil.java
@@ -0,0 +1,24 @@
+package gtPlusPlus.xmod.forestry.bees.items;
+
+import net.minecraft.util.StatCollector;
+
+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(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
new file mode 100644
index 0000000000..5a61c94196
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/items/MB_FrameType.java
@@ -0,0 +1,119 @@
+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(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(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;
+ this.productionMod = production;
+ this.floweringMod = flowering;
+ this.geneticDecayMod = geneticDecay;
+ this.isSealed = sealed;
+ this.isLit = lit;
+ this.isSunlit = sunlit;
+ this.isHellish = hellish;
+ }
+
+ public String getName()
+ {
+ return this.frameName;
+ }
+
+ public String getLocalizedName()
+ {
+ return FR_StringUtil.getLocalizedString("frame." + this.frameName);
+ }
+
+ @Override
+ public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
+ return territoryMod;
+ }
+
+ @Override
+ public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
+ return mutationMod;
+ }
+
+ @Override
+ public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
+ return lifespanMod;
+ }
+
+ @Override
+ public float getProductionModifier(IBeeGenome genome, float currentModifier) {
+ return productionMod;
+ }
+
+ @Override
+ public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
+ return floweringMod;
+ }
+
+ @Override
+ public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
+ return geneticDecayMod;
+ }
+
+ @Override
+ public boolean isSealed() {
+ return isSealed;
+ }
+
+ @Override
+ public boolean isSelfLighted() {
+ return isLit;
+ }
+
+ @Override
+ public boolean isSunlightSimulated() {
+ 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
new file mode 100644
index 0000000000..0f0e7d3109
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/items/MB_ItemFrame.java
@@ -0,0 +1,140 @@
+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.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;
+
+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(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);
+ this.setMaxStackSize(1);
+ this.setCreativeTab(AddToCreativeTab.tabMisc);
+ this.setUnlocalizedName("frame" + frameType.getName());
+ this.rarity_value = rarity;
+ this.toolTip = description;
+ GameRegistry.registerItem(this, "frame" + frameType.getName());
+ }
+
+ @Override
+ 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(IBeeHousing housing, ItemStack frame, IBee queen, int wear) {
+ frame.setItemDamage(frame.getItemDamage() + wear);
+
+ if (frame.getItemDamage() >= frame.getMaxDamage()) {
+ // Break the frame.
+ frame = null;
+ }
+
+ return frame;
+ }
+
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public EnumRarity getRarity(ItemStack par1ItemStack){
+ return rarity_value;
+ }
+
+ @Override
+ public boolean hasEffect(ItemStack par1ItemStack){
+ if (rarity_value == EnumRarity.uncommon || rarity_value == EnumRarity.common){
+ return false;
+ }
+ return true;
+ }
+
+ public IBeeModifier getBeeModifier() {
+ return type;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2)
+ {
+ return false;
+ }
+
+ public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
+ return type.getTerritoryModifier(genome, currentModifier);
+ }
+
+ public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
+ return type.getMutationModifier(genome, mate, currentModifier);
+ }
+
+ public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
+ return type.getLifespanModifier(genome, mate, currentModifier);
+ }
+
+ public float getProductionModifier(IBeeGenome genome, float currentModifier) {
+ return type.getProductionModifier(genome, currentModifier);
+ }
+
+ public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
+ return type.getFloweringModifier(genome, currentModifier);
+ }
+
+ public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
+ return type.getGeneticDecay(genome, currentModifier);
+ }
+
+ public boolean isSealed() {
+ return type.isSealed();
+ }
+
+ public boolean isSelfLighted() {
+ return type.isSelfLighted();
+ }
+
+ public boolean isSunlightSimulated() {
+ return type.isSunlightSimulated();
+ }
+
+ 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
new file mode 100644
index 0000000000..95049df43b
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/forestry/bees/recipe/FR_Gregtech_Recipes.java
@@ -0,0 +1,82 @@
+package gtPlusPlus.xmod.forestry.bees.recipe;
+
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+import gtPlusPlus.xmod.forestry.bees.items.FR_ItemRegistry;
+import net.minecraft.init.Blocks;
+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 = UtilsItems.getSimpleStack(FR_ItemRegistry.hiveFrameAccelerated);
+ private static ItemStack hiveFrameMutagenic = UtilsItems.getSimpleStack(FR_ItemRegistry.hiveFrameMutagenic);
+
+
+ private static ItemStack hiveFrameCocoa = UtilsItems.getSimpleStack(FR_ItemRegistry.hiveFrameCocoa);
+ private static ItemStack hiveFrameCaged = UtilsItems.getSimpleStack(FR_ItemRegistry.hiveFrameCaged);
+ private static ItemStack hiveFrameSoul = UtilsItems.getSimpleStack(FR_ItemRegistry.hiveFrameSoul);
+ private static ItemStack hiveFrameClay = UtilsItems.getSimpleStack(FR_ItemRegistry.hiveFrameClay);
+ private static ItemStack hiveFrameNova = UtilsItems.getSimpleStack(FR_ItemRegistry.hiveFrameNova);
+
+ private static ItemStack hiveFrameImpregnated = UtilsItems.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
+ UtilsRecipe.recipeBuilder(
+ rod_LongElectrumFlux, rod_ElectrumFlux, rod_LongElectrumFlux,
+ rod_LongElectrumFlux, foil_Electrum, rod_LongElectrumFlux,
+ rod_ElectrumFlux, rod_ElectrumFlux, rod_ElectrumFlux,
+ hiveFrameAccelerated);
+
+ UtilsRecipe.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
+ UtilsRecipe.recipeBuilder(
+ null, itemCocoaBeans, null,
+ itemCocoaBeans, hiveFrameImpregnated, itemCocoaBeans,
+ null, itemCocoaBeans, null,
+ hiveFrameCocoa);
+
+ UtilsRecipe.recipeBuilder(
+ hiveFrameImpregnated, blockIronBars, null,
+ null, null, null,
+ null, null, null,
+ hiveFrameCaged);
+
+ UtilsRecipe.recipeBuilder(
+ hiveFrameImpregnated, blockSoulSand, null,
+ null, null, null,
+ null, null, null,
+ hiveFrameSoul);
+
+ UtilsRecipe.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
new file mode 100644
index 0000000000..2217aecab9
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java
@@ -0,0 +1,49 @@
+package gtPlusPlus.xmod.gregtech;
+
+import gregtech.api.util.GT_Config;
+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.registration.gregtech.GregtechConduits;
+
+public class HANDLER_GT {
+
+ public static GT_Config mMaterialProperties = null;
+
+ public static void preInit(){
+ new MetaGeneratedGregtechItems();
+ if (mMaterialProperties != null){
+ GT_Materials.init(mMaterialProperties);
+ GregtechFluidHandler.run();
+ //new MetaGeneratedGregtechTools();
+ //new Processing_Ingot1();
+ //new Processing_Plate1();
+ //new Processing_Block();
+ }
+ //new Processing_HotIngots();
+ }
+
+ public static void init(){
+
+ //Add Custom Pipes, Wires and Cables.
+ GregtechConduits.run();
+
+ /*if (Meta_GT_Proxy.mSortToTheEnd) {
+ new GT_ItemIterator().run();
+ Meta_GT_Proxy.registerUnificationEntries();
+ new GT_FuelLoader().run();
+ }*/
+ }
+
+ public static void postInit(){
+ /*Meta_GT_Proxy.activateOreDictHandler();
+ if (Meta_GT_Proxy.mSortToTheEnd) {
+ Meta_GT_Proxy.registerUnificationEntries();
+ } else {
+ new GT_ItemIterator().run();
+ Meta_GT_Proxy.registerUnificationEntries();
+ new GT_FuelLoader().run();
+ }*/
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java b/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java
new file mode 100644
index 0000000000..4ec4589c03
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItem.java
@@ -0,0 +1,55 @@
+package gtPlusPlus.xmod.gregtech.api.energy;
+
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+
+/**
+ * Provides the ability to store energy on the implementing item.
+ *
+ * The item should have a maximum damage of 13.
+ */
+public interface IC2ElectricItem {
+ /**
+ * 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
+ */
+ boolean canProvideEnergy(ItemStack itemStack);
+
+ /**
+ * Get the item ID to use for a charge energy greater than 0.
+ *
+ * @return Item ID to use
+ */
+ Item getChargedItem(ItemStack itemStack);
+
+ /**
+ * Get the item ID to use for a charge energy of 0.
+ *
+ * @return Item ID to use
+ */
+ Item getEmptyItem(ItemStack itemStack);
+
+ /**
+ * Get the item's maximum charge energy in EU.
+ *
+ * @return Maximum charge energy
+ */
+ double getMaxCharge(ItemStack itemStack);
+
+ /**
+ * 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.
+ *
+ * @return Item's tier
+ */
+ int getTier(ItemStack itemStack);
+
+ /**
+ * Get the item's transfer limit in EU per transfer operation.
+ *
+ * @return Transfer limit
+ */
+ 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
new file mode 100644
index 0000000000..311947e5e6
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/energy/IC2ElectricItemManager.java
@@ -0,0 +1,95 @@
+package gtPlusPlus.xmod.gregtech.api.energy;
+
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.item.ItemStack;
+
+/**
+ * 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.
+ */
+public interface IC2ElectricItemManager {
+ /**
+ * 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
+ * @return Energy transferred into the electric item
+ */
+ double charge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean simulate);
+
+ /**
+ * 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
+ * @return Energy retrieved from the electric item
+ */
+ 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
+ * @return charge level in EU
+ */
+ double getCharge(ItemStack stack);
+
+ /**
+ * 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);
+
+ /**
+ * 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
+ * @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/GregtechItemList.java b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
new file mode 100644
index 0000000000..81252899e7
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java
@@ -0,0 +1,229 @@
+package gtPlusPlus.xmod.gregtech.api.enums;
+
+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;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.Fluid;
+
+/**
+ * Class containing all non-OreDict Items of GregTech.
+ */
+public enum GregtechItemList implements GregtechItemContainer {
+
+ Energy_Buffer_CREATIVE,
+
+ //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_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
+ 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_Engine_EV, Rocket_Engine_IV, Rocket_Engine_LuV,
+
+ //IronBlastFurnace Machine_Bronze_BlastFurnace
+ Machine_Iron_BlastFurnace, Casing_IronPlatedBricks,
+
+ //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
+ Casing_Coil_U1, Casing_Coil_U2, Casing_Coil_U3, Casing_Coil_U4,
+
+ //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,
+
+
+
+ Food_Baked_Raisin_Bread,
+
+
+ Industrial_SinterFurnace,
+
+ SuperConductorInputNode,
+
+ Casing_Reactor_I, Casing_Reactor_II,
+
+ PowerSubStation,
+
+ GT_Dehydrator_EV, GT_Dehydrator_IV, GT_Dehydrator_LuV, GT_Dehydrator_ZPM;
+
+ 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 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 GregtechItemList set(ItemStack aStack) {
+ mHasNotBeenSet = false;
+ mStack = GT_Utility.copyAmount(1, aStack);
+ return this;
+ }
+
+ @Override
+ 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 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 final boolean hasBeenSet() {
+ return !mHasNotBeenSet;
+ }
+
+ @Override
+ public boolean isStackEqual(Object aStack) {
+ return isStackEqual(aStack, false, false);
+ }
+
+ @Override
+ 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 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 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 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 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 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 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 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 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 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
new file mode 100644
index 0000000000..dcb075349d
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOreDictNames.java
@@ -0,0 +1,39 @@
+package gtPlusPlus.xmod.gregtech.api.enums;
+
+/* 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)
+*
+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;
+*/
+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;
+
+ public String unlocalisedName;
+
+ private void ModObject() {
+ 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
new file mode 100644
index 0000000000..93ac3463fb
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java
@@ -0,0 +1,826 @@
+package gtPlusPlus.xmod.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.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.GT_Config;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.lib.CORE;
+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.
+ *
+ * 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, 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>();
+ 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, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("wire") || name().startsWith("cable")) {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("dust")) {
+ getTcAspectStack(TC_Aspects.PERDITIO, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("crushed")) {
+ getTcAspectStack(TC_Aspects.PERFODIO, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("ingot") || name().startsWith("nugget")) {
+ getTcAspectStack(TC_Aspects.METALLUM, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("armor")) {
+ getTcAspectStack(TC_Aspects.TUTAMEN, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("stone")) {
+ getTcAspectStack(TC_Aspects.TERRA, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("pipe")) {
+ getTcAspectStack(TC_Aspects.ITER, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("gear")) {
+ getTcAspectStack(TC_Aspects.MOTUS, 1).addToAspectList(mAspects);
+ getTcAspectStack(TC_Aspects.MACHINA, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("frame") || name().startsWith("plate")) {
+ getTcAspectStack(TC_Aspects.FABRICO, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("tool")) {
+ getTcAspectStack(TC_Aspects.INSTRUMENTUM, 2).addToAspectList(mAspects);
+ } else if (name().startsWith("gem") || name().startsWith("crystal") || name().startsWith("lens")) {
+ getTcAspectStack(TC_Aspects.VITREUS, 1).addToAspectList(mAspects);
+ } else if (name().startsWith("crate")) {
+ getTcAspectStack(TC_Aspects.ITER, 2).addToAspectList(mAspects);
+ } else if (name().startsWith("circuit")) {
+ getTcAspectStack(TC_Aspects.COGNITIO, 1);
+ } else if (name().startsWith("computer")) {
+ getTcAspectStack(TC_Aspects.COGNITIO, 4).addToAspectList(mAspects);
+ } else if (name().startsWith("battery")) {
+ getTcAspectStack(TC_Aspects.ELECTRUM, 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));
+ }
+ }
+
+ 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.
+ * <p/>
+ * 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);
+ *
+ */
+ _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, 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(TC_Aspects.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(TC_Aspects.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(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))),
+ VoidMetal(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(TC_Aspects.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(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);*/
+ Symbiotic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Neutronic.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ Quantum.add(SubTag.NO_SMASHING, SubTag.NO_SMELTING);
+ }
+
+
+ /**
+ * 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 = 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
+ */
+ 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 {
+ 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.
+ */
+ 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);
+ 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
+ */
+ 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) {
+ mChemicalFormula = "Empty";
+ } else {
+ mChemicalFormula = aElement.toString();
+ mChemicalFormula = mChemicalFormula.replaceAll("_", "-");
+ }
+ mAspects.addAll(aAspects);
+ }
+
+ 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(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 (MaterialStack tMaterial : mMaterialList) {
+ tAmountOfComponents += tMaterial.mAmount;
+ if (tMaterial.mMaterial.mMeltingPoint > 0)
+ tMeltingPoint += tMaterial.mMaterial.mMeltingPoint * tMaterial.mAmount;
+ if (aAspects == null)
+ for (TC_AspectStack tAspect : tMaterial.mMaterial.mAspects) tAspect.addToAspectList(mAspects);
+ }
+
+ if (mMeltingPoint < 0) mMeltingPoint = (short) (tMeltingPoint / tAmountOfComponents);
+
+ tAmountOfComponents *= aDensityMultiplier;
+ tAmountOfComponents /= aDensityDivider;
+ if (aAspects == null) for (TC_AspectStack tAspect : mAspects)
+ tAspect.mAmount = Math.max(1, tAspect.mAmount / Math.max(1, tAmountOfComponents));
+ else mAspects.addAll(aAspects);
+ }
+
+ 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;
+ }
+
+ public static GT_Materials getRealMaterial(String aMaterialName) {
+ return get(aMaterialName).mMaterialInto;
+ }
+
+ /**
+ * Called in preInit with the Config to set Values.
+ *
+ * @param aConfiguration
+ */
+ 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);
+ }
+ }
+
+ public boolean isRadioactive() {
+ if (mElement != null) return mElement.mHalfLifeSeconds >= 0;
+ for (MaterialStack tMaterial : mMaterialList) if (tMaterial.mMaterial.isRadioactive()) return true;
+ return false;
+ }
+
+ public long getProtons() {
+ if (mElement != null) return mElement.getProtons();
+ if (mMaterialList.size() <= 0) return Element.Tc.getProtons();
+ long rAmount = 0, tAmount = 0;
+ for (MaterialStack tMaterial : mMaterialList) {
+ tAmount += tMaterial.mAmount;
+ rAmount += tMaterial.mAmount * tMaterial.mMaterial.getProtons();
+ }
+ return (getDensity() * rAmount) / (tAmount * M);
+ }
+
+ public long getNeutrons() {
+ if (mElement != null) return mElement.getNeutrons();
+ if (mMaterialList.size() <= 0) return Element.Tc.getNeutrons();
+ long rAmount = 0, tAmount = 0;
+ for (MaterialStack tMaterial : mMaterialList) {
+ tAmount += tMaterial.mAmount;
+ rAmount += tMaterial.mAmount * tMaterial.mMaterial.getNeutrons();
+ }
+ return (getDensity() * rAmount) / (tAmount * M);
+ }
+
+ public long getMass() {
+ if (mElement != null) return mElement.getMass();
+ if (mMaterialList.size() <= 0) return Element.Tc.getMass();
+ long rAmount = 0, tAmount = 0;
+ for (MaterialStack tMaterial : mMaterialList) {
+ tAmount += tMaterial.mAmount;
+ rAmount += tMaterial.mAmount * tMaterial.mMaterial.getMass();
+ }
+ return (getDensity() * rAmount) / (tAmount * M);
+ }
+
+ public long getDensity() {
+ return mDensity;
+ }
+
+ public String getToolTip() {
+ return getToolTip(1, false);
+ }
+
+ public String getToolTip(boolean aShowQuestionMarks) {
+ return getToolTip(1, aShowQuestionMarks);
+ }
+
+ public String getToolTip(long aMultiplier) {
+ return getToolTip(aMultiplier, false);
+ }
+
+ 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 mChemicalFormula;
+ }
+
+ /**
+ * 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(ItemStack aStack) {
+ if (aStack == null) return false;
+ boolean temp = false;
+ for (int i = 0; i < mMaterialItems.size(); i++)
+ if (GT_Utility.areStacksEqual(aStack, mMaterialItems.get(i))) {
+ mMaterialItems.remove(i--);
+ temp = true;
+ }
+ return temp;
+ }
+
+ /**
+ * Adds a SubTag to this Material
+ */
+ @Override
+ 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;
+ }
+
+ /**
+ * If this Material has this exact SubTag
+ */
+ @Override
+ public boolean contains(SubTag aTag) {
+ return mSubTags.contains(aTag);
+ }
+
+ /**
+ * Removes a SubTag from this Material
+ */
+ @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;
+ }
+
+ /**
+ * 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(GT_Materials aMaterial) {
+ if (!mOreByProducts.contains(aMaterial.mMaterialInto)) mOreByProducts.add(aMaterial.mMaterialInto);
+ return this;
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * If this Ore gives multiple drops of its Byproduct Material.
+ */
+ public GT_Materials setByProductMultiplier(int aByProductMultiplier) {
+ if (aByProductMultiplier > 0) mByProductMultiplier = aByProductMultiplier;
+ return this;
+ }
+
+ /**
+ * If this Ore gives multiple drops of its Main Material.
+ * Lapis Ore for example gives about 6 drops.
+ */
+ public GT_Materials setSmeltingMultiplier(int aSmeltingMultiplier) {
+ if (aSmeltingMultiplier > 0) mSmeltingMultiplier = aSmeltingMultiplier;
+ return this;
+ }
+
+ /**
+ * This Ore should be smolten directly into an Ingot of this Material instead of an Ingot of itself.
+ */
+ public GT_Materials setDirectSmelting(GT_Materials aMaterial) {
+ if (aMaterial != null) mDirectSmelting = aMaterial.mMaterialInto.mDirectSmelting;
+ return this;
+ }
+
+ /**
+ * This Material should be the Main Material this Ore gets ground into.
+ * Example, Chromite giving Chrome or Tungstate giving Tungsten.
+ */
+ 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.
+ */
+ public GT_Materials setSmeltingInto(GT_Materials aMaterial) {
+ if (aMaterial != null) mSmeltInto = aMaterial.mMaterialInto.mSmeltInto;
+ return this;
+ }
+
+ /**
+ * This Material arc smelts always into an instance of aMaterial. Used for Wrought Iron.
+ */
+ public GT_Materials setArcSmeltingInto(GT_Materials aMaterial) {
+ if (aMaterial != null) mArcSmeltInto = aMaterial.mMaterialInto.mArcSmeltInto;
+ return this;
+ }
+
+ /**
+ * 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;
+ }
+
+ public GT_Materials setEnchantmentForTools(Enchantment aEnchantment, int aEnchantmentLevel) {
+ mEnchantmentTools = aEnchantment;
+ mEnchantmentToolsLevel = (byte) aEnchantmentLevel;
+ return this;
+ }
+
+ public GT_Materials setEnchantmentForArmors(Enchantment aEnchantment, int aEnchantmentLevel) {
+ mEnchantmentArmors = aEnchantment;
+ mEnchantmentArmorsLevel = (byte) aEnchantmentLevel;
+ return this;
+ }
+
+ public FluidStack getSolid(long aAmount) {
+ if (mSolid == null) return null;
+ return new GT_FluidStack(mSolid, (int) aAmount);
+ }
+
+ public FluidStack getFluid(long aAmount) {
+ if (mFluid == null) return null;
+ return new GT_FluidStack(mFluid, (int) aAmount);
+ }
+
+ public FluidStack getGas(long aAmount) {
+ if (mGas == null) return null;
+ return new GT_FluidStack(mGas, (int) aAmount);
+ }
+
+ public FluidStack getPlasma(long aAmount) {
+ if (mPlasma == null) return null;
+ return new GT_FluidStack(mPlasma, (int) aAmount);
+ }
+
+ public FluidStack getMolten(long aAmount) {
+ if (mStandardMoltenFluid == null) return null;
+ return new GT_FluidStack(mStandardMoltenFluid, (int) aAmount);
+ }
+
+ @Override
+ public short[] getRGBA() {
+ return mRGBa;
+ }
+
+ public static volatile int VERSION = 508;
+
+ }
+
+} \ 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
new file mode 100644
index 0000000000..0b8c605e42
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextureSet.java
@@ -0,0 +1,144 @@
+package gtPlusPlus.xmod.gregtech.api.enums;
+
+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 final IIconContainer[] mTextures = new IIconContainer[128];
+ public final String mSetName;
+
+ 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
new file mode 100644
index 0000000000..705f5b338e
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechTextures.java
@@ -0,0 +1,199 @@
+package gtPlusPlus.xmod.gregtech.api.enums;
+
+import gregtech.api.GregTech_API;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_IconContainer;
+import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_Texture;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.ResourceLocation;
+
+public class GregtechTextures {
+ 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 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
+ };
+
+ public static Interface_Texture[]
+ GT_CASING_BLOCKS = new Interface_Texture[64];
+
+ protected IIcon mIcon;
+
+ private BlockIcons() {
+ CORE.GT_BlockIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return null;
+ }
+
+ @Override
+ public void run() {
+ mIcon = GregTech_API.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;
+ CORE.GT_BlockIconload.add(this);
+ }
+
+ @Override
+ public IIcon getIcon() {
+ return mIcon;
+ }
+
+ @Override
+ public IIcon getOverlayIcon() {
+ return null;
+ }
+
+ @Override
+ public void run() {
+ mIcon = CORE.GT_BlockIcons.registerIcon(CORE.MODID + ":" + mIconName);
+ }
+
+ @Override
+ public ResourceLocation getTextureFile() {
+ return TextureMap.locationBlocksTexture;
+ }
+ }
+ }
+
+
+ public enum ItemIcons implements Interface_IconContainer, Runnable {
+ VOID // The Empty Texture
+ , RENDERING_ERROR, SKOOKUMCHOOCHER, 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, TURBINE, 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() {
+ 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.MODID+ ":" + "iconsets/" + this);
+ mOverlay = GregTech_API.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;
+ 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);
+ mOverlay = GregTech_API.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
new file mode 100644
index 0000000000..aa0e347ca9
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/enums/GregtechToolDictNames.java
@@ -0,0 +1,7 @@
+package gtPlusPlus.xmod.gregtech.api.enums;
+
+public enum GregtechToolDictNames {
+
+ craftingToolSkookumChoocher;
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java
new file mode 100644
index 0000000000..4083875fdb
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IndustrialCentrifuge.java
@@ -0,0 +1,38 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Slot;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * The Container I use for all my Basic Machines
+ */
+public class CONTAINER_IndustrialCentrifuge extends GT_ContainerMetaTile_Machine {
+
+ 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
new file mode 100644
index 0000000000..0a19c62d0c
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_IronBlastFurnace.java
@@ -0,0 +1,31 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.gui.GT_Slot_Output;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Slot;
+
+public class CONTAINER_IronBlastFurnace extends GT_ContainerMetaTile_Machine {
+ public CONTAINER_IronBlastFurnace(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @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 getSlotCount() {
+ 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
new file mode 100644
index 0000000000..a258274f07
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java
@@ -0,0 +1,41 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityMassFabricator;
+import net.minecraft.entity.player.InventoryPlayer;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * The Container I use for all my Basic Machines
+ */
+public class CONTAINER_MatterFab extends GT_ContainerMetaTile_Machine {
+
+ public int mUUA_USED = ((GregtechMetaTileEntityMassFabricator)this.mTileEntity.getMetaTileEntity()).getAmplifierUsed();
+ public int mUUM_MADE = ((GregtechMetaTileEntityMassFabricator)this.mTileEntity.getMetaTileEntity()).getMatterProduced();
+
+ public CONTAINER_MatterFab(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ public CONTAINER_MatterFab(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;
+ }
+}*/
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
new file mode 100644
index 0000000000..9e0a7869e5
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MultiMachine.java
@@ -0,0 +1,36 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * The Container I use for all my Basic Machines
+ */
+public class CONTAINER_MultiMachine extends GT_ContainerMetaTile_Machine {
+ public CONTAINER_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ 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;
+ }
+}*/
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SafeBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SafeBlock.java
new file mode 100644
index 0000000000..4a10923760
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SafeBlock.java
@@ -0,0 +1,123 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+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 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(InventoryPlayer aInventoryPlayer) {
+ for (int y = 0; y < 3; y++) {
+ for (int x = 0; x < 9; x++) {
+ addSlotToContainer(new Slot(this.mTileEntity, x + y * 9, 8 + x * 18, 5 + y * 18));
+ }
+ }
+ 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(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) {
+ int runs = 0;
+ if (aSlotIndex < 27) {
+ return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);
+ }
+ 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 == 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;
+ }*/
+
+ {
+ ((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
new file mode 100644
index 0000000000..46c8720651
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SolarGenerator.java
@@ -0,0 +1,80 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntitySolarGenerator;
+
+import java.util.Iterator;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.ICrafting;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+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;
+ }
+
+ 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));
+ }
+
+ public int getSlotCount() {
+ return 0;
+ }
+
+ 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));
+
+ 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);
+ }
+ }
+
+ @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
new file mode 100644
index 0000000000..3feea9d2df
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_SteamCondenser.java
@@ -0,0 +1,97 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+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 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_IndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java
new file mode 100644
index 0000000000..38726f12d8
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IndustrialCentrifuge.java
@@ -0,0 +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;
+
+ 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 drawGuiContainerForegroundLayer(int par1, int par2) {
+ fontRendererObj.drawString(mName, 10, 8, 16448255);
+ if (counter >= 100){
+ counter = 0;
+ }
+ else {
+ counter++;
+ }
+ 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) 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
new file mode 100644
index 0000000000..1ce7bdea68
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_IronBlastFurnace.java
@@ -0,0 +1,30 @@
+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_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 drawGuiContainerForegroundLayer(int par1, 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
new file mode 100644
index 0000000000..f7101e5ae4
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java
@@ -0,0 +1,72 @@
+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;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <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
+ */
+public class GUI_MatterFab extends GT_GUIContainerMetaTile_Machine {
+
+ String mName = "";
+ int uuaUsed = 0;
+ int uumMade = 0;
+
+ 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 drawGuiContainerForegroundLayer(int par1, int par2) {
+ fontRendererObj.drawString(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 (((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);
+ }
+ }
+ }
+ }
+
+ @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
new file mode 100644
index 0000000000..c4114e70e1
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
@@ -0,0 +1,64 @@
+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;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <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
+ */
+public class GUI_MultiMachine extends GT_GUIContainerMetaTile_Machine {
+
+ String mName = "";
+
+ 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 drawGuiContainerForegroundLayer(int par1, int par2) {
+ fontRendererObj.drawString(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 (((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);
+ }
+ }
+ }
+ }
+
+ @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
new file mode 100644
index 0000000000..d5f970870b
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SafeBlock.java
@@ -0,0 +1,49 @@
+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_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
new file mode 100644
index 0000000000..7c185ebb94
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SolarGenerator.java
@@ -0,0 +1,41 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+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(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aTextureName, int aSteamCapacity) {
+ super(new CONTAINER_SolarGenerator(aInventoryPlayer, aTileEntity, aSteamCapacity), "gregtech:textures/gui/" + aTextureName);
+ }
+
+ protected void drawGuiContainerForegroundLayer(int par1, 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
new file mode 100644
index 0000000000..9c4e14f0dc
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/gui/GUI_SteamCondenser.java
@@ -0,0 +1,55 @@
+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_SteamCondenser extends GT_GUIContainerMetaTile_Machine
+{
+ long tickTime = 0;
+
+ 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
new file mode 100644
index 0000000000..3c29b34e27
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/GregtechItemContainer.java
@@ -0,0 +1,24 @@
+package gtPlusPlus.xmod.gregtech.api.interfaces;
+
+import net.minecraft.block.Block;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+
+public interface GregtechItemContainer {
+ public Item getItem();
+ public Block getBlock();
+ public boolean isStackEqual(Object aStack);
+ public boolean isStackEqual(Object aStack, boolean aWildcard, boolean aIgnoreNBT);
+ 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
new file mode 100644
index 0000000000..6aada2bdac
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java
@@ -0,0 +1,55 @@
+package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
+
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+public interface IGregtech_RecipeAdder {
+ /**
+ * Adds a Coke Oven 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)
+ * @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 addFuel(ItemStack aInput1, ItemStack aOutput1, int aEU, int aType);
+
+
+ /**
+ * Adds a Matter Fabricator Recipe
+ *
+ * @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 addMatterFabricatorRecipe(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt);
+
+
+
+
+ /**
+ * Adds a Recipe for the Sifter. (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)
+ * @return true if the Recipe got added, otherwise false.
+ */
+
+ public boolean addDehydratorRecipe(FluidStack aFluid, FluidStack aOutputFluid, ItemStack[] aOutputItems, int aDuration, int aEUt);
+ public boolean addDehydratorRecipe(ItemStack aInput, FluidStack aFluid, 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);
+ public boolean addDehydratorRecipe(ItemStack aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack[] aOutputItems, int[] aChances, 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
new file mode 100644
index 0000000000..8e1715caf5
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_IconContainer.java
@@ -0,0 +1,21 @@
+package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
+
+import net.minecraft.util.IIcon;
+import net.minecraft.util.ResourceLocation;
+
+public interface Interface_IconContainer {
+ /**
+ * @return A regular Icon.
+ */
+ public IIcon getIcon();
+
+ /**
+ * @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();
+} \ 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
new file mode 100644
index 0000000000..03f7b1bd1e
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ItemBehaviour.java
@@ -0,0 +1,41 @@
+package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
+
+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;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.projectile.EntityArrow;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+
+public interface Interface_ItemBehaviour<E extends Item> {
+ public boolean onLeftClickEntity(E aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity);
+
+ 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 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 ItemStack onItemRightClick(E aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer);
+
+ public List<String> getAdditionalToolTips(E aItem, List<String> aList, ItemStack aStack);
+
+ public void onUpdate(E aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand);
+
+ public boolean isItemStackUsable(E aItem, ItemStack aStack);
+
+ public boolean canDispense(E aItem, IBlockSource aSource, ItemStack aStack);
+
+ public ItemStack onDispense(E aItem, IBlockSource aSource, ItemStack aStack);
+
+ public boolean hasProjectile(Gregtech_MetaItem_Base aItem, SubTag aProjectileType, ItemStack aStack);
+
+ public EntityArrow getProjectile(E aItem, SubTag aProjectileType, ItemStack aStack, World aWorld, double aX, double aY, double aZ);
+
+ 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
new file mode 100644
index 0000000000..f1583764f7
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator.java
@@ -0,0 +1,16 @@
+package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
+
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
+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);
+} \ 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
new file mode 100644
index 0000000000..ed276ad3f9
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_OreRecipeRegistrator_GT.java
@@ -0,0 +1,16 @@
+package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
+
+import gregtech.api.enums.OrePrefixes;
+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);
+} \ 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
new file mode 100644
index 0000000000..76c5113186
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_Texture.java
@@ -0,0 +1,20 @@
+package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.RenderBlocks;
+
+public interface Interface_Texture {
+ 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 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 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 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
new file mode 100644
index 0000000000..3d94d449a6
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/Interface_ToolStats.java
@@ -0,0 +1,160 @@
+package gtPlusPlus.xmod.gregtech.api.interfaces.internal;
+
+import gregtech.api.interfaces.IIconContainer;
+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;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.DamageSource;
+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.
+ */
+public interface Interface_ToolStats {
+ /**
+ * Called when aPlayer crafts this Tool
+ */
+ public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer);
+
+ /**
+ * Called when this gets added to a Tool Item
+ */
+ public void onStatsAddedToTool(Gregtech_MetaTool gregtech_MetaTool, int aID);
+
+ /**
+ * @return Damage the Tool receives when breaking a Block. 100 is one Damage Point (or 100 EU).
+ */
+ public int getToolDamagePerBlockBreak();
+
+ /**
+ * @return Damage the Tool receives when converting the drops of a Block. 100 is one Damage Point (or 100 EU).
+ */
+ public int getToolDamagePerDropConversion();
+
+ /**
+ * @return Damage the Tool receives when being used as Container Item. 100 is one use, however it is usually 8 times more than normal.
+ */
+ public int getToolDamagePerContainerCraft();
+
+ /**
+ * @return Damage the Tool receives when being used as Weapon, 200 is the normal Value, 100 for actual Weapons.
+ */
+ public int getToolDamagePerEntityAttack();
+
+ /**
+ * @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();
+
+ /**
+ * @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)
+ */
+ public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity);
+
+ /**
+ * @return This is a multiplier for the Tool Speed. 1.0F = no special Speed.
+ */
+ public float getSpeedMultiplier();
+
+ /**
+ * @return This is a multiplier for the Tool Speed. 1.0F = no special Durability.
+ */
+ public float getMaxDurabilityMultiplier();
+
+ public DamageSource getDamageSource(EntityLivingBase aPlayer, Entity aEntity);
+
+ public String getMiningSound();
+
+ public String getCraftingSound();
+
+ public String getEntityHitSound();
+
+ public String getBreakingSound();
+
+ public Enchantment[] getEnchantments(ItemStack aStack);
+
+ public int[] getEnchantmentLevels(ItemStack aStack);
+
+ /**
+ * @return If this Tool can be used for blocking Damage like a Sword.
+ */
+ public boolean canBlock();
+
+ /**
+ * @return If this Tool can be used as an RC Crowbar.
+ */
+ public boolean isCrowbar();
+
+ /**
+ * @return If this Tool can be used as an BC Wrench.
+ */
+ public boolean isWrench();
+
+ /**
+ * @return If this Tool can be used as Weapon i.e. if that is the main purpose.
+ */
+ public boolean isWeapon();
+
+ /**
+ * @return If this Tool is a Ranged Weapon. Return false at isWeapon unless you have a Blade attached to your Bow/Gun or something
+ */
+ public boolean isRangedWeapon();
+
+ /**
+ * @return If this Tool can be used as Weapon i.e. if that is the main purpose.
+ */
+ 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"
+ *
+ * @return If this is a minable Block. Tool Quality checks (like Diamond Tier or something) are separate from this check.
+ */
+ public boolean isMinableBlock(Block aBlock, byte aMetaData);
+
+ /**
+ * This lets you modify the Drop List, when this type of Tool has been used.
+ *
+ * @return the Amount of modified Items.
+ */
+ 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 Returns a broken Version of the Item.
+ */
+ public ItemStack getBrokenItem(ItemStack aStack);
+
+ /**
+ * @return the Damage actually done to the Mob.
+ */
+ public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer);
+
+ /**
+ * @return the Damage actually done to the Mob.
+ */
+ public float getMagicDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer);
+
+ public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack);
+
+ public short[] getRGBa(boolean aIsToolHead, ItemStack aStack);
+
+ /**
+ * Called when this gets added to a Tool Item
+ */
+ //public void onStatsAddedToTool(GT_MetaGenerated_Tool aItem, int aID);
+} \ 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
new file mode 100644
index 0000000000..1c135a7f92
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_Generic_Item.java
@@ -0,0 +1,186 @@
+package gtPlusPlus.xmod.gregtech.api.items;
+
+import gregtech.api.enums.SubTag;
+import gregtech.api.interfaces.IProjectileItem;
+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.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;
+import net.minecraft.entity.projectile.EntityArrow;
+import net.minecraft.item.Item;
+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.
+ */
+public class Gregtech_Generic_Item extends Item implements IProjectileItem {
+ 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")){
+ HEX_OxFFFFFF = 0xffff00;
+ }
+ else if (stack.getDisplayName().contains("MAX")){
+ HEX_OxFFFFFF = 0xff0000;
+ }
+ else if (stack.getDisplayName().contains("Sodium")){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(0, 0, 150);
+ }
+ else if (stack.getDisplayName().contains("Cadmium")){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(50, 50, 60);
+ }
+ else if (stack.getDisplayName().contains("Lithium")){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(225, 220, 255);
+ }
+ else {
+ HEX_OxFFFFFF = 0xffffff;
+ }
+ return HEX_OxFFFFFF;
+ }
+} \ 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
new file mode 100644
index 0000000000..484cc19ea7
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem.java
@@ -0,0 +1,323 @@
+package gtPlusPlus.xmod.gregtech.api.items;
+
+import static gregtech.api.enums.GT_Values.D1;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.SubTag;
+import gregtech.api.enums.TC_Aspects.TC_AspectStack;
+import gregtech.api.interfaces.IFoodStat;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.interfaces.IItemContainer;
+import gregtech.api.objects.ItemData;
+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.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>();
+
+ /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
+
+ 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>();
+
+ /**
+ * 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);
+
+ mOffset = (short) Math.min(32766, aOffset);
+ mItemAmount = (short) Math.min(aItemAmount, 32766 - mOffset);
+ mIconList = new IIcon[aItemAmount][1];
+
+ 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(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;
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * @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;
+ }
+
+ /**
+ * @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;
+ }
+
+ /**
+ * @return if this MetaGenerated Item should use my Default Renderer System.
+ */
+ public boolean useStandardMetaItemRenderer() {
+ return true;
+ }
+
+ /**
+ * @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 ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ return super.onItemRightClick(aStack, aWorld, aPlayer);
+ }
+
+ @Override
+ public int getMaxItemUseDuration(ItemStack aStack) {
+ return mFoodStats.get((short) getDamage(aStack)) == null ? 0 : 32;
+ }
+
+ @Override
+ public EnumAction getItemUseAction(ItemStack aStack) {
+ return EnumAction.none;
+ }
+
+ @Override
+ public final ItemStack onEaten(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ IFoodStat tStat = mFoodStats.get((short) getDamage(aStack));
+ if (tStat != null) {
+
+ }
+ return aStack;
+ }
+
+ @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
+ @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);
+ }
+ }
+
+ @Override
+ public final Long[] getElectricStats(ItemStack aStack) {
+ return mElectricStats.get((short) aStack.getItemDamage());
+ }
+
+ @Override
+ public final Long[] getFluidContainerStats(ItemStack aStack) {
+ return mFluidContainerStats.get((short) aStack.getItemDamage());
+ }
+
+ @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")){
+ HEX_OxFFFFFF = 0xffff00;
+ }
+ else if (stack.getDisplayName().contains("MAX")){
+ HEX_OxFFFFFF = 0xff0000;
+ }
+ else {
+ 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
new file mode 100644
index 0000000000..5f0e677d9b
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_Base.java
@@ -0,0 +1,559 @@
+package gtPlusPlus.xmod.gregtech.api.items;
+
+import static gregtech.api.enums.GT_Values.D1;
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.api.enums.SubTag;
+import gregtech.api.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.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;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.projectile.EntityArrow;
+import net.minecraft.inventory.Container;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+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(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")){
+ HEX_OxFFFFFF = 0xffff00;
+ }
+ else if (stack.getDisplayName().contains("MAX")){
+ HEX_OxFFFFFF = 0xff0000;
+ }
+ else if (stack.getDisplayName().contains("Sodium")){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(0, 0, 150);
+ }
+ else if (stack.getDisplayName().contains("Cadmium")){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(50, 50, 60);
+ }
+ else if (stack.getDisplayName().contains("Lithium")){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(225, 220, 255);
+ }
+ else {
+ HEX_OxFFFFFF = 0xffffff;
+ }
+ return HEX_OxFFFFFF;
+ }
+} \ 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
new file mode 100644
index 0000000000..5ef60e442a
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaItem_X32.java
@@ -0,0 +1,204 @@
+package gtPlusPlus.xmod.gregtech.api.items;
+
+import gregtech.api.GregTech_API;
+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.GT_LanguageManager;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.util.Utils;
+
+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.
+ * <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.
+ * <p/>
+ * 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(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 ---------- */
+
+ /**
+ * @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 ---------- */
+
+ /**
+ * @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")){
+ HEX_OxFFFFFF = 0xffb300;
+ }
+ else if (stack.getDisplayName().contains("MAX")){
+ HEX_OxFFFFFF = 0xff6500;
+ }
+ else if (stack.getDisplayName().contains("Sodium")){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(90, 90, 255);
+ }
+ else if (stack.getDisplayName().contains("Cadmium")){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(150, 150, 80);
+ }
+ else if (stack.getDisplayName().contains("Lithium")){
+ HEX_OxFFFFFF = Utils.rgbtoHexValue(225, 220, 255);
+ }
+ else {
+ HEX_OxFFFFFF = 0xffffff;
+ }
+ return HEX_OxFFFFFF;
+ }
+} \ 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
new file mode 100644
index 0000000000..20163eecb4
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/Gregtech_MetaTool.java
@@ -0,0 +1,605 @@
+package gtPlusPlus.xmod.gregtech.api.items;
+
+import static gregtech.api.enums.GT_Values.MOD_ID_RC;
+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.IDamagableItem;
+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.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 java.util.Random;
+
+import mods.railcraft.api.core.items.IToolCrowbar;
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.enchantment.Enchantment;
+import net.minecraft.enchantment.EnchantmentHelper;
+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.EnumAction;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.potion.Potion;
+import net.minecraft.stats.AchievementList;
+import net.minecraft.stats.StatList;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IIcon;
+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;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+/**
+ * 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 = MOD_ID_RC), @Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraft")})
+public abstract class Gregtech_MetaTool extends Gregtech_MetaItem_Base 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.
+ * <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_MetaTool> sInstances = new HashMap<String, Gregtech_MetaTool>();
+
+ /* ---------- CONSTRUCTOR AND MEMBER VARIABLES ---------- */
+
+ public final HashMap<Short, Interface_ToolStats> mToolStats = new HashMap<Short, Interface_ToolStats>();
+
+ /**
+ * Creates the Item using these Parameters.
+ *
+ * @param aUnlocalized The Unlocalized Name of this Item.
+ */
+ public Gregtech_MetaTool(String aUnlocalized) {
+ super(aUnlocalized);
+ GT_ModHandler.registerBoxableItemToToolBox(this);
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ setMaxStackSize(1);
+ sInstances.put(getUnlocalizedName(), this);
+ }
+
+ /* ---------- FOR ADDING CUSTOM ITEMS INTO THE REMAINING 766 RANGE ---------- */
+
+ public static final Materials getPrimaryMaterial(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null) return Materials.getRealMaterial(aNBT.getString("PrimaryMaterial"));
+ }
+ return Materials._NULL;
+ }
+
+ public static final Materials getSecondaryMaterial(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null) return Materials.getRealMaterial(aNBT.getString("SecondaryMaterial"));
+ }
+ return Materials._NULL;
+ }
+
+ /* ---------- INTERNAL OVERRIDES ---------- */
+
+ public static final long getToolMaxDamage(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null) return aNBT.getLong("MaxDamage");
+ }
+ return 0;
+ }
+
+ public static final long getToolDamage(ItemStack aStack) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null) return aNBT.getLong("Damage");
+ }
+ return 0;
+ }
+
+ public static final boolean setToolDamage(ItemStack aStack, long aDamage) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) {
+ aNBT = aNBT.getCompoundTag("GT.ToolStats");
+ if (aNBT != null) {
+ aNBT.setLong("Damage", aDamage);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * 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.
+ */
+ public final ItemStack addTool(int aID, String aEnglish, String aToolTip, Interface_ToolStats aToolStats, Object... aOreDictNamesAndAspects) {
+ if (aToolTip == null) aToolTip = "";
+ if (aID >= 0 && aID < 32766 && aID % 2 == 0) {
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + aID + ".name", aEnglish);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + aID + ".tooltip", aToolTip);
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (aID + 1) + ".name", aEnglish + " (Empty)");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (aID + 1) + ".tooltip", "You need to recharge it");
+ mToolStats.put((short) aID, aToolStats);
+ mToolStats.put((short) (aID + 1), aToolStats);
+ aToolStats.onStatsAddedToTool(this, aID);
+ 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
+ GT_OreDictUnificator.registerOre(tOreDictNameOrAspect, rStack);
+ }
+ if (GregTech_API.sThaumcraftCompat != null)
+ GregTech_API.sThaumcraftCompat.registerThaumcraftAspectsToItem(rStack, tAspects, false);
+ return rStack;
+ }
+ return null;
+ }
+
+ /**
+ * 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 getToolWithStats(int aToolID, int aAmount, Materials aPrimaryMaterial, Materials aSecondaryMaterial, long[] aElectricArray) {
+ ItemStack rStack = new ItemStack(this, aAmount, aToolID);
+ Interface_ToolStats 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);
+ }
+ 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) {
+ Interface_ToolStats 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 onLeftClickEntity(ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) {
+ Interface_ToolStats 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;
+ }
+
+ @Override
+ public ItemStack onItemRightClick(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats != null && tStats.canBlock()) aPlayer.setItemInUse(aStack, 72000);
+ return super.onItemRightClick(aStack, aWorld, aPlayer);
+ }
+
+ @Override
+ public final int getMaxItemUseDuration(ItemStack aStack) {
+ return 72000;
+ }
+
+ @Override
+ public final EnumAction getItemUseAction(ItemStack aStack) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats != null && tStats.canBlock()) return EnumAction.block;
+ return EnumAction.none;
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
+ for (int i = 0; i < 32766; i += 2)
+ if (getToolStats(new ItemStack(this, 1, i)) != null) {
+ ItemStack tStack = new ItemStack(this, 1, i);
+ isItemStackUsable(tStack);
+ aList.add(tStack);
+ }
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public final void registerIcons(IIconRegister aIconRegister) {
+ //
+ }
+
+ @Override
+ public final IIcon getIconFromDamage(int aMetaData) {
+ return null;
+ }
+
+ @Override
+ public void addAdditionalToolTips(List aList, ItemStack aStack) {
+ long tMaxDamage = getToolMaxDamage(aStack);
+ Materials tMaterial = getPrimaryMaterial(aStack);
+ Interface_ToolStats 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);
+ }
+ }
+ }
+
+ @Override
+ public Long[] getFluidContainerStats(ItemStack aStack) {
+ return null;
+ }
+
+ @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")};
+ }
+ return null;
+ }
+
+ public float getToolCombatDamage(ItemStack aStack) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats == null) return 0;
+ return tStats.getBaseDamage() + getPrimaryMaterial(aStack).mToolQuality;
+ }
+
+ @Override
+ public final boolean doDamageToItem(ItemStack aStack, int aVanillaDamage) {
+ return doDamage(aStack, aVanillaDamage * 100);
+ }
+
+ public final boolean doDamage(ItemStack aStack, long aAmount) {
+ if (!isItemStackUsable(aStack)) return false;
+ Long[] tElectric = getElectricStats(aStack);
+ if (tElectric == null) {
+ long tNewDamage = getToolDamage(aStack) + aAmount;
+ setToolDamage(aStack, tNewDamage);
+ if (tNewDamage >= getToolMaxDamage(aStack)) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats == null || GT_Utility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) {
+ if (tStats != null) /*GT_Utility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F);*/
+ if (aStack.stackSize > 0) aStack.stackSize--;
+
+ }
+ }
+ return true;
+ }
+ if (use(aStack, (int) aAmount, null)) {
+ if (new Random().nextInt(25) == 0) {
+ long tNewDamage = getToolDamage(aStack) + aAmount;
+ setToolDamage(aStack, tNewDamage);
+ if (tNewDamage >= getToolMaxDamage(aStack)) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats == null || GT_Utility.setStack(aStack, tStats.getBrokenItem(aStack)) == null) {
+ if (tStats != null) /*GT_Utility.doSoundAtClient(tStats.getBreakingSound(), 1, 1.0F);*/
+ if (aStack.stackSize > 0) aStack.stackSize--;
+ }
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public float getDigSpeed(ItemStack aStack, Block aBlock, int aMetaData) {
+ if (!isItemStackUsable(aStack)) return 0.0F;
+ Interface_ToolStats 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 final boolean canHarvestBlock(Block aBlock, ItemStack aStack) {
+ return getDigSpeed(aStack, aBlock, (byte) 0) > 0.0F;
+ }
+
+ @Override
+ public final int getHarvestLevel(ItemStack aStack, String aToolClass) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ return tStats == null ? -1 : tStats.getBaseQuality() + getPrimaryMaterial(aStack).mToolQuality;
+ }
+
+ @Override
+ public boolean onBlockDestroyed(ItemStack aStack, World aWorld, Block aBlock, int aX, int aY, int aZ, EntityLivingBase aPlayer) {
+ if (!isItemStackUsable(aStack)) return false;
+ Interface_ToolStats 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;
+ }
+
+ @Override
+ public final ItemStack getContainerItem(ItemStack aStack) {
+ return getContainerItem(aStack, true);
+ }
+
+ @Override
+ public final boolean hasContainerItem(ItemStack aStack) {
+ return getContainerItem(aStack, false) != null;
+ }
+
+ private ItemStack getContainerItem(ItemStack aStack, boolean playSound) {
+ if (!isItemStackUsable(aStack)) return null;
+ aStack = GT_Utility.copyAmount(1, aStack);
+ Interface_ToolStats 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);
+ }
+ return aStack;
+ }
+
+ public Interface_ToolStats getToolStats(ItemStack aStack) {
+ isItemStackUsable(aStack);
+ return getToolStatsInternal(aStack);
+ }
+
+ private Interface_ToolStats getToolStatsInternal(ItemStack aStack) {
+ return aStack == null ? null : mToolStats.get((short) aStack.getItemDamage());
+ }
+
+ @Override
+ public boolean canWhack(EntityPlayer aPlayer, ItemStack aStack, int aX, int aY, int aZ) {
+ if (!isItemStackUsable(aStack)) return false;
+ Interface_ToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onWhack(EntityPlayer aPlayer, ItemStack aStack, int aX, int aY, int aZ) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+
+ @Override
+ 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 void wrenchUsed(EntityPlayer player, int x, int y, int z) {
+ if(player==null)return;
+ if(player.getCurrentEquippedItem()==null)return;
+ Interface_ToolStats tStats = getToolStats(player.getCurrentEquippedItem());
+ if (tStats != null) doDamage(player.getCurrentEquippedItem(), tStats.getToolDamagePerEntityAttack());
+ }
+
+ @Override
+ public boolean canLink(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ if (!isItemStackUsable(aStack)) return false;
+ Interface_ToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onLink(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+
+ @Override
+ public boolean canBoost(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ if (!isItemStackUsable(aStack)) return false;
+ Interface_ToolStats tStats = getToolStats(aStack);
+ return tStats != null && tStats.isCrowbar();
+ }
+
+ @Override
+ public void onBoost(EntityPlayer aPlayer, ItemStack aStack, EntityMinecart cart) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats != null) doDamage(aStack, tStats.getToolDamagePerEntityAttack());
+ }
+
+ @Override
+ public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ Interface_ToolStats tStats = getToolStats(aStack);
+ if (tStats != null && aPlayer != null) tStats.onToolCrafted(aStack, aPlayer);
+ super.onCreated(aStack, aWorld, aPlayer);
+ }
+
+ @Override
+ public final boolean doesContainerItemLeaveCraftingGrid(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public final int getItemStackLimit(ItemStack aStack) {
+ return 1;
+ }
+
+ @Override
+ public boolean isFull3D() {
+ return true;
+ }
+
+ @Override
+ public boolean isItemStackUsable(ItemStack aStack) {
+ Interface_ToolStats tStats = getToolStatsInternal(aStack);
+ if (aStack.getItemDamage() % 2 == 1 || tStats == null) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (aNBT != null) aNBT.removeTag("ench");
+ return false;
+ }
+ 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)
+ tMap.put(Enchantment.looting.effectId, (int) aMaterial.mEnchantmentToolsLevel);
+ if (aMaterial.mEnchantmentTools == Enchantment.knockback)
+ tMap.put(Enchantment.power.effectId, (int) aMaterial.mEnchantmentToolsLevel);
+ if (aMaterial.mEnchantmentTools == Enchantment.fireAspect)
+ tMap.put(Enchantment.flame.effectId, (int) aMaterial.mEnchantmentToolsLevel);
+ }
+ Enchantment[] tEnchants = tStats.getEnchantments(aStack);
+ int[] tLevels = tStats.getEnchantmentLevels(aStack);
+ for (int i = 0; i < tEnchants.length; i++)
+ if (tLevels[i] > 0) {
+ Integer tLevel = tMap.get(tEnchants[i].effectId);
+ tMap.put(tEnchants[i].effectId, tLevel == null ? tLevels[i] : tLevel == tLevels[i] ? tLevel + 1 : Math.max(tLevel, tLevels[i]));
+ }
+ 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
+ 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;
+ }
+ }
+ EnchantmentHelper.setEnchantments(tResult, aStack);
+ return true;
+ }
+
+ @Override
+ public short getChargedMetaData(ItemStack aStack) {
+ return (short) (aStack.getItemDamage() - (aStack.getItemDamage() % 2));
+ }
+
+ @Override
+ 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 int getItemEnchantability() {
+ return 0;
+ }
+
+ @Override
+ public boolean isBookEnchantable(ItemStack aStack, ItemStack aBook) {
+ return false;
+ }
+
+ @Override
+ 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
new file mode 100644
index 0000000000..ed663188d9
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Base.java
@@ -0,0 +1,84 @@
+package gtPlusPlus.xmod.gregtech.api.items.types;
+
+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.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;
+import net.minecraft.entity.projectile.EntityArrow;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumFacing;
+import net.minecraft.world.World;
+
+public class ToolType_Base implements Interface_ItemBehaviour<Gregtech_MetaItem_Base> {
+ @Override
+ public boolean onLeftClickEntity(Gregtech_MetaItem_Base aItem, ItemStack aStack, EntityPlayer aPlayer, Entity aEntity) {
+ return false;
+ }
+
+ @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 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 ItemStack onItemRightClick(Gregtech_MetaItem_Base aItem, ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
+ return aStack;
+ }
+
+ @Override
+ public List<String> getAdditionalToolTips(Gregtech_MetaItem_Base aItem, List<String> aList, ItemStack aStack) {
+ return aList;
+ }
+
+ @Override
+ public void onUpdate(Gregtech_MetaItem_Base aItem, ItemStack aStack, World aWorld, Entity aPlayer, int aTimer, boolean aIsInHand) {
+ }
+
+ @Override
+ public boolean isItemStackUsable(Gregtech_MetaItem_Base aItem, ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean canDispense(Gregtech_MetaItem_Base aItem, IBlockSource aSource, ItemStack aStack) {
+ 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 hasProjectile(Gregtech_MetaItem_Base aItem, SubTag aProjectileType, ItemStack aStack) {
+ 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 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
new file mode 100644
index 0000000000..c59b4fe37f
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_HardHammer.java
@@ -0,0 +1,127 @@
+package gtPlusPlus.xmod.gregtech.api.items.types;
+
+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.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;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+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 ToolType_HardHammer(int aVanillaCosts, 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);
+
+
+ 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;
+
+ 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;
+
+ 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;
+ }
+
+ 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
new file mode 100644
index 0000000000..9eb44d91d6
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/items/types/ToolType_Wrench.java
@@ -0,0 +1,149 @@
+package gtPlusPlus.xmod.gregtech.api.items.types;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.items.GT_MetaBase_Item;
+import gregtech.api.items.GT_MetaGenerated_Tool;
+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;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+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 ToolType_Wrench(int aCosts) {
+ this.mCosts = aCosts;
+ }
+
+ 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 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/GregtechMetaCondensor.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaCondensor.java
new file mode 100644
index 0000000000..dcecc3ff34
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaCondensor.java
@@ -0,0 +1,165 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
+
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_SteamCondenser;
+import gtPlusPlus.xmod.gregtech.api.gui.GUI_SteamCondenser;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechMetaBoilerBase;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidHandler;
+
+public class GregtechMetaCondensor extends GregtechMetaBoilerBase{
+
+ 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
new file mode 100644
index 0000000000..45f05f4495
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaEnergyBuffer.java
@@ -0,0 +1,338 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
+
+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;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.items.GT_MetaBase_Item;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity;
+import ic2.api.item.IElectricItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.world.World;
+
+public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity {
+
+ /*
+ * public GregtechMetaEnergyBuffer() { super.this
+ * setCreativeTab(GregTech_API.TAB_GREGTECH); }
+ */
+
+ public boolean mCharge = false, mDecharge = false;
+ public int mBatteryCount = 1, mChargeableCount = 1;
+
+ public GregtechMetaEnergyBuffer(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) {
+ super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription);
+ }
+
+ public GregtechMetaEnergyBuffer(String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) {
+ super(aName, aTier, aSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {mDescription, CORE.GT_Tooltip};
+ }
+
+ /*
+ * MACHINE_STEEL_SIDE
+ */
+ @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) {
+ * ITexture[][][] rTextures = new ITexture[5][17][]; for (byte i = -1; i <
+ * 16; i = (byte) (i + 1)) { ITexture[] tmp0 = { new GT_RenderedTexture(
+ * Textures.BlockIcons.MACHINE_STEEL_BOTTOM, Dyes.getModulation(i,
+ * Dyes._NULL.mRGBa)) }; rTextures[0][(i + 1)] = tmp0; ITexture[] tmp1 = {
+ * new GT_RenderedTexture( Textures.BlockIcons.MACHINE_STEEL_TOP) };
+ * rTextures[1][(i + 1)] = tmp1; ITexture[] tmp2 = { new GT_RenderedTexture(
+ * Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i,
+ * Dyes._NULL.mRGBa)), new
+ * GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE) }; rTextures[2][(i +
+ * 1)] = tmp2; ITexture[] tmp4 = { new GT_RenderedTexture(
+ * Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i,
+ * Dyes._NULL.mRGBa)), new
+ * GT_RenderedTexture(Textures.BlockIcons.BOILER_FRONT) }; rTextures[3][(i +
+ * 1)] = tmp4; ITexture[] tmp5 = { new GT_RenderedTexture(
+ * Textures.BlockIcons.MACHINE_STEEL_SIDE, Dyes.getModulation(i,
+ * Dyes._NULL.mRGBa)), new GT_RenderedTexture(
+ * Textures.BlockIcons.BOILER_FRONT_ACTIVE) }; rTextures[4][(i + 1)] = tmp5;
+ * } 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];
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaEnergyBuffer(mName, mTier, mDescription, mTextures, mInventory.length);
+ }
+
+ @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 long maxEUInput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return mChargeableCount * 4;
+ }
+
+ @Override
+ 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 void saveNBTData(NBTTagCompound aNBT) {
+ //
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ //
+ }
+
+ @Override
+ 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;
+ }
+
+ 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;
+ Utils.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(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_1by1(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_1by1(aPlayerInventory, aBaseMetaTileEntity, getLocalName());
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+
+ }
+
+ @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;
+ }
+
+ 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) {
+ 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 };
+ }
+
+ private long count=0;
+ private long mStored=0;
+ private long mMax=0;
+
+ @Override
+ public String[] getInfoData() {
+ count++;
+ if(mMax==0||count%20==0){
+ long[] tmp = getStoredEnergy();
+ mStored=tmp[0];
+ mMax=tmp[1];
+ }
+
+ return new String[] {
+ getLocalName(),
+ GT_Utility.formatNumbers(mStored)+" EU /",
+ GT_Utility.formatNumbers(mMax)+" EU"};
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
+ return null;
+ }
+
+ @Override
+ public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) {
+ return false;
+ }
+
+ @Override
+ public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
+ return false;
+ }
+
+ @Override
+ public int getSizeInventory() {
+ return 0;
+ }
+
+ @Override
+ public ItemStack getStackInSlot(int p_70301_1_) {
+ return null;
+ }
+
+ @Override
+ public ItemStack decrStackSize(int p_70298_1_, int p_70298_2_) {
+ return null;
+ }
+
+ @Override
+ public ItemStack getStackInSlotOnClosing(int p_70304_1_) {
+ return null;
+ }
+
+ @Override
+ public void setInventorySlotContents(int p_70299_1_, ItemStack p_70299_2_) {
+ }
+
+ @Override
+ public String getInventoryName() {
+ return null;
+ }
+
+ @Override
+ public boolean hasCustomInventoryName() {
+ return false;
+ }
+
+ @Override
+ public int getInventoryStackLimit() {
+ return 0;
+ }
+
+ @Override
+ public void markDirty() {
+ }
+
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer p_70300_1_) {
+ return false;
+ }
+
+ @Override
+ public void openInventory() {
+ }
+
+ @Override
+ public void closeInventory() {
+ }
+
+ @Override
+ public boolean isItemValidForSlot(int p_94041_1_, ItemStack p_94041_2_) {
+ return false;
+ }
+
+} \ 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
new file mode 100644
index 0000000000..9fe37dd2dc
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java
@@ -0,0 +1,385 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
+
+import static gregtech.api.enums.GT_Values.D1;
+import gregtech.api.GregTech_API;
+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;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.BaseMetaPipeEntity;
+import gregtech.api.metatileentity.MetaPipeEntity;
+import gregtech.api.objects.GT_RenderedTexture;
+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;
+import net.minecraft.nbt.NBTTagCompound;
+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.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(int aID, String aName, String aNameRegional, float aThickNess, GT_Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) {
+ super(aID, aName, aNameRegional, 0);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mCapacity = aCapacity;
+ mGasProof = aGasProof;
+ mHeatResistance = aHeatResistance;
+ }
+
+ public GregtechMetaPipeEntityFluid(String aName, float aThickNess, GT_Materials aMaterial, int aCapacity, int aHeatResistance, boolean aGasProof) {
+ super(aName, 0);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mCapacity = aCapacity;
+ mGasProof = aGasProof;
+ mHeatResistance = aHeatResistance;
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return mMaterial == null ? 4 : (byte) ((mMaterial.contains(SubTag.WOOD) ? 12 : 4) + Math.max(0, Math.min(3, mMaterial.mToolQuality)));
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaPipeEntityFluid(mName, mThickNess, mMaterial, mCapacity, mHeatResistance, mGasProof);
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
+
+ short[] colours = Dyes.getModulation(aColorIndex, mMaterial.mRGBa);
+ if (aConnected) {
+ float tThickNess = getThickNess();
+ if (tThickNess < 0.37F){
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeTiny.mTextureIndex], colours)};
+ }
+ if (tThickNess < 0.49F){
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeSmall.mTextureIndex], colours)};
+ }
+ if (tThickNess < 0.74F){
+ return new ITexture[]{new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipeMedium.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(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], colours)};
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return false;
+ }
+
+ @Override
+ public final boolean renderInside(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return getFluidAmount();
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return getCapacity();
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ if (mFluid != null) aNBT.setTag("mFluid", mFluid.writeToNBT(new NBTTagCompound()));
+ aNBT.setByte("mLastReceivedFrom", mLastReceivedFrom);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ mFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluid"));
+ mLastReceivedFrom = aNBT.getByte("mLastReceivedFrom");
+ }
+
+ @Override
+ 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) {
+ GT_Utility.applyFrostDamage((EntityLivingBase) aEntity, (270 - tTemperature) / 25.0F);
+ }
+ }
+ }
+
+ @Override
+ 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) {
+ mLastReceivedFrom &= 63;
+ if (mLastReceivedFrom == 63) {
+ mLastReceivedFrom = 0;
+ }
+
+ 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 (!mGasProof && mFluid.getFluid().isGaseous(mFluid)) {
+ mFluid.amount -= 5;
+ sendSound((byte) 9);
+ if (tTemperature > 320) {
+ try {
+ 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);
+ }
+ } else if (tTemperature < 260) {
+ try {
+ 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);
+ }
+ }
+ if (mFluid.amount <= 0) mFluid = null;
+ }
+ }
+
+ if (mLastReceivedFrom == oLastReceivedFrom) {
+ HashMap<IFluidHandler, ForgeDirection> tTanks = new HashMap<IFluidHandler, ForgeDirection>();
+
+ mConnections = 0;
+
+ for (byte tSide = 0, i = 0, j = (byte) aBaseMetaTileEntity.getRandomNumber(6); i < 6; i++) {
+ tSide = (byte) ((j + i) % 6);
+
+ IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(tSide);
+ if (tTileEntity != null) {
+ if (tTileEntity instanceof IGregTechTileEntity) {
+ if (aBaseMetaTileEntity.getColorization() >= 0) {
+ byte tColor = ((IGregTechTileEntity) tTileEntity).getColorization();
+ if (tColor >= 0 && (tColor & 15) != (aBaseMetaTileEntity.getColorization() & 15)) {
+ continue;
+ }
+ }
+ }
+ 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))) {
+ 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)) {
+ 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)) {
+ mConnections |= (1 << tSide);
+ }
+ }
+ }
+ }
+
+ if (mFluid != null && mFluid.amount > 0) {
+ int tAmount = Math.max(1, Math.min(mCapacity * 10, mFluid.amount / 2)), tSuccessfulTankAmount = 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 (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 (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);
+ }
+ }
+ }
+ }
+
+ mLastReceivedFrom = 0;
+ }
+
+ 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 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 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;
+ }
+
+ 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
new file mode 100644
index 0000000000..587996a5c6
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java
@@ -0,0 +1,236 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
+
+import static gregtech.api.enums.GT_Values.VN;
+import gregtech.api.GregTech_API;
+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.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;
+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 final float mThickNess;
+ public final Materials mMaterial;
+ public final long mCableLossPerMeter, mAmperage, mVoltage;
+ public final boolean mInsulated, mCanShock;
+ public long mRestRF;
+
+ 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);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = aCableLossPerMeter;
+ }
+
+ 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);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = aCableLossPerMeter;
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return (byte)(mInsulated?9:8);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaPipeEntity_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) {
+ 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 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 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 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 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(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ mTransferredAmperage = 0;
+
+ if (aTick % 20 == 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)) {
+ TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
+ if (tTileEntity instanceof IColoredTileEntity) {
+ if (aBaseMetaTileEntity.getColorization() >= 0) {
+ byte tColor = ((IColoredTileEntity)tTileEntity).getColorization();
+ if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) continue;
+ }
+ }
+ 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))) {
+ mConnections |= (1<<i);
+ continue;
+ }
+ }
+ 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;
+ }*/
+ }
+ }
+ }
+ }
+ }
+
+
+ @Override
+ 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
new file mode 100644
index 0000000000..7f903576c2
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_SuperConductor.java
@@ -0,0 +1,239 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
+
+import static gregtech.api.enums.GT_Values.VN;
+import gregtech.api.GregTech_API;
+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.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;
+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;
+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 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(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);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = 0;
+ }
+
+ 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);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = 0;
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return (byte)(mInsulated?9:8);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaPipeEntity_SuperConductor(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) {
+ 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 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 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 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 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(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ mTransferredAmperage = 0;
+
+ if (aTick % 20 == 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)) {
+ TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
+ if (tTileEntity instanceof IColoredTileEntity) {
+ if (aBaseMetaTileEntity.getColorization() >= 0) {
+ byte tColor = ((IColoredTileEntity)tTileEntity).getColorization();
+ if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) continue;
+ }
+ }
+ 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))) {
+ mConnections |= (1<<i);
+ continue;
+ }
+ }
+ 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;
+ }*/
+ }
+ }
+ }
+ }
+ }
+
+
+ @Override
+ 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
new file mode 100644
index 0000000000..c574087020
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSafeBlock.java
@@ -0,0 +1,76 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
+
+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.GT_Utility;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_SafeBlock;
+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 {
+
+ @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.");
+ }
+
+ public GregtechMetaSafeBlock(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) {
+ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
+ }
+
+ public GregtechMetaSafeBlock(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaSafeBlock(this.mName, this.mTier, this.mInventory.length, this.mDescription, this.mTextures);
+ }
+
+ @Override
+ public ITexture getOverlayIcon() {
+ return new GT_RenderedTexture(Textures.BlockIcons.VOID);
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < this.mInventory.length - 1;
+ }
+
+ /*@Override
+ protected void moveItems(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ fillStacksIntoFirstSlots();
+ super.moveItems(aBaseMetaTileEntity, aTimer);
+ fillStacksIntoFirstSlots();
+ }*/
+
+ 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 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
new file mode 100644
index 0000000000..15cbf92516
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaSuperConductorNodeBase.java
@@ -0,0 +1,297 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
+
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+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 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(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/GT_MTE_BasicMachine_Custom_Recipe.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_BasicMachine_Custom_Recipe.java
new file mode 100644
index 0000000000..c7f84f1095
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_BasicMachine_Custom_Recipe.java
@@ -0,0 +1,623 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base;
+
+import static gregtech.api.enums.GT_Values.V;
+import static gregtech.api.enums.GT_Values.W;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.Textures;
+import gregtech.api.enums.Tier;
+import gregtech.api.gui.GT_Container_BasicMachine;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+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.GT_ModHandler;
+import gregtech.api.util.GT_ModHandler.RecipeBits;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.xmod.gregtech.api.util.GregtechRecipe_OLD.Gregtech_Recipe_Map;
+
+import java.util.Random;
+
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * This is the main construct for my Basic Machines such as the Automatic Extractor
+ * Extend this class to make a simple Machine
+ */
+public class GT_MTE_BasicMachine_Custom_Recipe extends GT_MTE_CustomRecipe_BasicMachine {
+ private final Gregtech_Recipe_Map mRecipes;
+ private final int mTankCapacity, mSpecialEffect;
+ private final String mSound;
+ private final boolean mSharedTank, mRequiresFluidForFiltering;
+ private final byte mGUIParameterA, mGUIParameterB;
+ public GT_MTE_BasicMachine_Custom_Recipe(int aID, String aName, String aNameRegional, int aTier, String aDescription, Gregtech_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) {
+ super(aID, aName, aNameRegional, aTier, aRecipes.mAmperage, aDescription, aInputSlots, aOutputSlots, aGUIName, aRecipes.mNEIName, new ITexture[]{new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_SIDE_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_SIDE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_FRONT_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_FRONT")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_TOP_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_TOP")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_BOTTOM_ACTIVE")), new GT_RenderedTexture(new Textures.BlockIcons.CustomIcon("basicmachines/" + aOverlays.toLowerCase() + "/OVERLAY_BOTTOM"))});
+ mSharedTank = aSharedTank;
+ mTankCapacity = aTankCapacity;
+ mSpecialEffect = aSpecialEffect;
+ mRequiresFluidForFiltering = aRequiresFluidForFiltering;
+ mRecipes = aRecipes;
+ mSound = aSound;
+ mGUIParameterA = (byte) aGUIParameterA;
+ mGUIParameterB = (byte) aGUIParameterB;
+
+ if (aRecipe != null) {
+ for (int i = 3; i < aRecipe.length; i++) {
+ if (aRecipe[i] == X.CIRCUIT) {
+ aRecipe[i] = Tier.ELECTRIC[mTier].mManagingObject;
+ continue;
+ }
+ if (aRecipe[i] == X.BETTER_CIRCUIT) {
+ aRecipe[i] = Tier.ELECTRIC[mTier].mBetterManagingObject;
+ continue;
+ }
+ if (aRecipe[i] == X.HULL) {
+ aRecipe[i] = Tier.ELECTRIC[mTier].mHullObject;
+ continue;
+ }
+ if (aRecipe[i] == X.WIRE) {
+ aRecipe[i] = Tier.ELECTRIC[mTier].mConductingObject;
+ continue;
+ }
+ if (aRecipe[i] == X.WIRE4) {
+ aRecipe[i] = Tier.ELECTRIC[mTier].mLargerConductingObject;
+ continue;
+ }
+
+ if (aRecipe[i] == X.GLASS) {
+ switch (mTier) {
+ default:
+ aRecipe[i] = new ItemStack(Blocks.glass, 1, W);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.PLATE) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = OrePrefixes.plate.get(Materials.Steel);
+ break;
+ case 2:
+ aRecipe[i] = OrePrefixes.plate.get(Materials.Aluminium);
+ break;
+ case 3:
+ aRecipe[i] = OrePrefixes.plate.get(Materials.StainlessSteel);
+ break;
+ case 4:
+ aRecipe[i] = OrePrefixes.plate.get(Materials.Titanium);
+ break;
+ default:
+ aRecipe[i] = OrePrefixes.plate.get(Materials.TungstenSteel);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.PIPE) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.Bronze);
+ break;
+ case 2:
+ aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.Steel);
+ break;
+ case 3:
+ aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.StainlessSteel);
+ break;
+ case 4:
+ aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.Titanium);
+ break;
+ default:
+ aRecipe[i] = OrePrefixes.pipeMedium.get(Materials.TungstenSteel);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.COIL_HEATING) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = OrePrefixes.wireGt02.get(Materials.AnyCopper);
+ break;
+ case 2:
+ aRecipe[i] = OrePrefixes.wireGt02.get(Materials.Cupronickel);
+ break;
+ case 3:
+ aRecipe[i] = OrePrefixes.wireGt02.get(Materials.Kanthal);
+ break;
+ case 4:
+ aRecipe[i] = OrePrefixes.wireGt02.get(Materials.Nichrome);
+ break;
+ default:
+ aRecipe[i] = OrePrefixes.wireGt08.get(Materials.Nichrome);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.COIL_HEATING_DOUBLE) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = OrePrefixes.wireGt04.get(Materials.AnyCopper);
+ break;
+ case 2:
+ aRecipe[i] = OrePrefixes.wireGt04.get(Materials.Cupronickel);
+ break;
+ case 3:
+ aRecipe[i] = OrePrefixes.wireGt04.get(Materials.Kanthal);
+ break;
+ case 4:
+ aRecipe[i] = OrePrefixes.wireGt04.get(Materials.Nichrome);
+ break;
+ default:
+ aRecipe[i] = OrePrefixes.wireGt16.get(Materials.Nichrome);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.STICK_DISTILLATION) {
+ switch (mTier) {
+ default:
+ aRecipe[i] = OrePrefixes.stick.get(Materials.Blaze);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.STICK_MAGNETIC) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = OrePrefixes.stick.get(Materials.IronMagnetic);
+ break;
+ case 2:
+ case 3:
+ aRecipe[i] = OrePrefixes.stick.get(Materials.SteelMagnetic);
+ break;
+ default:
+ aRecipe[i] = OrePrefixes.stick.get(Materials.NeodymiumMagnetic);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.STICK_ELECTROMAGNETIC) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = OrePrefixes.stick.get(Materials.AnyIron);
+ break;
+ case 2:
+ case 3:
+ aRecipe[i] = OrePrefixes.stick.get(Materials.Steel);
+ break;
+ case 4:
+ aRecipe[i] = OrePrefixes.stick.get(Materials.Neodymium);
+ break;
+ default:
+ aRecipe[i] = OrePrefixes.stick.get(Materials.VanadiumGallium);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.COIL_ELECTRIC) {
+ switch (mTier) {
+ case 0:
+ aRecipe[i] = OrePrefixes.wireGt01.get(Materials.Tin);
+ break;
+ case 1:
+ aRecipe[i] = OrePrefixes.wireGt02.get(Materials.Tin);
+ break;
+ case 2:
+ aRecipe[i] = OrePrefixes.wireGt02.get(Materials.AnyCopper);
+ break;
+ case 3:
+ aRecipe[i] = OrePrefixes.wireGt04.get(Materials.AnyCopper);
+ break;
+ case 4:
+ aRecipe[i] = OrePrefixes.wireGt08.get(Materials.AnnealedCopper);
+ break;
+ default:
+ aRecipe[i] = OrePrefixes.wireGt16.get(Materials.AnnealedCopper);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.ROBOT_ARM) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = ItemList.Robot_Arm_LV;
+ break;
+ case 2:
+ aRecipe[i] = ItemList.Robot_Arm_MV;
+ break;
+ case 3:
+ aRecipe[i] = ItemList.Robot_Arm_HV;
+ break;
+ case 4:
+ aRecipe[i] = ItemList.Robot_Arm_EV;
+ break;
+ case 5:
+ aRecipe[i] = ItemList.Robot_Arm_IV;
+ break;
+ case 6:
+ aRecipe[i] = ItemList.Robot_Arm_LuV;
+ break;
+ case 7:
+ aRecipe[i] = ItemList.Robot_Arm_ZPM;
+ break;
+ default:
+ aRecipe[i] = ItemList.Robot_Arm_UV;
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.PUMP) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = ItemList.Electric_Pump_LV;
+ break;
+ case 2:
+ aRecipe[i] = ItemList.Electric_Pump_MV;
+ break;
+ case 3:
+ aRecipe[i] = ItemList.Electric_Pump_HV;
+ break;
+ case 4:
+ aRecipe[i] = ItemList.Electric_Pump_EV;
+ break;
+ case 5:
+ aRecipe[i] = ItemList.Electric_Pump_IV;
+ break;
+ case 6:
+ aRecipe[i] = ItemList.Electric_Pump_LuV;
+ break;
+ case 7:
+ aRecipe[i] = ItemList.Electric_Pump_ZPM;
+ break;
+ default:
+ aRecipe[i] = ItemList.Electric_Pump_UV;
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.ROTOR) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = OrePrefixes.rotor.get(Materials.Tin);
+ break;
+ case 2:
+ aRecipe[i] = OrePrefixes.rotor.get(Materials.Bronze);
+ break;
+ case 3:
+ aRecipe[i] = OrePrefixes.rotor.get(Materials.Steel);
+ break;
+ case 4:
+ aRecipe[i] = OrePrefixes.rotor.get(Materials.StainlessSteel);
+ break;
+ case 5:
+ aRecipe[i] = OrePrefixes.rotor.get(Materials.TungstenSteel);
+ break;
+ case 6:
+ aRecipe[i] = OrePrefixes.rotor.get(Materials.TungstenSteel);
+ break;
+ case 7:
+ aRecipe[i] = OrePrefixes.rotor.get(Materials.TungstenSteel);
+ break;
+ default:
+ aRecipe[i] = OrePrefixes.rotor.get(Materials.TungstenSteel);
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.MOTOR) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = ItemList.Electric_Motor_LV;
+ break;
+ case 2:
+ aRecipe[i] = ItemList.Electric_Motor_MV;
+ break;
+ case 3:
+ aRecipe[i] = ItemList.Electric_Motor_HV;
+ break;
+ case 4:
+ aRecipe[i] = ItemList.Electric_Motor_EV;
+ break;
+ case 5:
+ aRecipe[i] = ItemList.Electric_Motor_IV;
+ break;
+ case 6:
+ aRecipe[i] = ItemList.Electric_Motor_LuV;
+ break;
+ case 7:
+ aRecipe[i] = ItemList.Electric_Motor_ZPM;
+ break;
+ default:
+ aRecipe[i] = ItemList.Electric_Motor_UV;
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.PISTON) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = ItemList.Electric_Piston_LV;
+ break;
+ case 2:
+ aRecipe[i] = ItemList.Electric_Piston_MV;
+ break;
+ case 3:
+ aRecipe[i] = ItemList.Electric_Piston_HV;
+ break;
+ case 4:
+ aRecipe[i] = ItemList.Electric_Piston_EV;
+ break;
+ case 5:
+ aRecipe[i] = ItemList.Electric_Piston_IV;
+ break;
+ case 6:
+ aRecipe[i] = ItemList.Electric_Piston_LuV;
+ break;
+ case 7:
+ aRecipe[i] = ItemList.Electric_Piston_ZPM;
+ break;
+ default:
+ aRecipe[i] = ItemList.Electric_Piston_UV;
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.CONVEYOR) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = ItemList.Conveyor_Module_LV;
+ break;
+ case 2:
+ aRecipe[i] = ItemList.Conveyor_Module_MV;
+ break;
+ case 3:
+ aRecipe[i] = ItemList.Conveyor_Module_HV;
+ break;
+ case 4:
+ aRecipe[i] = ItemList.Conveyor_Module_EV;
+ break;
+ case 5:
+ aRecipe[i] = ItemList.Conveyor_Module_IV;
+ break;
+ case 6:
+ aRecipe[i] = ItemList.Conveyor_Module_LuV;
+ break;
+ case 7:
+ aRecipe[i] = ItemList.Conveyor_Module_ZPM;
+ break;
+ default:
+ aRecipe[i] = ItemList.Conveyor_Module_UV;
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.EMITTER) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = ItemList.Emitter_LV;
+ break;
+ case 2:
+ aRecipe[i] = ItemList.Emitter_MV;
+ break;
+ case 3:
+ aRecipe[i] = ItemList.Emitter_HV;
+ break;
+ case 4:
+ aRecipe[i] = ItemList.Emitter_EV;
+ break;
+ case 5:
+ aRecipe[i] = ItemList.Emitter_IV;
+ break;
+ case 6:
+ aRecipe[i] = ItemList.Emitter_LuV;
+ break;
+ case 7:
+ aRecipe[i] = ItemList.Emitter_ZPM;
+ break;
+ default:
+ aRecipe[i] = ItemList.Emitter_UV;
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.SENSOR) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = ItemList.Sensor_LV;
+ break;
+ case 2:
+ aRecipe[i] = ItemList.Sensor_MV;
+ break;
+ case 3:
+ aRecipe[i] = ItemList.Sensor_HV;
+ break;
+ case 4:
+ aRecipe[i] = ItemList.Sensor_EV;
+ break;
+ case 5:
+ aRecipe[i] = ItemList.Sensor_IV;
+ break;
+ case 6:
+ aRecipe[i] = ItemList.Sensor_LuV;
+ break;
+ case 7:
+ aRecipe[i] = ItemList.Sensor_ZPM;
+ break;
+ default:
+ aRecipe[i] = ItemList.Sensor_UV;
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] == X.FIELD_GENERATOR) {
+ switch (mTier) {
+ case 0:
+ case 1:
+ aRecipe[i] = ItemList.Field_Generator_LV;
+ break;
+ case 2:
+ aRecipe[i] = ItemList.Field_Generator_MV;
+ break;
+ case 3:
+ aRecipe[i] = ItemList.Field_Generator_HV;
+ break;
+ case 4:
+ aRecipe[i] = ItemList.Field_Generator_EV;
+ break;
+ case 5:
+ aRecipe[i] = ItemList.Field_Generator_IV;
+ break;
+ case 6:
+ aRecipe[i] = ItemList.Field_Generator_LuV;
+ break;
+ case 7:
+ aRecipe[i] = ItemList.Field_Generator_ZPM;
+ break;
+ default:
+ aRecipe[i] = ItemList.Field_Generator_UV;
+ break;
+ }
+ continue;
+ }
+
+ if (aRecipe[i] instanceof X)
+ throw new IllegalArgumentException("MISSING TIER MAPPING FOR: " + aRecipe[i] + " AT TIER " + mTier);
+ }
+
+ if (!GT_ModHandler.addCraftingRecipe(getStackForm(1), RecipeBits.DISMANTLEABLE | RecipeBits.BUFFERED | RecipeBits.NOT_REMOVABLE | RecipeBits.REVERSIBLE, aRecipe)) {
+ throw new IllegalArgumentException("INVALID CRAFTING RECIPE FOR: " + getStackForm(1).getDisplayName());
+ }
+ }
+ }
+
+ public GT_MTE_BasicMachine_Custom_Recipe(String aName, int aTier, String aDescription, Gregtech_Recipe_Map aRecipes, int aInputSlots, int aOutputSlots, int aTankCapacity, int aAmperage, int aGUIParameterA, int aGUIParameterB, ITexture[][][] aTextures, String aGUIName, String aNEIName, String aSound, boolean aSharedTank, boolean aRequiresFluidForFiltering, int aSpecialEffect) {
+ super(aName, aTier, aAmperage, aDescription, aTextures, aInputSlots, aOutputSlots, aGUIName, aNEIName);
+ mSharedTank = aSharedTank;
+ mTankCapacity = aTankCapacity;
+ mSpecialEffect = aSpecialEffect;
+ mRequiresFluidForFiltering = aRequiresFluidForFiltering;
+ mRecipes = aRecipes;
+ mSound = aSound;
+ mGUIParameterA = (byte) aGUIParameterA;
+ mGUIParameterB = (byte) aGUIParameterB;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MTE_BasicMachine_Custom_Recipe(mName, mTier, mDescription, mRecipes, mInputSlotCount, mOutputItems == null ? 0 : mOutputItems.length, mTankCapacity, mAmperage, mGUIParameterA, mGUIParameterB, mTextures, mGUIName, mNEIName, mSound, mSharedTank, mRequiresFluidForFiltering, mSpecialEffect);
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_BasicMachine(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), mGUIName, GT_Utility.isStringValid(mNEIName) ? mNEIName : getRecipeList() != null ? getRecipeList().mUnlocalizedName : "", mGUIParameterA, mGUIParameterB);
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (!super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) return false;
+ if (mInventory[aIndex] != null) return true;
+ switch (mInputSlotCount) {
+ case 0: return false;
+ case 1: return getFillableStack() == null ? !mRequiresFluidForFiltering && getRecipeList().containsInput(aStack) : null!=getRecipeList().findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, V[mTier], new FluidStack[] {getFillableStack()}, getSpecialSlot(), new ItemStack[] {aStack});
+ case 2: return (!mRequiresFluidForFiltering || getFillableStack() != null) && (((getInputAt(0)!=null&&getInputAt(1)!=null) || (getInputAt(0)==null&&getInputAt(1)==null?getRecipeList().containsInput(aStack):(getRecipeList().containsInput(aStack)&&null!=getRecipeList().findRecipe(getBaseMetaTileEntity(), mLastRecipe, true, V[mTier], new FluidStack[] {getFillableStack()}, getSpecialSlot(), aIndex == getInputSlot() ? new ItemStack[] {aStack, getInputAt(1)} : new ItemStack[] {getInputAt(0), aStack})))));
+ default: return getRecipeList().containsInput(aStack);
+ }
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ if (aBaseMetaTileEntity.isClientSide() && aBaseMetaTileEntity.isActive()) {
+ switch (mSpecialEffect) {
+ case 0:
+ break;
+ case 1:
+ if (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.9F + tRandom.nextFloat() * 0.2F, aBaseMetaTileEntity.getZCoord() + 0.8F - tRandom.nextFloat() * 0.6F, 0.0D, 0.0D, 0.0D);
+ }
+ break;
+ }
+ }
+ }
+
+
+ public Gregtech_Recipe_Map getRecipeList() {
+ return mRecipes;
+ }
+
+ @Override
+ public int getCapacity() {
+ return mTankCapacity;
+ }
+
+ @Override
+ public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) {
+ super.startSoundLoop(aIndex, aX, aY, aZ);
+ if (aIndex == 1 && GT_Utility.isStringValid(mSound)) GT_Utility.doSoundAtClient(mSound, 100, 1.0F, aX, aY, aZ);
+ }
+
+ @Override
+ public void startProcess() {
+ if (GT_Utility.isStringValid(mSound)) sendLoopStart((byte) 1);
+ }
+
+ @Override
+ public FluidStack getFillableStack() {
+ return mSharedTank ? getDrainableStack() : super.getFillableStack();
+ }
+
+ @Override
+ public FluidStack setFillableStack(FluidStack aFluid) {
+ return mSharedTank ? setDrainableStack(aFluid) : super.setFillableStack(aFluid);
+ }
+
+ @Override
+ protected boolean displaysOutputFluid() {
+ return !mSharedTank;
+ }
+
+ public static enum X {PUMP, WIRE, WIRE4, HULL, PIPE, GLASS, PLATE, MOTOR, ROTOR, SENSOR, PISTON, CIRCUIT, EMITTER, CONVEYOR, ROBOT_ARM, COIL_HEATING, COIL_ELECTRIC, STICK_MAGNETIC, STICK_DISTILLATION, BETTER_CIRCUIT, FIELD_GENERATOR, COIL_HEATING_DOUBLE, STICK_ELECTROMAGNETIC;}
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_CustomRecipe_BasicMachine.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_CustomRecipe_BasicMachine.java
new file mode 100644
index 0000000000..521b23a42e
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MTE_CustomRecipe_BasicMachine.java
@@ -0,0 +1,799 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base;
+
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.Textures;
+import gregtech.api.gui.GT_Container_BasicMachine;
+import gregtech.api.gui.GT_GUIContainer_BasicMachine;
+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.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.xmod.gregtech.api.util.GregtechRecipe_OLD;
+import gtPlusPlus.xmod.gregtech.api.util.GregtechRecipe_OLD.Gregtech_Recipe_Map;
+
+import java.util.Arrays;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidHandler;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * This is the main construct for my Basic Machines such as the Automatic Extractor
+ * Extend this class to make a simple Machine
+ */
+public abstract class GT_MTE_CustomRecipe_BasicMachine extends GT_MetaTileEntity_BasicTank {
+ /**
+ * return values for checkRecipe()
+ */
+ protected static final int
+ DID_NOT_FIND_RECIPE = 0,
+ FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1,
+ FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2;
+ private static final int OTHER_SLOT_COUNT = 4;
+ public final ItemStack[] mOutputItems;
+ public final int mInputSlotCount, mAmperage;
+ public boolean mAllowInputFromOutputSide = false, mFluidTransfer = false, mItemTransfer = false, mHasBeenUpdated = false, mStuttering = false, mCharge = false, mDecharge = false;
+ public int mMainFacing = -1, mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mOutputBlocked = 0;
+ public FluidStack mOutputFluid;
+ public String mGUIName = "", mNEIName = "";
+ private NBTTagCompound mRecipeStuff = new NBTTagCompound();
+ /**
+ * Contains the Recipe which has been previously used, or null if there was no previous Recipe, which could have been buffered
+ */
+ protected GregtechRecipe_OLD mLastRecipe = null;
+ private FluidStack mFluidOut;
+
+ /**
+ * @param aOverlays 0 = SideFacingActive
+ * 1 = SideFacingInactive
+ * 2 = FrontFacingActive
+ * 3 = FrontFacingInactive
+ * 4 = TopFacingActive
+ * 5 = TopFacingInactive
+ * 6 = BottomFacingActive
+ * 7 = BottomFacingInactive
+ * ----- Not all Array Elements have to be initialised, you can also just use 8 Parameters for the Default Pipe Texture Overlays -----
+ * 8 = BottomFacingPipeActive
+ * 9 = BottomFacingPipeInactive
+ * 10 = TopFacingPipeActive
+ * 11 = TopFacingPipeInactive
+ * 12 = SideFacingPipeActive
+ * 13 = SideFacingPipeInactive
+ */
+ public GT_MTE_CustomRecipe_BasicMachine(int aID, String aName, String aNameRegional, int aTier, int aAmperage, String aDescription, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName, ITexture... aOverlays) {
+ super(aID, aName, aNameRegional, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aOverlays);
+ mInputSlotCount = Math.max(0, aInputSlotCount);
+ mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)];
+ mAmperage = aAmperage;
+ mGUIName = aGUIName;
+ mNEIName = aNEIName;
+ }
+
+ public GT_MTE_CustomRecipe_BasicMachine(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) {
+ super(aName, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aTextures);
+ mInputSlotCount = Math.max(0, aInputSlotCount);
+ mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)];
+ mAmperage = aAmperage;
+ mGUIName = aGUIName;
+ mNEIName = aNEIName;
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ ITexture[][][] rTextures = new ITexture[14][17][];
+ aTextures = Arrays.copyOf(aTextures, 14);
+
+ for (int i = 0; i < aTextures.length; i++)
+ if (aTextures[i] != null) for (byte c = -1; c < 16; c++) {
+ if (rTextures[i][c + 1] == null)
+ rTextures[i][c + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][c + 1], aTextures[i]};
+ }
+
+ for (byte c = -1; c < 16; c++) {
+ if (rTextures[0][c + 1] == null) rTextures[0][c + 1] = getSideFacingActive(c);
+ if (rTextures[1][c + 1] == null) rTextures[1][c + 1] = getSideFacingInactive(c);
+ if (rTextures[2][c + 1] == null) rTextures[2][c + 1] = getFrontFacingActive(c);
+ if (rTextures[3][c + 1] == null) rTextures[3][c + 1] = getFrontFacingInactive(c);
+ if (rTextures[4][c + 1] == null) rTextures[4][c + 1] = getTopFacingActive(c);
+ if (rTextures[5][c + 1] == null) rTextures[5][c + 1] = getTopFacingInactive(c);
+ if (rTextures[6][c + 1] == null) rTextures[6][c + 1] = getBottomFacingActive(c);
+ if (rTextures[7][c + 1] == null) rTextures[7][c + 1] = getBottomFacingInactive(c);
+ if (rTextures[8][c + 1] == null) rTextures[8][c + 1] = getBottomFacingPipeActive(c);
+ if (rTextures[9][c + 1] == null) rTextures[9][c + 1] = getBottomFacingPipeInactive(c);
+ if (rTextures[10][c + 1] == null) rTextures[10][c + 1] = getTopFacingPipeActive(c);
+ if (rTextures[11][c + 1] == null) rTextures[11][c + 1] = getTopFacingPipeInactive(c);
+ if (rTextures[12][c + 1] == null) rTextures[12][c + 1] = getSideFacingPipeActive(c);
+ if (rTextures[13][c + 1] == null) rTextures[13][c + 1] = getSideFacingPipeInactive(c);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
+ return mTextures[mMainFacing < 2 ? aSide == aFacing ? aActive ? 2 : 3 : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1 : aSide == mMainFacing ? aActive ? 2 : 3 : (showPipeFacing() && aSide == aFacing) ? aSide == 0 ? aActive ? 8 : 9 : aSide == 1 ? aActive ? 10 : 11 : aActive ? 12 : 13 : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1][aColorIndex + 1];
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isOverclockerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isTransformerUpgradable() {
+ return false;
+ }
+
+ @Override
+ public boolean isElectric() {
+ return true;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex > 0 && super.isValidSlot(aIndex) && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return mMainFacing > 1 || aFacing > 1;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return true;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return aSide != mMainFacing;
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public boolean isLiquidInput(byte aSide) {
+ return aSide != mMainFacing && (mAllowInputFromOutputSide || aSide != getBaseMetaTileEntity().getFrontFacing());
+ }
+
+ @Override
+ public boolean isLiquidOutput(byte aSide) {
+ return aSide != mMainFacing;
+ }
+
+ @Override
+ public long getMinimumStoredEU() {
+ return V[mTier] * 16;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return V[mTier] * 64;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxSteamStore() {
+ return maxEUStore();
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return (mEUt * 2) / V[mTier] + 1;
+ }
+
+ @Override
+ public int getInputSlot() {
+ return OTHER_SLOT_COUNT;
+ }
+
+ @Override
+ public int getOutputSlot() {
+ return OTHER_SLOT_COUNT + mInputSlotCount;
+ }
+
+ @Override
+ public int getStackDisplaySlot() {
+ return 2;
+ }
+
+ @Override
+ public int rechargerSlotStartIndex() {
+ return 1;
+ }
+
+ @Override
+ public int dechargerSlotStartIndex() {
+ return 1;
+ }
+
+ @Override
+ public int rechargerSlotCount() {
+ return mCharge ? 1 : 0;
+ }
+
+ @Override
+ public int dechargerSlotCount() {
+ return mDecharge ? 1 : 0;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return mProgresstime;
+ }
+
+ @Override
+ public int maxProgresstime() {
+ return mMaxProgresstime;
+ }
+
+ @Override
+ public int increaseProgress(int aProgress) {
+ mProgresstime += aProgress;
+ return mMaxProgresstime - mProgresstime;
+ }
+
+ @Override
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return getFillableStack() != null || (getRecipeList() != null && getRecipeList().containsInput(aFluid));
+ }
+
+ @Override
+ public boolean isFluidChangingAllowed() {
+ return true;
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ return false;
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return false;
+ }
+
+ @Override
+ public boolean canTankBeFilled() {
+ return true;
+ }
+
+ @Override
+ public boolean canTankBeEmptied() {
+ return true;
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return true;
+ }
+
+ @Override
+ public boolean displaysStackSize() {
+ return true;
+ }
+
+ @Override
+ public FluidStack getDisplayedFluid() {
+ return displaysOutputFluid() ? getDrainableStack() : null;
+ }
+
+ @Override
+ public FluidStack getDrainableStack() {
+ return mFluidOut;
+ }
+
+ @Override
+ public FluidStack setDrainableStack(FluidStack aFluid) {
+ mFluidOut = aFluid;
+ return mFluidOut;
+ }
+
+ @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 GT_Container_BasicMachine(aPlayerInventory, aBaseMetaTileEntity);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), mGUIName, GT_Utility.isStringValid(mNEIName) ? mNEIName : getRecipeList() != null ? getRecipeList().mUnlocalizedName : "");
+ }
+
+ @Override
+ public void initDefaultModes(NBTTagCompound aNBT) {
+ mMainFacing = -1;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ aNBT.setBoolean("mFluidTransfer", mFluidTransfer);
+ aNBT.setBoolean("mItemTransfer", mItemTransfer);
+ aNBT.setBoolean("mHasBeenUpdated", mHasBeenUpdated);
+ aNBT.setBoolean("mAllowInputFromOutputSide", mAllowInputFromOutputSide);
+ aNBT.setInteger("mEUt", mEUt);
+ aNBT.setInteger("mMainFacing", mMainFacing);
+ aNBT.setInteger("mProgresstime", mProgresstime);
+ aNBT.setInteger("mMaxProgresstime", mMaxProgresstime);
+ aNBT.setTag("GT.CraftingComponents", mRecipeStuff);
+ if (mOutputFluid != null) aNBT.setTag("mOutputFluid", mOutputFluid.writeToNBT(new NBTTagCompound()));
+ if (mFluidOut != null) aNBT.setTag("mFluidOut", mFluidOut.writeToNBT(new NBTTagCompound()));
+
+ for (int i = 0; i < mOutputItems.length; i++)
+ if (mOutputItems[i] != null)
+ aNBT.setTag("mOutputItem" + i, mOutputItems[i].writeToNBT(new NBTTagCompound()));
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ mFluidTransfer = aNBT.getBoolean("mFluidTransfer");
+ mItemTransfer = aNBT.getBoolean("mItemTransfer");
+ mHasBeenUpdated = aNBT.getBoolean("mHasBeenUpdated");
+ mAllowInputFromOutputSide = aNBT.getBoolean("mAllowInputFromOutputSide");
+ mEUt = aNBT.getInteger("mEUt");
+ mMainFacing = aNBT.getInteger("mMainFacing");
+ mProgresstime = aNBT.getInteger("mProgresstime");
+ mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
+ mRecipeStuff = aNBT.getCompoundTag("GT.CraftingComponents");
+ mOutputFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mOutputFluid"));
+ mFluidOut = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluidOut"));
+
+ for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i);
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPostTick(aBaseMetaTileEntity, aTick);
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+ mCharge = aBaseMetaTileEntity.getStoredEU() / 2 > aBaseMetaTileEntity.getEUCapacity() / 3;
+ mDecharge = aBaseMetaTileEntity.getStoredEU() < aBaseMetaTileEntity.getEUCapacity() / 3;
+
+ doDisplayThings();
+
+ boolean tSucceeded = false;
+
+ if (mMaxProgresstime > 0 && (mProgresstime >= 0 || aBaseMetaTileEntity.isAllowedToWork())) {
+ aBaseMetaTileEntity.setActive(true);
+ if (mProgresstime < 0 || drainEnergyForProcess(mEUt)) {
+ if (++mProgresstime >= mMaxProgresstime) {
+ for (int i = 0; i < mOutputItems.length; i++)
+ for (int j = 0; j < mOutputItems.length; j++)
+ if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i]))
+ break;
+ if (mOutputFluid != null)
+ if (getDrainableStack() == null) setDrainableStack(mOutputFluid.copy());
+ else if (mOutputFluid.isFluidEqual(getDrainableStack()))
+ getDrainableStack().amount += mOutputFluid.amount;
+ for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = null;
+ mOutputFluid = null;
+ mEUt = 0;
+ mProgresstime = 0;
+ mMaxProgresstime = 0;
+ mStuttering = false;
+ tSucceeded = true;
+ endProcess();
+ }
+ if (mProgresstime > 5) mStuttering = false;
+ } else {
+ if (!mStuttering) {
+ stutterProcess();
+ if (canHaveInsufficientEnergy()) mProgresstime = -100;
+ mStuttering = true;
+ }
+ }
+ } else {
+ aBaseMetaTileEntity.setActive(false);
+ }
+
+ boolean tRemovedOutputFluid = false;
+
+ if (doesAutoOutputFluids() && getDrainableStack() != null && aBaseMetaTileEntity.getFrontFacing() != mMainFacing && (tSucceeded || aTick % 20 == 0)) {
+ IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing());
+ if (tTank != null) {
+ FluidStack tDrained = drain(1000, false);
+ if (tDrained != null) {
+ int tFilledAmount = tTank.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false);
+ if (tFilledAmount > 0)
+ tTank.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), drain(tFilledAmount, true), true);
+ }
+ }
+ if (getDrainableStack() == null) tRemovedOutputFluid = true;
+ }
+
+ if (doesAutoOutput() && !isOutputEmpty() && aBaseMetaTileEntity.getFrontFacing() != mMainFacing && (tSucceeded || mOutputBlocked % 300 == 1 || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0)) {
+ TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing());
+ for (int i = 0, tCosts = 1; i < mOutputItems.length && tCosts > 0 && aBaseMetaTileEntity.isUniversalEnergyStored(128); i++) {
+ tCosts = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity2, aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
+ if (tCosts > 0) aBaseMetaTileEntity.decreaseStoredEnergyUnits(tCosts, true);
+ }
+ }
+
+ if (mOutputBlocked != 0) if (isOutputEmpty()) mOutputBlocked = 0;
+ else mOutputBlocked++;
+
+ if (allowToCheckRecipe()) {
+ if (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) && hasEnoughEnergyToCheckRecipe()) {
+ if (checkRecipe() == 2) {
+ if (mInventory[3] != null && mInventory[3].stackSize <= 0) mInventory[3] = null;
+ for (int i = getInputSlot(), j = i + mInputSlotCount; i < j; i++)
+ if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null;
+ for (int i = 0; i < mOutputItems.length; i++) {
+ mOutputItems[i] = GT_Utility.copy(mOutputItems[i]);
+ if (mOutputItems[i] != null && mOutputItems[i].stackSize > 64)
+ mOutputItems[i].stackSize = 64;
+ mOutputItems[i] = GT_OreDictUnificator.get(true, mOutputItems[i]);
+ }
+ if (mFluid != null && mFluid.amount <= 0) mFluid = null;
+ mMaxProgresstime = Math.max(1, mMaxProgresstime);
+ if (GT_Utility.isDebugItem(mInventory[dechargerSlotStartIndex()])) {
+ mEUt = mMaxProgresstime = 1;
+ }
+ startProcess();
+ } else {
+ mMaxProgresstime = 0;
+ for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = null;
+ mOutputFluid = null;
+ }
+ }
+ } else {
+ if (!mStuttering) {
+ stutterProcess();
+ mStuttering = true;
+ }
+ }
+ }
+ }
+
+ protected void doDisplayThings() {
+ if (mMainFacing < 2 && getBaseMetaTileEntity().getFrontFacing() > 1) {
+ mMainFacing = getBaseMetaTileEntity().getFrontFacing();
+ }
+ if (mMainFacing >= 2 && !mHasBeenUpdated) {
+ mHasBeenUpdated = true;
+ getBaseMetaTileEntity().setFrontFacing(getBaseMetaTileEntity().getBackFacing());
+ }
+
+ if (displaysInputFluid()) {
+ int tDisplayStackSlot = OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length;
+ if (getFillableStack() == null) {
+ if (ItemList.Display_Fluid.isStackEqual(mInventory[tDisplayStackSlot], true, true))
+ mInventory[tDisplayStackSlot] = null;
+ } else {
+ mInventory[tDisplayStackSlot] = GT_Utility.getFluidDisplayStack(getFillableStack(), displaysStackSize());
+ }
+ }
+ }
+
+ protected boolean hasEnoughEnergyToCheckRecipe() {
+ return getBaseMetaTileEntity().isUniversalEnergyStored(getMinimumStoredEU() / 2);
+ }
+
+ protected boolean drainEnergyForProcess(long aEUt) {
+ return getBaseMetaTileEntity().decreaseStoredEnergyUnits(aEUt, false);
+ }
+
+ protected void calculateOverclockedNess(GregtechRecipe_OLD tRecipe) {
+ calculateOverclockedNess(tRecipe.mEUt, tRecipe.mDuration);
+ }
+
+ protected void calculateOverclockedNess(int aEUt, int aDuration) {
+ if (aEUt <= 16) {
+ mEUt = aEUt * (1 << (mTier - 1)) * (1 << (mTier - 1));
+ mMaxProgresstime = aDuration / (1 << (mTier - 1));
+ } else {
+ mEUt = aEUt;
+ mMaxProgresstime = aDuration;
+ while (mEUt <= V[mTier - 1] * mAmperage) {
+ mEUt *= 4;
+ mMaxProgresstime /= 2;
+ }
+ }
+ }
+
+ protected ItemStack getSpecialSlot() {
+ return mInventory[3];
+ }
+
+ protected ItemStack getOutputAt(int aIndex) {
+ return mInventory[getOutputSlot() + aIndex];
+ }
+
+ protected ItemStack[] getAllOutputs() {
+ ItemStack[] rOutputs = new ItemStack[mOutputItems.length];
+ for (int i = 0; i < mOutputItems.length; i++) rOutputs[i] = getOutputAt(i);
+ return rOutputs;
+ }
+
+ protected boolean canOutput(GregtechRecipe_OLD tRecipe) {
+ return tRecipe != null && (tRecipe.mNeedsEmptyOutput ? isOutputEmpty() && getDrainableStack() == null : canOutput(tRecipe.getFluidOutput(0)) && canOutput(tRecipe.mOutputs));
+ }
+
+ protected boolean canOutput(ItemStack... aOutputs) {
+ if (aOutputs == null) return true;
+ ItemStack[] tOutputSlots = getAllOutputs();
+ for (int i = 0; i < tOutputSlots.length && i < aOutputs.length; i++)
+ if (tOutputSlots[i] != null && aOutputs[i] != null && (!GT_Utility.areStacksEqual(tOutputSlots[i], aOutputs[i], false) || tOutputSlots[i].stackSize + aOutputs[i].stackSize > tOutputSlots[i].getMaxStackSize())) {
+ mOutputBlocked++;
+ return false;
+ }
+ return true;
+ }
+
+ protected boolean canOutput(FluidStack aOutput) {
+ return getDrainableStack() == null || aOutput == null || (getDrainableStack().isFluidEqual(aOutput) && (getDrainableStack().amount <= 0 || getDrainableStack().amount + aOutput.amount <= getCapacity()));
+ }
+
+ protected ItemStack getInputAt(int aIndex) {
+ return mInventory[getInputSlot() + aIndex];
+ }
+
+ protected ItemStack[] getAllInputs() {
+ ItemStack[] rInputs = new ItemStack[mInputSlotCount];
+ for (int i = 0; i < mInputSlotCount; i++) rInputs[i] = getInputAt(i);
+ return rInputs;
+ }
+
+ protected boolean isOutputEmpty() {
+ boolean rIsEmpty = true;
+ for (ItemStack tOutputSlotContent : getAllOutputs()) if (tOutputSlotContent != null) rIsEmpty = false;
+ return rIsEmpty;
+ }
+
+ protected boolean displaysInputFluid() {
+ return true;
+ }
+
+ protected boolean displaysOutputFluid() {
+ return true;
+ }
+
+ @Override
+ public void onValueUpdate(byte aValue) {
+ mMainFacing = aValue;
+ }
+
+ @Override
+ public byte getUpdateData() {
+ return (byte) mMainFacing;
+ }
+
+ @Override
+ public void doSound(byte aIndex, double aX, double aY, double aZ) {
+ super.doSound(aIndex, aX, aY, aZ);
+ if (aIndex == 8) GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(210), 100, 1.0F, aX, aY, aZ);
+ }
+
+ public boolean doesAutoOutput() {
+ return mItemTransfer;
+ }
+
+ public boolean doesAutoOutputFluids() {
+ return mFluidTransfer;
+ }
+
+ public boolean allowToCheckRecipe() {
+ return true;
+ }
+
+ public boolean showPipeFacing() {
+ return true;
+ }
+
+ /**
+ * 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() {
+ //
+ }
+
+ /**
+ * Called whenever the Machine aborted a Process but still works on it, useful for Sound Effects
+ */
+ public void stutterProcess() {
+ if (useStandardStutterSound()) sendSound((byte) 8);
+ }
+
+ /**
+ * If this Machine can have the Insufficient Energy Line Problem
+ */
+ public boolean canHaveInsufficientEnergy() {
+ return true;
+ }
+
+ public boolean useStandardStutterSound() {
+ return true;
+ }
+
+ @Override
+ public String[] getInfoData() {
+ return new String[]{
+ mRecipeStuff.toString(),
+ mNEIName,
+ "Progress:", (mProgresstime / 20) + " secs",
+ (mMaxProgresstime / 20) + " secs",
+ "Stored Energy:",
+ getBaseMetaTileEntity().getStoredEU() + "EU",
+ getBaseMetaTileEntity().getEUCapacity() + "EU"};
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ @Override
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (aSide == getBaseMetaTileEntity().getFrontFacing() || aSide == mMainFacing) {
+ mAllowInputFromOutputSide = !mAllowInputFromOutputSide;
+ GT_Utility.sendChatToPlayer(aPlayer, mAllowInputFromOutputSide ? "Input from Output Side allowed" : "Input from Output Side forbidden");
+ }
+ }
+
+ @Override
+ public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
+ return (aSide != mMainFacing || GregTech_API.getCoverBehavior(aCoverID.toStack()).isGUIClickable(aSide, GT_Utility.stackToInt(aCoverID.toStack()), 0, getBaseMetaTileEntity()));
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return aSide != mMainFacing && aIndex >= getOutputSlot() && aIndex < getOutputSlot() + mOutputItems.length;
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ if (aSide == mMainFacing || aIndex < getInputSlot() || aIndex >= getInputSlot() + mInputSlotCount || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing()))
+ return false;
+ for (int i = getInputSlot(), j = i + mInputSlotCount; i < j; i++)
+ if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(aStack), mInventory[i])) return i == aIndex;
+ return true;
+ }
+
+ /**
+ * @return the Recipe List which is used for this Machine, this is a useful Default Handler
+ */
+ public Gregtech_Recipe_Map getRecipeList() {
+ return null;
+ }
+
+ /**
+ * Override this to check the Recipes yourself, super calls to this could be useful if you just want to add a special case
+ * <p/>
+ * I thought about Enum too, but Enum doesn't add support for people adding other return Systems.
+ * <p/>
+ * Funny how Eclipse marks the word Enum as not correctly spelled.
+ *
+ * @return see constants above
+ */
+ public int checkRecipe() {
+ Gregtech_Recipe_Map tMap = getRecipeList();
+ if (tMap == null) return DID_NOT_FIND_RECIPE;
+ GregtechRecipe_OLD tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), getAllInputs());
+ if (tRecipe == null) return DID_NOT_FIND_RECIPE;
+ if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
+ if (!canOutput(tRecipe)) {
+ mOutputBlocked++;
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
+ }
+ if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs()))
+ return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
+
+ for (int i = 0; i < mOutputItems.length; i++)
+ if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(i))
+ mOutputItems[i] = tRecipe.getOutput(i);
+ mOutputFluid = tRecipe.getFluidOutput(0);
+ calculateOverclockedNess(tRecipe);
+ return FOUND_AND_SUCCESSFULLY_USED_RECIPE;
+ }
+
+ public ITexture[] getSideFacingActive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getSideFacingInactive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getFrontFacingActive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getFrontFacingInactive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getTopFacingActive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getTopFacingInactive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getBottomFacingActive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getBottomFacingInactive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ }
+
+ public ITexture[] getBottomFacingPipeActive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ }
+
+ public ITexture[] getBottomFacingPipeInactive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ }
+
+ public ITexture[] getTopFacingPipeActive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ }
+
+ public ITexture[] getTopFacingPipeInactive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ }
+
+ public ITexture[] getSideFacingPipeActive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ }
+
+ public ITexture[] getSideFacingPipeInactive(byte aColor) {
+ return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ }
+} \ No newline at end of file
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
new file mode 100644
index 0000000000..5434dcf671
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java
@@ -0,0 +1,291 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base;
+
+import static gregtech.api.enums.GT_Values.VN;
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+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.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;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+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.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+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 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);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = aCableLossPerMeter;
+ }
+
+ public GregtechMetaPipeEntityBase_Cable(String aName, float aThickNess, GT_Materials aMaterial, long aCableLossPerMeter, long aAmperage, long aVoltage, boolean aInsulated, boolean aCanShock) {
+ super(aName, 0);
+ mThickNess = aThickNess;
+ mMaterial = aMaterial;
+ mAmperage = aAmperage;
+ mVoltage = aVoltage;
+ mInsulated = aInsulated;
+ mCanShock = aCanShock;
+ mCableLossPerMeter = aCableLossPerMeter;
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return (byte) (mInsulated ? 9 : 8);
+ }
+
+ @Override
+ 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) {
+ 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 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 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 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 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) {
+ if(mOverheat>GT_Mod.gregtechproxy.mWireHeatingTicks * 100){
+ getBaseMetaTileEntity().setToFire();}else{mOverheat +=100;}
+ return aAmperage;
+ }
+ return rUsedAmperes;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide()) {
+ mTransferredAmperage = 0;
+ if(mOverheat>0)mOverheat--;
+
+ if (aTick % 20 == 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)) {
+ TileEntity tTileEntity = aBaseMetaTileEntity.getTileEntityAtSide(i);
+ if (tTileEntity instanceof IColoredTileEntity) {
+ if (aBaseMetaTileEntity.getColorization() >= 0) {
+ byte tColor = ((IColoredTileEntity) tTileEntity).getColorization();
+ if (tColor >= 0 && tColor != aBaseMetaTileEntity.getColorization()) continue;
+ }
+ }
+ 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))) {
+ mConnections |= (1 << i);
+ continue;
+ }
+ }
+ 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;
+ }*/
+ }
+ }
+ }
+ }
+ }
+
+ @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 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"
+ };
+ }
+
+ @Override
+ public float getThickNess() {
+ return mThickNess;
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ //
+ }
+
+ @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
new file mode 100644
index 0000000000..cd91d05970
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTileEntity.java
@@ -0,0 +1,67 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base;
+
+import static gregtech.api.enums.GT_Values.GT;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gtPlusPlus.core.lib.CORE;
+
+public abstract class GregtechMetaTileEntity extends MetaTileEntity {
+ /**
+ * Value between [0 - 9] to describe the Tier of this Machine.
+ */
+ public final byte mTier;
+
+ /**
+ * A simple Description.
+ */
+ public final String mDescription;
+
+ /**
+ * Contains all Textures used by this Block.
+ */
+ 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);
+ mTier = (byte)Math.max(0, Math.min(aTier, 9));
+ mDescription = aDescription;
+
+ // must always be the last call!
+ if (GT.isClientSide()) mTextures = getTextureSet(aTextures); else mTextures = null;
+ }
+
+ public GregtechMetaTileEntity(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aInvSlotCount);
+ mTier = (byte)aTier;
+ mDescription = aDescription;
+ mTextures = aTextures;
+
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return (byte)(Math.min(3, mTier<=0?0:1+((mTier-1) / 4)));
+ }
+
+ @Override
+ public long getInputTier() {
+ return mTier;
+ }
+
+ @Override
+ public long getOutputTier() {
+ 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.
+ */
+ public abstract ITexture[][][] getTextureSet(ITexture[] aTextures);
+} \ 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
new file mode 100644
index 0000000000..59f98b8767
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java
@@ -0,0 +1,828 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base;
+
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+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.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.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+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.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;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.fluids.FluidStack;
+
+public abstract class GregtechMeta_MultiBlockBase extends MetaTileEntity {
+
+ 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() {
+ //
+ }
+
+
+}
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
new file mode 100644
index 0000000000..ac27c32360
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java
@@ -0,0 +1,328 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+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.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;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+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(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
new file mode 100644
index 0000000000..e43b7db9aa
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java
@@ -0,0 +1,211 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators;
+
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.entity.player.EntityPlayer;
+
+public abstract class GregtechMetaSolarGenerator extends GT_MetaTileEntity_BasicTank {
+
+ 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() < maxEUOutput() + aBaseMetaTileEntity.getEUCapacity()) {
+
+ if (this.mSolarCharge <= 20) {
+ this.mSolarCharge = 20;
+ this.mLossTimer = 0;
+ }
+ if (++this.mLossTimer > 45) {
+ this.mSolarCharge -= 1;
+ this.mLossTimer = 0;
+ }
+
+ if (aTick % 25L == 0L) {
+ if (this.mSolarCharge > 100) {
+ 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)) {
+ this.mProcessingEnergy -= 1;
+ this.mSolarCharge += 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() >= maxEUOutput() + getMinimumStoredEU());
+ }
+ }
+ }
+
+ 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
new file mode 100644
index 0000000000..ec75e82114
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java
@@ -0,0 +1,263 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators;
+
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
+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 {
+ 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))
+ 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 (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
new file mode 100644
index 0000000000..e9ac788e7b
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechBaseMetaTileEntityLossless.java
@@ -0,0 +1,1857 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.lossless;
+
+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.ItemList;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IEnergyConnected;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+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.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;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.network.Packet;
+import net.minecraft.tileentity.TileEntity;
+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.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * 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 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;
+ }*/
+ 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
new file mode 100644
index 0000000000..47189bd4f4
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaPipeEntity_BaseSuperConductor.java
@@ -0,0 +1,640 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.lossless;
+
+import static gregtech.api.enums.GT_Values.GT;
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.api.GregTech_API;
+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.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;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+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.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
+ * <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");"
+ */
+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(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
new file mode 100644
index 0000000000..f62b8b69ff
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLossless.java
@@ -0,0 +1,66 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.lossless;
+
+import static gregtech.api.enums.GT_Values.GT;
+import gregtech.api.interfaces.ITexture;
+import gtPlusPlus.core.lib.CORE;
+
+public abstract class GregtechMetaTileEntityLossless extends MetaTileEntityLossless {
+ /**
+ * Value between [0 - 9] to describe the Tier of this Machine.
+ */
+ public final byte mTier;
+
+ /**
+ * A simple Description.
+ */
+ public final String mDescription;
+
+ /**
+ * Contains all Textures used by this Block.
+ */
+ 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);
+ mTier = (byte)Math.max(0, Math.min(aTier, 9));
+ mDescription = aDescription;
+
+ // must always be the last call!
+ if (GT.isClientSide()) mTextures = getTextureSet(aTextures); else mTextures = null;
+ }
+
+ public GregtechMetaTileEntityLossless(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aInvSlotCount);
+ mTier = (byte)aTier;
+ mDescription = aDescription;
+ mTextures = aTextures;
+
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return (byte)(Math.min(3, mTier<=0?0:1+((mTier-1) / 4)));
+ }
+
+ @Override
+ public long getInputTier() {
+ return mTier;
+ }
+
+ @Override
+ public long getOutputTier() {
+ 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.
+ */
+ 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/GregtechMetaTileEntityLosslessBasicTank.java b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLosslessBasicTank.java
new file mode 100644
index 0000000000..aee474d9bf
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLosslessBasicTank.java
@@ -0,0 +1,251 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.lossless;
+
+import gregtech.api.enums.ItemList;
+import gregtech.api.gui.GT_Container_BasicTank;
+import gregtech.api.gui.GT_GUIContainer_BasicTank;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+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
+ */
+public abstract class GregtechMetaTileEntityLosslessBasicTank extends GregtechMetaTileEntityLosslessTieredMachineBlock {
+
+ 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
new file mode 100644
index 0000000000..7f4c1a4ed8
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/GregtechMetaTileEntityLosslessTieredMachineBlock.java
@@ -0,0 +1,67 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.lossless;
+
+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;
+
+ /**
+ * A simple Description.
+ */
+ public final String mDescription;
+
+ /**
+ * Contains all Textures used by this Block.
+ */
+ public final ITexture[][][] mTextures;
+
+ 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.isClientSide()) mTextures = getTextureSet(aTextures);
+ else mTextures = null;
+ }
+
+ public GregtechMetaTileEntityLosslessTieredMachineBlock(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aInvSlotCount);
+ mTier = (byte) aTier;
+ mDescription = aDescription;
+ mTextures = aTextures;
+ }
+
+ @Override
+ public byte getTileEntityBaseType() {
+ return (byte) (Math.min(3, mTier <= 0 ? 0 : 1 + ((mTier - 1) / 4)));
+ }
+
+ @Override
+ public long getInputTier() {
+ return mTier;
+ }
+
+ @Override
+ public long getOutputTier() {
+ return mTier;
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{mDescription};
+ }
+
+ /**
+ * 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
new file mode 100644
index 0000000000..7ec9547ab4
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/lossless/MetaTileEntityLossless.java
@@ -0,0 +1,865 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.lossless;
+
+import static gregtech.api.enums.GT_Values.GT;
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.objects.GT_ItemStack;
+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;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+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.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
+ * <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");"
+ */
+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(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
new file mode 100644
index 0000000000..ddbc5aab96
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java
@@ -0,0 +1,350 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.machines;
+
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.handler.events.UnbreakableBlockManager;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.player.PlayerCache;
+
+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(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription) {
+ super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription);
+ }
+
+ public GregtechMetaSafeBlockBase(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aInvSlotCount, aDescription, aTextures);
+ }
+
+ @Override
+ 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 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 mTextures[2][aColorIndex + 1];
+ case 1:
+ return mTextures[2][aColorIndex + 1];
+ case 4:
+ return mTextures[1][aColorIndex + 1];
+ case 5:
+ 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 mTextures[5][aColorIndex + 1];
+ }
+
+ @Override
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ @Override
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < mInventory.length - 1;
+ }
+
+ @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 !isOutputFacing(aSide);
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return getBaseMetaTileEntity().getBackFacing() == aSide;
+ }
+
+ @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 maxEUOutput() {
+ return bOutput ? V[mTier] : 0;
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 1;
+ }
+
+ @Override
+ public long maxAmperesOut() {
+ return 1;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ public abstract ITexture getOverlayIcon();
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+
+ if (aBaseMetaTileEntity.isClientSide()) {
+ //Utils.LOG_WARNING("Clicky Clicky.");
+ return true;
+
+ }
+ if (!aPlayer.equals(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(ownerUUID)+" - UUID: "+ownerUUID);
+ }
+ Utils.LOG_WARNING("Is ownerUUID Null");
+ if (ownerUUID == null){
+ Utils.LOG_WARNING("OwnerUUID is Null, let's set it.");
+ 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 (ownerUUID != null){
+ Utils.LOG_WARNING("ownerUUID != Null, if accessor == owner.");
+ 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.");
+ }
+ else {
+ Utils.messagePlayer(aPlayer, "Access Denied, This does not belong to you.");
+ Utils.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); */
+
+ }
+ return true;
+ }
+
+ @Override
+ 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");
+ 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 {
+
+ }
+
+
+
+
+
+
+
+
+ /*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);
+ }
+ }*/
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ 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
new file mode 100644
index 0000000000..348e7dd118
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/creative/GregtechMetaCreativeEnergyBuffer.java
@@ -0,0 +1,269 @@
+package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.creative;
+
+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_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;
+import gregtech.api.items.GT_MetaBase_Item;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaEnergyBuffer;
+import ic2.api.item.IElectricItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+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
+ */
+public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer {
+
+
+ public GregtechMetaCreativeEnergyBuffer(String aName, int aTier,
+ String aDescription, ITexture[][][] aTextures, int aSlotCount) {
+ super(aName, aTier, aDescription, aTextures, aSlotCount);
+ // TODO Auto-generated constructor stub
+ }
+
+ public GregtechMetaCreativeEnergyBuffer(int aID, String aName,
+ String aNameRegional, int aTier, String aDescription, int aSlotCount) {
+ super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount);
+ }
+
+ public boolean mCharge = false, mDecharge = false;
+ public int mBatteryCount = 1, mChargeableCount = 1;
+
+ @Override
+ public String[] getDescription() {
+ return new String[] {mDescription, "Added by: " + EnumChatFormatting.DARK_GREEN+"Alkalus"};
+ }
+
+ /*
+ * MACHINE_STEEL_SIDE
+ */
+ @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_CASING_MAGIC_FRONT) };
+ rTextures[1][i + 1] = new ITexture[] {
+ 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 ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide, byte aFacing, byte aColorIndex, boolean aActive,
+ boolean aRedstone) {
+ return mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1];
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaCreativeEnergyBuffer(mName, mTier, mDescription,
+ mTextures, mInventory.length);
+ }
+
+ @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 1;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return Long.MAX_VALUE;
+ }
+
+ @Override
+ public long maxEUInput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxEUOutput() {
+ return V[mTier];
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return mChargeableCount * 16;
+ }
+
+ @Override
+ 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 void saveNBTData(NBTTagCompound aNBT) {
+ //
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ //
+ }
+
+ @Override
+ 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 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 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 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 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 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)) {
+
+ 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);
+ }
+ }
+ }
+
+ }
+ return new long[] { tStored, tScale };
+ }
+
+ private long count=0;
+ private long mStored=0;
+ private long mMax=0;
+
+ @Override
+ 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 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
new file mode 100644
index 0000000000..56a48602c9
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechFluid.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.xmod.gregtech.api.objects;
+
+import gregtech.api.GregTech_API;
+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 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, mRGBa[0])) << 16) | (Math.max(0, Math.min(255, mRGBa[1])) << 8) | Math.max(0, Math.min(255, mRGBa[2]));
+ }
+
+ @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
new file mode 100644
index 0000000000..2994bb1b71
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechItemData.java
@@ -0,0 +1,130 @@
+package gtPlusPlus.xmod.gregtech.api.objects;
+
+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(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
new file mode 100644
index 0000000000..245db1745f
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechMaterialStack.java
@@ -0,0 +1,42 @@
+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(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
new file mode 100644
index 0000000000..03c59c7ac6
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/objects/GregtechRenderedTexture.java
@@ -0,0 +1,162 @@
+package gtPlusPlus.xmod.gregtech.api.objects;
+
+import gregtech.api.enums.Dyes;
+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;
+import net.minecraft.client.renderer.RenderBlocks;
+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(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
new file mode 100644
index 0000000000..f6c74ad12b
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/recipe/ProcessingSkookumChoocherToolRecipes.java
@@ -0,0 +1,19 @@
+package gtPlusPlus.xmod.gregtech.api.recipe;
+
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.ToolDictNames;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.common.items.GT_MetaGenerated_Tool_01;
+import net.minecraft.item.ItemStack;
+
+public class ProcessingSkookumChoocherToolRecipes implements gregtech.api.interfaces.IOreRecipeRegistrator {
+ public ProcessingSkookumChoocherToolRecipes() {
+ //GregtechOrePrefixes.toolSkookumChoocher.add(this);
+ }
+
+ @Override
+ public void registerOre(OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+ GT_ModHandler.addShapelessCraftingRecipe(GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(32, 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
new file mode 100644
index 0000000000..de41b3cafa
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechOreDictUnificator.java
@@ -0,0 +1,366 @@
+package gtPlusPlus.xmod.gregtech.api.util;
+
+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.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.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;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <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
+ * <p/>
+ * 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(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
+
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipeRegistrator.java b/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipeRegistrator.java
new file mode 100644
index 0000000000..027b89c8e1
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipeRegistrator.java
@@ -0,0 +1,340 @@
+package gtPlusPlus.xmod.gregtech.api.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.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;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.lib.CORE;
+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;
+
+/**
+ * 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[][]{
+ {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/api/util/GregtechRecipe_OLD.java b/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipe_OLD.java
new file mode 100644
index 0000000000..60583ed27b
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/api/util/GregtechRecipe_OLD.java
@@ -0,0 +1,781 @@
+package gtPlusPlus.xmod.gregtech.api.util;
+
+import static gregtech.api.enums.GT_Values.E;
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+import static gregtech.api.enums.GT_Values.W;
+import gregtech.api.GregTech_API;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords;
+import gregtech.api.objects.GT_FluidStack;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_Log;
+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 gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+
+/**
+ * NEVER INCLUDE THIS FILE IN YOUR MOD!!!
+ * <p/>
+ * This File contains the functions used for Recipes. Please do not include this File AT ALL in your Moddownload as it ruins compatibility
+ * This is just the Core of my Recipe System, if you just want to GET the Recipes I add, then you can access this File.
+ * Do NOT add Recipes using the Constructors inside this Class, The GregTech_API File calls the correct Functions for these Constructors.
+ * <p/>
+ * I know this File causes some Errors, because of missing Main Functions, but if you just need to compile Stuff, then remove said erroreous Functions.
+ */
+public class GregtechRecipe_OLD {
+
+ public static volatile int VERSION = 508;
+ /**
+ * If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs, please add a new Recipe, because of the HashMaps.
+ */
+ public ItemStack[] mInputs, mOutputs;
+ /**
+ * If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs, please add a new Recipe, because of the HashMaps.
+ */
+ public FluidStack[] mFluidInputs, mFluidOutputs;
+ /**
+ * If you changed the amount of Array-Items inside the Output Array then the length of this Array must be larger or equal to the Output Array. A chance of 10000 equals 100%
+ */
+ public int[] mChances;
+ /**
+ * An Item that needs to be inside the Special Slot, like for example the Copy Slot inside the Printer. This is only useful for Fake Recipes in NEI, since findRecipe() and containsInput() don't give a shit about this Field. Lists are also possible.
+ */
+ public Object mSpecialItems;
+ public int mDuration, mEUt, mSpecialValue;
+ /**
+ * Use this to just disable a specific Recipe, but the Configuration enables that already for every single Recipe.
+ */
+ public boolean mEnabled = true;
+ /**
+ * If this Recipe is hidden from NEI
+ */
+ public boolean mHidden = false;
+ /**
+ * If this Recipe is Fake and therefore doesn't get found by the findRecipe Function (It is still in the HashMaps, so that containsInput does return T on those fake Inputs)
+ */
+ public boolean mFakeRecipe = false;
+ /**
+ * If this Recipe can be stored inside a Machine in order to make Recipe searching more Efficient by trying the previously used Recipe first. In case you have a Recipe Map overriding things and returning one time use Recipes, you have to set this to F.
+ */
+ public boolean mCanBeBuffered = true;
+ /**
+ * If this Recipe needs the Output Slots to be completely empty. Needed in case you have randomised Outputs
+ */
+ public boolean mNeedsEmptyOutput = false;
+ private GregtechRecipe_OLD(GregtechRecipe_OLD aRecipe) {
+ mInputs = GT_Utility.copyStackArray((Object[]) aRecipe.mInputs);
+ mOutputs = GT_Utility.copyStackArray((Object[]) aRecipe.mOutputs);
+ mSpecialItems = aRecipe.mSpecialItems;
+ mChances = aRecipe.mChances;
+ mFluidInputs = GT_Utility.copyFluidArray(aRecipe.mFluidInputs);
+ mFluidOutputs = GT_Utility.copyFluidArray(aRecipe.mFluidOutputs);
+ mDuration = aRecipe.mDuration;
+ mSpecialValue = aRecipe.mSpecialValue;
+ mEUt = aRecipe.mEUt;
+ mNeedsEmptyOutput = aRecipe.mNeedsEmptyOutput;
+ mCanBeBuffered = aRecipe.mCanBeBuffered;
+ mFakeRecipe = aRecipe.mFakeRecipe;
+ mEnabled = aRecipe.mEnabled;
+ mHidden = aRecipe.mHidden;
+ }
+ protected GregtechRecipe_OLD(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecialItems, int[] aChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ if (aInputs == null) aInputs = new ItemStack[0];
+ if (aOutputs == null) aOutputs = new ItemStack[0];
+ if (aFluidInputs == null) aFluidInputs = new FluidStack[0];
+ if (aFluidOutputs == null) aFluidOutputs = new FluidStack[0];
+ if (aChances == null) aChances = new int[aOutputs.length];
+ if (aChances.length < aOutputs.length) aChances = Arrays.copyOf(aChances, aOutputs.length);
+
+ aInputs = GT_Utility.getArrayListWithoutTrailingNulls(aInputs).toArray(new ItemStack[0]);
+ aOutputs = GT_Utility.getArrayListWithoutTrailingNulls(aOutputs).toArray(new ItemStack[0]);
+ aFluidInputs = GT_Utility.getArrayListWithoutNulls(aFluidInputs).toArray(new FluidStack[0]);
+ aFluidOutputs = GT_Utility.getArrayListWithoutNulls(aFluidOutputs).toArray(new FluidStack[0]);
+
+ GT_OreDictUnificator.setStackArray(true, aInputs);
+ GT_OreDictUnificator.setStackArray(true, aOutputs);
+
+ for (ItemStack tStack : aOutputs) GT_Utility.updateItemStack(tStack);
+
+ for (int i = 0; i < aChances.length; i++) if (aChances[i] <= 0) aChances[i] = 10000;
+ for (int i = 0; i < aFluidInputs.length; i++) aFluidInputs[i] = new GT_FluidStack(aFluidInputs[i]);
+ for (int i = 0; i < aFluidOutputs.length; i++) aFluidOutputs[i] = new GT_FluidStack(aFluidOutputs[i]);
+
+ for (int i = 0; i < aInputs.length; i++)
+ if (aInputs[i] != null && Items.feather.getDamage(aInputs[i]) != W)
+ for (int j = 0; j < aOutputs.length; j++) {
+ if (GT_Utility.areStacksEqual(aInputs[i], aOutputs[j])) {
+ if (aInputs[i].stackSize >= aOutputs[j].stackSize) {
+ aInputs[i].stackSize -= aOutputs[j].stackSize;
+ aOutputs[j] = null;
+ } else {
+ aOutputs[j].stackSize -= aInputs[i].stackSize;
+ }
+ }
+ }
+
+ if (aOptimize && aDuration >= 32) {
+ ArrayList<ItemStack> tList = new ArrayList<ItemStack>();
+ tList.addAll(Arrays.asList(aInputs));
+ tList.addAll(Arrays.asList(aOutputs));
+ for (int i = 0; i < tList.size(); i++) if (tList.get(i) == null) tList.remove(i--);
+
+ for (byte i = (byte) Math.min(64, aDuration / 16); i > 1; i--)
+ if (aDuration / i >= 16) {
+ boolean temp = true;
+ for (int j = 0, k = tList.size(); temp && j < k; j++)
+ if (tList.get(j).stackSize % i != 0) temp = false;
+ for (int j = 0; temp && j < aFluidInputs.length; j++)
+ if (aFluidInputs[j].amount % i != 0) temp = false;
+ for (int j = 0; temp && j < aFluidOutputs.length; j++)
+ if (aFluidOutputs[j].amount % i != 0) temp = false;
+ if (temp) {
+ for (int j = 0, k = tList.size(); j < k; j++) tList.get(j).stackSize /= i;
+ for (int j = 0; j < aFluidInputs.length; j++) aFluidInputs[j].amount /= i;
+ for (int j = 0; j < aFluidOutputs.length; j++) aFluidOutputs[j].amount /= i;
+ aDuration /= i;
+ }
+ }
+ }
+
+ mInputs = aInputs;
+ mOutputs = aOutputs;
+ mSpecialItems = aSpecialItems;
+ mChances = aChances;
+ mFluidInputs = aFluidInputs;
+ mFluidOutputs = aFluidOutputs;
+ mDuration = aDuration;
+ mSpecialValue = aSpecialValue;
+ mEUt = aEUt;
+
+ // checkCellBalance();
+
+ Utils.LOG_SPECIFIC_WARNING(this.getClass().getName()+" | [GregtechRecipe_OLD]", "Created new recipe instance for "+UtilsItems.getArrayStackNames(aInputs), 167);
+ }
+
+ public GregtechRecipe_OLD(ItemStack aInput1, ItemStack aOutput1, int aFuelValue, int aType) {
+ this(aInput1, aOutput1, null, null, null, aFuelValue, aType);
+ }
+
+ // aSpecialValue = EU per Liter! If there is no Liquid for this Object, then it gets multiplied with 1000!
+ public GregtechRecipe_OLD(ItemStack aInput1, ItemStack aOutput1, ItemStack aOutput2, ItemStack aOutput3, ItemStack aOutput4, int aSpecialValue, int aType) {
+ this(true, new ItemStack[]{aInput1}, new ItemStack[]{aOutput1, aOutput2, aOutput3, aOutput4}, null, null, null, null, 0, 0, Math.max(1, aSpecialValue));
+
+ Utils.LOG_INFO("Switch case method for adding fuels");
+ if (mInputs.length > 0 && aSpecialValue > 0) {
+ switch (aType) {
+ // Diesel Generator
+ case 0:
+ Utils.LOG_INFO("Added fuel "+aInput1.getDisplayName()+" is ROCKET FUEL - continuing");
+ Gregtech_Recipe_Map.sRocketFuels.addRecipe(this);
+ break;
+ // Gas Turbine
+ case 1:
+ Gregtech_Recipe_Map.sGeoThermalFuels.addRecipe(this);
+ break;
+ // Thermal Generator
+ case 2:
+ //Gregtech_Recipe_Map.sHotFuels.addRecipe(this);
+ break;
+ // Plasma Generator
+ case 4:
+ //Gregtech_Recipe_Map.sPlasmaFuels.addRecipe(this);
+ break;
+ // Magic Generator
+ case 5:
+ //Gregtech_Recipe_Map.sMagicFuels.addRecipe(this);
+ break;
+ // Fluid Generator. Usually 3. Every wrong Type ends up in the Semifluid Generator
+ default:
+ //Gregtech_Recipe_Map.sDenseLiquidFuels.addRecipe(this);
+ break;
+ }
+ }
+ }
+
+ //Custom Recipe Handlers
+ public GregtechRecipe_OLD(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutput, int aDuration, int aEUt) {
+ this(true, new ItemStack[]{aInput}, aOutput.clone(), null, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0);
+ if (mInputs.length > 0 && mOutputs[0] != null) {
+ Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(this);
+ }
+ }
+
+ /*public GregtechRecipe_OLD(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutput, int aDuration, int aEUt) {
+ this(true, new ItemStack[]{aInput}, aOutput.clone(), null, null, new FluidStack[]{aFluid}, null, aDuration, aEUt, 0);
+ if (mInputs.length > 0 && mOutputs[0] != null) {
+ Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(this);
+ }
+ }*/
+
+
+ public static void reInit() {
+ GT_Log.out.println("GT_Mod: Re-Unificating Recipes.");
+ for (Gregtech_Recipe_Map tMapEntry : Gregtech_Recipe_Map.sMappings) tMapEntry.reInit();
+ }
+
+ public ItemStack getRepresentativeInput(int aIndex) {
+ if (aIndex < 0 || aIndex >= mInputs.length) return null;
+ return GT_Utility.copy(mInputs[aIndex]);
+ }
+
+ public ItemStack getOutput(int aIndex) {
+ if (aIndex < 0 || aIndex >= mOutputs.length) return null;
+ return GT_Utility.copy(mOutputs[aIndex]);
+ }
+
+ public int getOutputChance(int aIndex) {
+ if (aIndex < 0 || aIndex >= mChances.length) return 10000;
+ return mChances[aIndex];
+ }
+
+ public FluidStack getRepresentativeFluidInput(int aIndex) {
+ if (aIndex < 0 || aIndex >= mFluidInputs.length || mFluidInputs[aIndex] == null) return null;
+ return mFluidInputs[aIndex].copy();
+ }
+
+ public FluidStack getFluidOutput(int aIndex) {
+ if (aIndex < 0 || aIndex >= mFluidOutputs.length || mFluidOutputs[aIndex] == null) return null;
+ return mFluidOutputs[aIndex].copy();
+ }
+
+ public GregtechRecipe_OLD copy() {
+ return new GregtechRecipe_OLD(this);
+ }
+
+ public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, FluidStack[] aFluidInputs, ItemStack... aInputs) {
+ return isRecipeInputEqual(aDecreaseStacksizeBySuccess, false, aFluidInputs, aInputs);
+ }
+
+ public boolean isRecipeInputEqual(boolean aDecreaseStacksizeBySuccess, boolean aDontCheckStackSizes, FluidStack[] aFluidInputs, ItemStack... aInputs) {
+ if (mFluidInputs.length > 0 && aFluidInputs == null) return false;
+ for (FluidStack tFluid : mFluidInputs)
+ if (tFluid != null) {
+ boolean temp = true;
+ for (FluidStack aFluid : aFluidInputs)
+ if (aFluid != null && aFluid.isFluidEqual(tFluid) && (aDontCheckStackSizes || aFluid.amount >= tFluid.amount)) {
+ temp = false;
+ break;
+ }
+ if (temp) return false;
+ }
+
+ if (mInputs.length > 0 && aInputs == null) return false;
+
+ for (ItemStack tStack : mInputs)
+ if (tStack != null) {
+ boolean temp = true;
+ for (ItemStack aStack : aInputs)
+ if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true)) && (aDontCheckStackSizes || aStack.stackSize >= tStack.stackSize)) {
+ temp = false;
+ break;
+ }
+ if (temp) return false;
+ }
+
+ if (aDecreaseStacksizeBySuccess) {
+ if (aFluidInputs != null) {
+ for (FluidStack tFluid : mFluidInputs)
+ if (tFluid != null) {
+ for (FluidStack aFluid : aFluidInputs)
+ if (aFluid != null && aFluid.isFluidEqual(tFluid) && (aDontCheckStackSizes || aFluid.amount >= tFluid.amount)) {
+ aFluid.amount -= tFluid.amount;
+ break;
+ }
+ }
+ }
+
+ if (aInputs != null) {
+ for (ItemStack tStack : mInputs)
+ if (tStack != null) {
+ for (ItemStack aStack : aInputs)
+ if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true)) && (aDontCheckStackSizes || aStack.stackSize >= tStack.stackSize)) {
+ aStack.stackSize -= tStack.stackSize;
+ break;
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+
+ public static class Gregtech_Recipe_Map {
+ /**
+ * Contains all Recipe Maps
+ */
+ public static final Collection<Gregtech_Recipe_Map> sMappings = new ArrayList<Gregtech_Recipe_Map>();
+ //public static final GT_Recipe_Map sChemicalBathRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.chemicalbath", "Chemical Bath", null, RES_PATH_GUI + "basicmachines/ChemicalBath", 1, 3, 1, 1, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sCokeOvenRecipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.cokeoven", "Coke Oven", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 2, 1, 0, 1, E, 1, E, true, true);
+ public static final GT_Recipe_Map sMatterFab2Recipes = new GT_Recipe_Map(new HashSet<GT_Recipe>(200), "gt.recipe.matterfab2", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, E, 1, E, true, true);
+ //public static final Gregtech_Recipe_Map sMatterFabRecipes = new Gregtech_Recipe_Map(new HashSet<GregtechRecipe_OLD>(200), "gt.recipe.matterfab", "Matter Fabricator", null, RES_PATH_GUI + "basicmachines/Massfabricator", 1, 3, 1, 1, 1, E, 1, E, true, true);
+ public static final Gregtech_Recipe_Map_Fuel sRocketFuels = new Gregtech_Recipe_Map_Fuel(new HashSet<GregtechRecipe_OLD>(10), "gt.recipe.rocketenginefuel", "Rocket Engine Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 3000, " EU", true, true);
+ public static final Gregtech_Recipe_Map_Fuel sGeoThermalFuels = new Gregtech_Recipe_Map_Fuel(new HashSet<GregtechRecipe_OLD>(10), "gt.recipe.geothermalfuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true);
+ public static final Gregtech_Recipe_Map sChemicalDehydratorRecipes = new Gregtech_Recipe_Map(new HashSet<GregtechRecipe_OLD>(200), "gt.recipe.chemicaldehydrator", "Chemical Dehydrator", null, RES_PATH_GUI + "basicmachines/Dehydrator", 1, 1, 0, 0, 1, E, 1, E, true, true);
+
+ /**
+ * HashMap of Recipes based on their Items
+ */
+ public final Map<GT_ItemStack, Collection<GregtechRecipe_OLD>> mRecipeItemMap = new HashMap<GT_ItemStack, Collection<GregtechRecipe_OLD>>();
+ /**
+ * HashMap of Recipes based on their Fluids
+ */
+ public final Map<Fluid, Collection<GregtechRecipe_OLD>> mRecipeFluidMap = new HashMap<Fluid, Collection<GregtechRecipe_OLD>>();
+ /**
+ * The List of all Recipes
+ */
+ public final Collection<GregtechRecipe_OLD> mRecipeList;
+ /**
+ * String used as an unlocalised Name.
+ */
+ public final String mUnlocalizedName;
+ /**
+ * String used in NEI for the Recipe Lists. If null it will use the unlocalised Name instead
+ */
+ public final String mNEIName;
+ /**
+ * GUI used for NEI Display. Usually the GUI of the Machine itself
+ */
+ public final String mNEIGUIPath;
+ public final String mNEISpecialValuePre, mNEISpecialValuePost;
+ public final int mUsualInputCount, mUsualOutputCount, mNEISpecialValueMultiplier, mMinimalInputItems, mMinimalInputFluids, mAmperage;
+ public final boolean mNEIAllowed, mShowVoltageAmperageInNEI;
+
+ /**
+ * Initialises a new type of Recipe Handler.
+ *
+ * @param aRecipeList a List you specify as Recipe List. Usually just an ArrayList with a pre-initialised Size.
+ * @param aUnlocalizedName the unlocalised Name of this Recipe Handler, used mainly for NEI.
+ * @param aLocalName the displayed Name inside the NEI Recipe GUI.
+ * @param aNEIGUIPath the displayed GUI Texture, usually just a Machine GUI. Auto-Attaches ".png" if forgotten.
+ * @param aUsualInputCount the usual amount of Input Slots this Recipe Class has.
+ * @param aUsualOutputCount the usual amount of Output Slots this Recipe Class has.
+ * @param aNEISpecialValuePre the String in front of the Special Value in NEI.
+ * @param aNEISpecialValueMultiplier the Value the Special Value is getting Multiplied with before displaying
+ * @param aNEISpecialValuePost the String after the Special Value. Usually for a Unit or something.
+ * @param aNEIAllowed if NEI is allowed to display this Recipe Handler in general.
+ */
+ public Gregtech_Recipe_Map(Collection<GregtechRecipe_OLD> aRecipeList,
+ String aUnlocalizedName, String aLocalName, String aNEIName,
+ String aNEIGUIPath, int aUsualInputCount,
+ int aUsualOutputCount, int aMinimalInputItems,
+ int aMinimalInputFluids, int aAmperage,
+ String aNEISpecialValuePre, int aNEISpecialValueMultiplier,
+ String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI,
+ boolean aNEIAllowed) {
+ sMappings.add(this);
+ mNEIAllowed = aNEIAllowed;
+ mShowVoltageAmperageInNEI = aShowVoltageAmperageInNEI;
+ mRecipeList = aRecipeList;
+ mNEIName = aNEIName == null ? aUnlocalizedName : aNEIName;
+ mNEIGUIPath = aNEIGUIPath.endsWith(".png") ? aNEIGUIPath : aNEIGUIPath + ".png";
+ mNEISpecialValuePre = aNEISpecialValuePre;
+ mNEISpecialValueMultiplier = aNEISpecialValueMultiplier;
+ mNEISpecialValuePost = aNEISpecialValuePost;
+ mAmperage = aAmperage;
+ mUsualInputCount = aUsualInputCount;
+ mUsualOutputCount = aUsualOutputCount;
+ mMinimalInputItems = aMinimalInputItems;
+ mMinimalInputFluids = aMinimalInputFluids;
+ GregTech_API.sFluidMappings.add(mRecipeFluidMap);
+ GregTech_API.sItemStackMappings.add(mRecipeItemMap);
+ GT_LanguageManager.addStringLocalization(mUnlocalizedName = aUnlocalizedName, aLocalName);
+ }
+
+ public GregtechRecipe_OLD addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GregtechRecipe_OLD(aOptimize, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ public GregtechRecipe_OLD addRecipe(int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GregtechRecipe_OLD(false, null, null, null, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue), false, false, false);
+ }
+
+ public GregtechRecipe_OLD addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GregtechRecipe_OLD(aOptimize, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ public GregtechRecipe_OLD addRecipe(boolean aOptimize, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GregtechRecipe_OLD(aOptimize, null, null, null, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ /*public GregtechRecipe_OLD addRecipe(boolean aOptimize, FluidStack aInput1, FluidStack aOutput1, ItemStack[] bInput1, ItemStack[] bOutput1, int aDuration, int aEUt, int aSpecialValue) {
+ return addRecipe(new GregtechRecipe_OLD(aOptimize, aInput1, aOutput1, bInput1,bOutput1, aDuration, aEUt, aSpecialValue));
+
+ }*/
+
+ public GregtechRecipe_OLD addRecipe(GregtechRecipe_OLD aRecipe) {
+ Utils.LOG_INFO("Adding Recipe Method 1");
+ return addRecipe(aRecipe, true, false, false);
+ }
+
+ protected GregtechRecipe_OLD addRecipe(GregtechRecipe_OLD aRecipe, boolean aCheckForCollisions, boolean aFakeRecipe, boolean aHidden) {
+ Utils.LOG_INFO("Adding Recipe Method 2 - This Checks if hidden, fake or if duplicate recipes exists, I think.");
+ aRecipe.mHidden = aHidden;
+ aRecipe.mFakeRecipe = aFakeRecipe;
+ Utils.LOG_INFO("Logging some data about this method: GregtechRecipe_OLD["+aRecipe.toString()+"] | aCheckForCollisions["+aCheckForCollisions+"] | aFakeRecipe["+aFakeRecipe+"] | aHidden["+aHidden+"]");
+ Utils.LOG_INFO("Logging some data about this method: mMinimalInputFluids["+mMinimalInputFluids+"] | mMinimalInputItems["+mMinimalInputItems+"] | aRecipe.mFluidInputs.length["+aRecipe.mFluidInputs.length+"] | aRecipe.mInputs.length["+aRecipe.mInputs.length+"]");
+ if (aRecipe.mFluidInputs.length < mMinimalInputFluids && aRecipe.mInputs.length < mMinimalInputItems){
+ Utils.LOG_INFO("Step 2 failed");
+ return null;}
+
+ Utils.LOG_INFO("Logging some data about this method: aCheckForCollisions["+aCheckForCollisions+"] | findRecipe != null ["+(findRecipe(null, false, Long.MAX_VALUE, aRecipe.mFluidInputs, aRecipe.mInputs) != null)+"]");
+ if (aCheckForCollisions && findRecipe(null, false, Long.MAX_VALUE, aRecipe.mFluidInputs, aRecipe.mInputs) != null){
+ Utils.LOG_INFO("Step 2 failed - 2");
+ return null;
+ }
+ return add(aRecipe);
+ }
+
+
+
+ /**
+ * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
+ */
+ public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addFakeRecipe(aCheckForCollisions, new GregtechRecipe_OLD(false, aInputs, aOutputs, aSpecial, aOutputChances, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ /**
+ * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
+ */
+ public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return addFakeRecipe(aCheckForCollisions, new GregtechRecipe_OLD(false, aInputs, aOutputs, aSpecial, null, aFluidInputs, aFluidOutputs, aDuration, aEUt, aSpecialValue));
+ }
+
+ /**
+ * Only used for fake Recipe Handlers to show something in NEI, do not use this for adding actual Recipes! findRecipe wont find fake Recipes, containsInput WILL find fake Recipes
+ */
+ public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, GregtechRecipe_OLD aRecipe) {
+ return addRecipe(aRecipe, aCheckForCollisions, true, false);
+ }
+
+ public GregtechRecipe_OLD add(GregtechRecipe_OLD aRecipe) {
+ Utils.LOG_INFO("Adding Recipe Method 3");
+ mRecipeList.add(aRecipe);
+ for (FluidStack aFluid : aRecipe.mFluidInputs)
+ if (aFluid != null) {
+ Utils.LOG_INFO("Fluid is valid - getting some kind of fluid instance to add to the recipe hashmap.");
+ Collection<GregtechRecipe_OLD> tList = mRecipeFluidMap.get(aFluid.getFluid());
+ if (tList == null) mRecipeFluidMap.put(aFluid.getFluid(), tList = new HashSet<GregtechRecipe_OLD>(1));
+ tList.add(aRecipe);
+ }
+ return addToItemMap(aRecipe);
+ }
+
+ public void reInit() {
+ Map<GT_ItemStack, Collection<GregtechRecipe_OLD>> tMap = mRecipeItemMap;
+ if (tMap != null) tMap.clear();
+ for (GregtechRecipe_OLD tRecipe : mRecipeList) {
+ GT_OreDictUnificator.setStackArray(true, tRecipe.mInputs);
+ GT_OreDictUnificator.setStackArray(true, tRecipe.mOutputs);
+ if (tMap != null) addToItemMap(tRecipe);
+ }
+ }
+
+ /**
+ * @return if this Item is a valid Input for any for the Recipes
+ */
+ public boolean containsInput(ItemStack aStack) {
+ return aStack != null && (mRecipeItemMap.containsKey(new GT_ItemStack(aStack)) || mRecipeItemMap.containsKey(new GT_ItemStack(GT_Utility.copyMetaData(W, aStack))));
+ }
+
+ /**
+ * @return if this Fluid is a valid Input for any for the Recipes
+ */
+ public boolean containsInput(FluidStack aFluid) {
+ return aFluid != null && containsInput(aFluid.getFluid());
+ }
+
+ /**
+ * @return if this Fluid is a valid Input for any for the Recipes
+ */
+ public boolean containsInput(Fluid aFluid) {
+ return aFluid != null && mRecipeFluidMap.containsKey(aFluid);
+ }
+
+ public GregtechRecipe_OLD findRecipe(IHasWorldObjectAndCoords aTileEntity, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
+ return findRecipe(aTileEntity, null, aNotUnificated, aVoltage, aFluids, null, aInputs);
+ }
+
+ public GregtechRecipe_OLD findRecipe(IHasWorldObjectAndCoords aTileEntity, GregtechRecipe_OLD aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack... aInputs) {
+ return findRecipe(aTileEntity, aRecipe, aNotUnificated, aVoltage, aFluids, null, aInputs);
+ }
+
+ /**
+ * finds a Recipe matching the aFluid and ItemStack Inputs.
+ *
+ * @param aTileEntity an Object representing the current coordinates of the executing Block/Entity/Whatever. This may be null, especially during Startup.
+ * @param aRecipe in case this is != null it will try to use this Recipe first when looking things up.
+ * @param aNotUnificated if this is T the Recipe searcher will unificate the ItemStack Inputs
+ * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage
+ * @param aFluids the Fluid Inputs
+ * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with this, but some custom ones do.
+ * @param aInputs the Item Inputs
+ * @return the Recipe it has found or null for no matching Recipe
+ */
+ public GregtechRecipe_OLD findRecipe(IHasWorldObjectAndCoords aTileEntity, GregtechRecipe_OLD aRecipe, boolean aNotUnificated, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) {
+ // No Recipes? Well, nothing to be found then.
+ if (mRecipeList.isEmpty()) return null;
+
+ // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 Stack" or "at least 2 Stacks" before they start searching for Recipes.
+ // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in their Machines to select Sub Recipes.
+ if (GregTech_API.sPostloadFinished) {
+ if (mMinimalInputFluids > 0) {
+ if (aFluids == null) return null;
+ int tAmount = 0;
+ for (FluidStack aFluid : aFluids) if (aFluid != null) tAmount++;
+ if (tAmount < mMinimalInputFluids) return null;
+ }
+ if (mMinimalInputItems > 0) {
+ if (aInputs == null) return null;
+ int tAmount = 0;
+ for (ItemStack aInput : aInputs) if (aInput != null) tAmount++;
+ if (tAmount < mMinimalInputItems) return null;
+ }
+ }
+
+ // Unification happens here in case the Input isn't already unificated.
+ if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs);
+
+ // Check the Recipe which has been used last time in order to not have to search for it again, if possible.
+ if (aRecipe != null)
+ if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null;
+
+ // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items.
+ if (mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs)
+ if (tStack != null) {
+ Collection<GregtechRecipe_OLD>
+ tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack));
+ if (tRecipes != null) for (GregtechRecipe_OLD tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, tStack)));
+ if (tRecipes != null) for (GregtechRecipe_OLD tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ }
+
+ // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that Map too.
+ if (mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids)
+ if (aFluid != null) {
+ Collection<GregtechRecipe_OLD>
+ tRecipes = mRecipeFluidMap.get(aFluid.getFluid());
+ if (tRecipes != null) for (GregtechRecipe_OLD tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ }
+
+ // And nothing has been found.
+ return null;
+ }
+
+ protected GregtechRecipe_OLD addToItemMap(GregtechRecipe_OLD aRecipe) {
+ Utils.LOG_INFO("Adding Recipe Method 4");
+ for (ItemStack aStack : aRecipe.mInputs)
+ if (aStack != null) {
+ Utils.LOG_INFO("Method 4 - Manipulating "+aStack.getDisplayName());
+ GT_ItemStack tStack = new GT_ItemStack(aStack);
+ Utils.LOG_INFO("Method 4 - Made gt stack of item "+tStack.toStack().getDisplayName());
+ Collection<GregtechRecipe_OLD> tList = mRecipeItemMap.get(tStack);
+ if (tList != null){
+ Utils.LOG_INFO("Method 4 - Gt Recipe Hashmap: "+tList.toString());
+ }
+ if (tList == null){
+ Utils.LOG_INFO("Method 4 - brrr list was NUll");
+ mRecipeItemMap.put(tStack, tList = new HashSet<GregtechRecipe_OLD>(1));
+ Utils.LOG_INFO("Method 4 - Attemping backup method for Gt Recipe Hashmap:");
+
+ while (tList.iterator().hasNext()){
+ Utils.LOG_INFO(tList.iterator().next().toString());
+ }
+
+ }
+ tList.add(aRecipe);
+ Utils.LOG_INFO("Method 4 - Added recipe to map? I think.");
+ }
+ return aRecipe;
+ }
+
+ public GregtechRecipe_OLD findRecipe(IGregTechTileEntity baseMetaTileEntity, GregtechRecipe_OLD aRecipe, boolean aNotUnificated,
+ long aVoltage, FluidStack[] aFluids, FluidStack[] fluidStacks) {
+
+ ItemStack aInputs[] = null;
+ // No Recipes? Well, nothing to be found then.
+ if (mRecipeList.isEmpty()) return null;
+
+ // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 Stack" or "at least 2 Stacks" before they start searching for Recipes.
+ // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in their Machines to select Sub Recipes.
+ if (GregTech_API.sPostloadFinished) {
+ if (mMinimalInputFluids > 0) {
+ if (aFluids == null) return null;
+ int tAmount = 0;
+ for (FluidStack aFluid : aFluids) if (aFluid != null) tAmount++;
+ if (tAmount < mMinimalInputFluids) return null;
+ }
+ if (mMinimalInputItems > 0) {
+ if (aInputs == null) return null;
+ int tAmount = 0;
+ for (ItemStack aInput : aInputs) if (aInput != null) tAmount++;
+ if (tAmount < mMinimalInputItems) return null;
+ }
+ }
+
+ // Unification happens here in case the Input isn't already unificated.
+ if (aNotUnificated) aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs);
+
+ // Check the Recipe which has been used last time in order to not have to search for it again, if possible.
+ if (aRecipe != null)
+ if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return aRecipe.mEnabled && aVoltage * mAmperage >= aRecipe.mEUt ? aRecipe : null;
+
+ // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items.
+ if (mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs)
+ if (tStack != null) {
+ Collection<GregtechRecipe_OLD>
+ tRecipes = mRecipeItemMap.get(new GT_ItemStack(tStack));
+ if (tRecipes != null) for (GregtechRecipe_OLD tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ tRecipes = mRecipeItemMap.get(new GT_ItemStack(GT_Utility.copyMetaData(W, tStack)));
+ if (tRecipes != null) for (GregtechRecipe_OLD tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ }
+
+ // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that Map too.
+ if (mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids)
+ if (aFluid != null) {
+ Collection<GregtechRecipe_OLD>
+ tRecipes = mRecipeFluidMap.get(aFluid.getFluid());
+ if (tRecipes != null) for (GregtechRecipe_OLD tRecipe : tRecipes)
+ if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, true, aFluids, aInputs))
+ return tRecipe.mEnabled && aVoltage * mAmperage >= tRecipe.mEUt ? tRecipe : null;
+ }
+
+ // And nothing has been found.
+ return null;
+ }
+ }
+
+ // -----------------------------------------------------------------------------------------------------------------
+ // Here are a few Classes I use for Special Cases in some Machines without having to write a separate Machine Class.
+ // -----------------------------------------------------------------------------------------------------------------
+
+ /**
+ * Abstract Class for general Recipe Handling of non GT Recipes
+ */
+ public static abstract class GT_Recipe_Map_NonGTRecipes extends Gregtech_Recipe_Map {
+ public GT_Recipe_Map_NonGTRecipes(Collection<GregtechRecipe_OLD> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ @Override
+ public boolean containsInput(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public boolean containsInput(FluidStack aFluid) {
+ return false;
+ }
+
+ @Override
+ public boolean containsInput(Fluid aFluid) {
+ return false;
+ }
+
+ @Override
+ public GregtechRecipe_OLD addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return null;
+ }
+
+ @Override
+ public GregtechRecipe_OLD addRecipe(boolean aOptimize, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return null;
+ }
+
+ @Override
+ public GregtechRecipe_OLD addRecipe(GregtechRecipe_OLD aRecipe) {
+ return null;
+ }
+
+ @Override
+ public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, int[] aOutputChances, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return null;
+ }
+
+ @Override
+ public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, ItemStack[] aInputs, ItemStack[] aOutputs, Object aSpecial, FluidStack[] aFluidInputs, FluidStack[] aFluidOutputs, int aDuration, int aEUt, int aSpecialValue) {
+ return null;
+ }
+
+ @Override
+ public GregtechRecipe_OLD addFakeRecipe(boolean aCheckForCollisions, GregtechRecipe_OLD aRecipe) {
+ return null;
+ }
+
+ @Override
+ public GregtechRecipe_OLD add(GregtechRecipe_OLD aRecipe) {
+ return null;
+ }
+
+ @Override
+ public void reInit() {/**/}
+
+ @Override
+ protected GregtechRecipe_OLD addToItemMap(GregtechRecipe_OLD aRecipe) {
+ return null;
+ }
+ }
+
+ /**
+ * Just a Recipe Map with Utility specifically for Fuels.
+ */
+ public static class Gregtech_Recipe_Map_Fuel extends Gregtech_Recipe_Map {
+ public Gregtech_Recipe_Map_Fuel(Collection<GregtechRecipe_OLD> aRecipeList, String aUnlocalizedName, String aLocalName, String aNEIName, String aNEIGUIPath, int aUsualInputCount, int aUsualOutputCount, int aMinimalInputItems, int aMinimalInputFluids, int aAmperage, String aNEISpecialValuePre, int aNEISpecialValueMultiplier, String aNEISpecialValuePost, boolean aShowVoltageAmperageInNEI, boolean aNEIAllowed) {
+ super(aRecipeList, aUnlocalizedName, aLocalName, aNEIName, aNEIGUIPath, aUsualInputCount, aUsualOutputCount, aMinimalInputItems, aMinimalInputFluids, aAmperage, aNEISpecialValuePre, aNEISpecialValueMultiplier, aNEISpecialValuePost, aShowVoltageAmperageInNEI, aNEIAllowed);
+ }
+
+ public GregtechRecipe_OLD addFuel(ItemStack aInput, ItemStack aOutput, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 1");
+ return addFuel(aInput, aOutput, null, null, 10000, aFuelValueInEU);
+ }
+
+ public GregtechRecipe_OLD addFuel(ItemStack aInput, ItemStack aOutput, int aChance, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 2");
+ return addFuel(aInput, aOutput, null, null, aChance, aFuelValueInEU);
+ }
+
+ public GregtechRecipe_OLD addFuel(FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 3");
+ return addFuel(null, null, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
+ }
+
+ public GregtechRecipe_OLD addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 4");
+ return addFuel(aInput, aOutput, aFluidInput, aFluidOutput, 10000, aFuelValueInEU);
+ }
+
+ public GregtechRecipe_OLD addFuel(ItemStack aInput, ItemStack aOutput, FluidStack aFluidInput, FluidStack aFluidOutput, int aChance, int aFuelValueInEU) {
+ Utils.LOG_INFO("Adding Fuel using method 5");
+ return addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, null, new int[]{aChance}, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, 0, 0, aFuelValueInEU);
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
new file mode 100644
index 0000000000..64f612ad61
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java
@@ -0,0 +1,429 @@
+package gtPlusPlus.xmod.gregtech.common;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_Log;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gregtech.common.GT_Proxy.OreDictEventContainer;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import gtPlusPlus.xmod.gregtech.api.objects.GregtechFluid;
+import gtPlusPlus.xmod.gregtech.api.util.GregtechOreDictUnificator;
+import gtPlusPlus.xmod.gregtech.api.util.GregtechRecipeRegistrator;
+import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidContainerRegistry;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.oredict.OreDictionary;
+import cpw.mods.fml.common.Loader;
+import cpw.mods.fml.common.ModContainer;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+
+public class Meta_GT_Proxy {
+
+ //Silly Vars
+ private static final Collection<String> mIgnoredItems = new HashSet(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(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(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(10000);
+ public final static Collection<GregtechOreDictEventContainer> mEvents = new HashSet();
+
+ 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 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;
+ }
+
+ @SubscribeEvent
+ public static void registerOre(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)) {
+ 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 (aOriginalMod.equals(CORE.MODID)) {
+ aOriginalMod = "UNKNOWN";
+ }
+ 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
+ + " 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 ((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)) {
+ GregtechOreDictUnificator.addToBlacklist(aEvent.Ore);
+ }
+ 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("$"))) {
+ 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}));
+ aEvent.Ore.setStackDisplayName("Invalid OreDictionary Tag");
+ return;
+ }
+ if (mInvalidNames.contains(aEvent.Name)) {
+ GT_Log.ore.println(tModToName + " is wrongly registered and therefor getting ignored.");
+
+ return;
+ }
+ 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.");
+ return;
+ }
+ if (aEvent.Name.toUpperCase().equals(aEvent.Name)) {
+ GT_Log.ore.println(tModToName + " is invalid due to being solely uppercased.");
+ return;
+ }
+ if (Character.isUpperCase(aEvent.Name.charAt(0))) {
+ GT_Log.ore.println(tModToName + " is invalid due to the first character being uppercased.");
+ }
+ } else {
+ if (aPrefix.mDontUnificateActively) {
+ GregtechOreDictUnificator.addToBlacklist(aEvent.Ore);
+ }
+ if (aPrefix != aPrefix.mPrefixInto) {
+ 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);
+ }
+ GregtechOreDictUnificator.registerOre(tNewName, aEvent.Ore);
+ return;
+ }
+ String tName = aEvent.Name.replaceFirst(aPrefix.toString(), "");
+ if (tName.length() > 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));
+ }
+ return;
+ }
+ if (!aPrefix.isIgnored(aMaterial)) {
+ aPrefix.add(GT_Utility.copyAmount(1L, new Object[]{aEvent.Ore}));
+ }
+ if (aMaterial != GT_Materials._NULL) {
+ GT_Materials tReRegisteredMaterial;
+ 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;
+ }
+ if (aPrefix.mIsUnificatable && !aMaterial.mUnificatable) {
+ return;
+ }
+ } 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.");
+ 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.");
+ return;
+ }
+ } 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 {
+ 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);
+ GregtechOreDictEventContainer tOre = new GregtechOreDictEventContainer(aEvent, aPrefix, aMaterial, aMod);
+ if ((!mOreDictActivated) || (!GregTech_API.sUnificationEntriesRegistered)) {
+ mEvents.add(tOre);
+ } else {
+ mEvents.clear();
+ }
+ if (mOreDictActivated) {
+ registerRecipes(tOre);
+ }
+ } catch (Throwable e) {
+ e.printStackTrace(GT_Log.err);
+ }
+ }
+
+ private static final void registerRecipes(GregtechOreDictEventContainer tOre) {
+ if ((tOre.mEvent.Ore == null) || (tOre.mEvent.Ore.getItem() == null)) {
+ return;
+ }
+ if (tOre.mEvent.Ore.stackSize != 1) {
+ tOre.mEvent.Ore.stackSize = 1;
+ }
+ if (tOre.mPrefix != null) {
+ if (!tOre.mPrefix.isIgnored(tOre.mMaterial)) {
+ 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.");
+ }
+ }
+
+ private static final void registerRecipes(OreDictEventContainer aOre) {
+ if ((aOre.mEvent.Ore == null) || (aOre.mEvent.Ore.getItem() == null)) {
+ return;
+ }
+ if (aOre.mEvent.Ore.stackSize != 1) {
+ aOre.mEvent.Ore.stackSize = 1;
+ }
+ 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}));
+ }
+ } 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 (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 {
+ 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);
+ }
+ }
+ }
+ 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 {
+ 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);
+ }
+ }
+ }
+ GregTech_API.sUnificationEntriesRegistered = true;
+ GregTech_API.sUnification.mConfig.save();
+ GT_Recipe.reInit();
+ }
+
+ public static void activateOreDictHandler() {
+ mOreDictActivated = true;
+ GregtechOreDictEventContainer tEvent;
+ for (Iterator i$ = mEvents.iterator(); i$.hasNext(); registerRecipes(tEvent)) {
+ tEvent = (GregtechOreDictEventContainer) 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;
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
new file mode 100644
index 0000000000..7bd49b1ccd
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks.java
@@ -0,0 +1,76 @@
+package gtPlusPlus.xmod.gregtech.common.blocks;
+
+import gregtech.api.enums.Textures;
+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 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;
+
+ 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[GTID + i] = new GT_CopiedBlockTexture(this, 6, i);
+ }
+ 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", "Unused Casing");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".12.name", "Reactor Casing Tier I");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".13.name", "Reactor Casing Tier II");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".14.name", "Unused Coil Block");
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".15.name", "Unused Coil 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));
+ GregtechItemList.Casing_CokeOven_Coil2.set(new ItemStack(this, 1, 3));
+ GregtechItemList.Casing_MaterialPress.set(new ItemStack(this, 1, 4));
+ GregtechItemList.Casing_Electrolyzer.set(new ItemStack(this, 1, 5));
+ GregtechItemList.Casing_WireFactory.set(new ItemStack(this, 1, 6));
+ GregtechItemList.Casing_MacerationStack.set(new ItemStack(this, 1, 7));
+ GregtechItemList.Casing_MatterGen.set(new ItemStack(this, 1, 8));
+ GregtechItemList.Casing_MatterFab.set(new ItemStack(this, 1, 9));
+ GregtechItemList.Casing_IronPlatedBricks.set(new ItemStack(this, 1, 10));
+ GregtechItemList.Casing_U7.set(new ItemStack(this, 1, 11));
+ GregtechItemList.Casing_Reactor_I.set(new ItemStack(this, 1, 12));
+ GregtechItemList.Casing_Reactor_II.set(new ItemStack(this, 1, 13));
+ GregtechItemList.Casing_Coil_U3.set(new ItemStack(this, 1, 14));
+ GregtechItemList.Casing_Coil_U4.set(new ItemStack(this, 1, 15));
+ }
+
+ @Override
+ public IIcon getIcon(int aSide, int aMeta) { //Texture ID's. case 0 == ID[57]
+ return TextureHandler.getIcon(aSide, aMeta);
+ }
+
+
+
+ @Override
+ @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/GregtechMetaCasingBlocksAbstract.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java
new file mode 100644
index 0000000000..14ce2afc93
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocksAbstract.java
@@ -0,0 +1,143 @@
+package gtPlusPlus.xmod.gregtech.common.blocks;
+
+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;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EnumCreatureType;
+import net.minecraft.init.Blocks;
+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(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 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
+ public String getUnlocalizedName() {
+ return this.mUnlocalizedName;
+ }
+
+ @Override
+ public String getLocalizedName() {
+ return StatCollector.translateToLocal(this.mUnlocalizedName + ".name");
+ }
+
+ @Override
+ public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) {
+ return false;
+ }
+
+ @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 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(IIconRegister aIconRegister) {
+ }
+
+ @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
new file mode 100644
index 0000000000..1b9b571ef7
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingItems.java
@@ -0,0 +1,11 @@
+package gtPlusPlus.xmod.gregtech.common.blocks;
+
+import gregtech.common.blocks.GT_Item_Casings_Abstract;
+import net.minecraft.block.Block;
+
+public class GregtechMetaCasingItems
+ extends GT_Item_Casings_Abstract {
+ 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
new file mode 100644
index 0000000000..b2fd9e197a
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasings1.java
@@ -0,0 +1,33 @@
+package gtPlusPlus.xmod.gregtech.common.blocks;
+
+import java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+
+public class GregtechMetaItemCasings1
+extends GregtechMetaItemCasingsAbstract {
+ public GregtechMetaItemCasings1(Block par1) {
+ super(par1);
+ }
+
+ @Override
+ 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;
+ }
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java
new file mode 100644
index 0000000000..967121c312
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaItemCasingsAbstract.java
@@ -0,0 +1,45 @@
+package gtPlusPlus.xmod.gregtech.common.blocks;
+
+import gregtech.api.util.GT_LanguageManager;
+
+import java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+
+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!");
+
+ public GregtechMetaItemCasingsAbstract(Block par1) {
+ super(par1);
+ setMaxDamage(0);
+ setHasSubtypes(true);
+ //setCreativeTab(AddToCreativeTab.tabMachines);
+ }
+
+ @Override
+ public int getMetadata(int aMeta) {
+ return aMeta;
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack aStack) {
+ return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack);
+ }
+
+ @Override
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ super.addInformation(aStack, aPlayer, aList, aF3_H);
+ 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
new file mode 100644
index 0000000000..fbba69bf93
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/fluid/GregtechFluidHandler.java
@@ -0,0 +1,195 @@
+package gtPlusPlus.xmod.gregtech.common.blocks.fluid;
+
+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;
+import gtPlusPlus.core.util.fluid.FluidUtils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GregtechFluidHandler {
+
+ protected static int cellID = 0;
+
+ 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);
+ */
+
+ if (!LoadedMods.ThermalFoundation){
+
+ Utils.LOG_INFO("Adding in our own GT versions of Thermal Foundation Fluids");
+ Meta_GT_Proxy.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);
+ Meta_GT_Proxy.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.");
+
+ Meta_GT_Proxy.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");
+
+ Meta_GT_Proxy.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");
+
+ Meta_GT_Proxy.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 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");
+
+ Meta_GT_Proxy.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");
+
+ Meta_GT_Proxy.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");
+
+ Meta_GT_Proxy.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");
+
+
+ //Check for IHL Hydrogen Chloride
+ if (!LoadedMods.IHL || UtilsItems.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.");
+ }
+ Meta_GT_Proxy.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");
+ }
+ }
+
+
+ Meta_GT_Proxy.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");
+
+ Meta_GT_Proxy.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(
+ UtilsItems.getItemStackOfAmountFromOreDict("dustApatite", 16),
+ null,
+ FluidUtils.getFluidStack("sulfuricacid", 133*32),
+ FluidUtils.getFluidStack("sulfuricapatite", 133*4),
+ UtilsItems.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(
+ UtilsItems.getItemStackOfAmountFromOreDict("cellOxygen", 1),
+ UtilsItems.getItemStackOfAmountFromOreDict("dustLithium", 16),
+ FluidUtils.getFluidStack("water", 1000),
+ FluidUtils.getFluidStack("lithiumhydroxide", 133*4),
+ null,
+ 300*20);
+
+
+
+
+
+
+
+
+ //Mixer Recipes
+ GT_Values.RA.addMixerRecipe(UtilsItems.getItemStackOfAmountFromOreDict("dustSulfur", 1), null, null, null, FluidUtils.getFluidStack("oxygen", 266), FluidUtils.getFluidStack("sulfurdioxide", 399), null, 600, 60);
+ GT_Values.RA.addMixerRecipe(UtilsItems.getItemStackOfAmountFromOreDict("dustUranium235", 1), UtilsItems.getItemStackOfAmountFromOreDict("dustUranium235", 1), null, null, FluidUtils.getFluidStack("hydrofluoricacid", 2000), FluidUtils.getFluidStack("uraniumtetrafluoride", 266), null, 3000, 500);
+ GT_Values.RA.addMixerRecipe(UtilsItems.getItemStackOfAmountFromOreDict("cellFluorine", 1), UtilsItems.getItemStackOfAmountFromOreDict("cellFluorine", 1), null, null, FluidUtils.getFluidStack("uraniumtetrafluoride", 665), FluidUtils.getFluidStack("uraniumhexafluoride", 266), null, 5000, 2000);
+
+
+
+
+
+
+
+ //Apatite Distillation
+ /*
+ * so if you dissolve aparite in sulphuric acid
+ * you'll get a mixture of SO2, H2O, HF and HCl
+ */
+
+ 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);
+
+ FluidStack[] sulfurousacidOutput = {
+ FluidUtils.getFluidStack("sulfurdioxide", 500),
+ FluidUtils.getFluidStack("water", 500)
+ };
+ GT_Values.RA.addDistillationTowerRecipe(
+ FluidUtils.getFluidStack("sulfurousacid", 1000),
+ sulfurousacidOutput,
+ null,
+ 10*20,
+ 60);
+
+ FluidStack[] sulfurdioxideOutput = {
+ FluidUtils.getFluidStack("oxygen", 133*2)
+ };
+ GT_Values.RA.addDistillationTowerRecipe(
+ FluidUtils.getFluidStack("sulfurdioxide", 133*3),
+ sulfurdioxideOutput,
+ UtilsItems.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
new file mode 100644
index 0000000000..1e7f3c157e
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/CasingTextureHandler.java
@@ -0,0 +1,73 @@
+package gtPlusPlus.xmod.gregtech.common.blocks.textures;
+
+import gregtech.api.enums.Textures;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+
+public class CasingTextureHandler {
+
+ private static final TexturesGregtech59 gregtech59 = new TexturesGregtech59();
+ private static final TexturesGregtech58 gregtech58 = new TexturesGregtech58();
+
+ 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 Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
+ //Coke Oven Frame
+ case 1:
+ return Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.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 Textures.BlockIcons.MACHINE_CASING_FUSION_2.getIcon();
+ //Broken Blue Fusion Casings
+ case 6:
+ return Textures.BlockIcons.MACHINE_CASING_FUSION.getIcon();
+ //Maceration Stack Casings
+ case 7:
+ return Textures.BlockIcons.MACHINE_LuV_BOTTOM.getIcon();
+ //Broken Pink Fusion Casings
+ case 8:
+ return Textures.BlockIcons.MACHINE_CASING_FUSION_2.getIcon();
+ //Matter Fabricator Casings
+ case 9:
+ return Textures.BlockIcons.MACHINE_CASING_DRAGONEGG.getIcon();
+ //Iron Blast Fuance Textures
+ case 10:
+ return Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL.getIcon();
+
+ //Reactor Casing I
+ case 12:
+ return Textures.BlockIcons.MACHINE_CASING_CLEAN_STAINLESSSTEEL.getIcon();
+ //Reactor Casing II
+ case 13:
+ return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon();
+
+ default:
+ return Textures.BlockIcons.MACHINE_CASING_RADIOACTIVEHAZARD.getIcon();
+
+ }
+ }
+ return Textures.BlockIcons.MACHINE_CASING_GEARBOX_TUNGSTENSTEEL.getIcon();
+ }
+
+
+ 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);
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java
new file mode 100644
index 0000000000..869df45989
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech58.java
@@ -0,0 +1,441 @@
+package gtPlusPlus.xmod.gregtech.common.blocks.textures;
+
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityIndustrialCentrifuge;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.IIcon;
+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 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 handleCasingsGT58(aWorld, xCoord, yCoord, zCoord, aSide, thisBlock);
+ }
+
+
+ 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);
+ }
+ 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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[2].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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ 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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[2].getIcon();
+ }
+ return TURBINE[2].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/TexturesGregtech59.java b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java
new file mode 100644
index 0000000000..c0b1e1ec4a
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGregtech59.java
@@ -0,0 +1,442 @@
+package gtPlusPlus.xmod.gregtech.common.blocks.textures;
+
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityIndustrialCentrifuge;
+import net.minecraft.tileentity.TileEntity;
+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);
+ }
+
+
+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);
+ }
+ 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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[2].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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ 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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[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 GregtechMetaTileEntityIndustrialCentrifuge))) {
+ if (((IGregTechTileEntity) tTileEntity).isActive()) {
+ return TURBINE_ACTIVE[2].getIcon();
+ }
+ return TURBINE[2].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/items/MetaGeneratedGregtechItems.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
new file mode 100644
index 0000000000..3946e93bbb
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java
@@ -0,0 +1,163 @@
+package gtPlusPlus.xmod.gregtech.common.items;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.GT_Values;
+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.GT_MultiTexture;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_FoodStat;
+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;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaItem_X32;
+import net.minecraft.item.EnumAction;
+import net.minecraft.util.EnumChatFormatting;
+
+public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 {
+ 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[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 1L)}));
+ GregtechItemList.Electric_Pump_ZPM.set(addItem(tLastID = 1, "Electric Pump (ZPM)", "655680 L/sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 2L)}));
+ GregtechItemList.Electric_Pump_UV.set(addItem(tLastID = 2, "Electric Pump (UV)", "2622720 L/sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.AQUA, 4L)}));
+ GregtechItemList.Electric_Pump_MAX.set(addItem(tLastID = 3, "Electric Pump (MAX)", "10490880 L/sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 8L), new TC_Aspects.TC_AspectStack(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[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L)}));
+ GregtechItemList.Electric_Motor_ZPM.set(addItem(tLastID = 5, "Electric Motor (ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L)}));
+ GregtechItemList.Electric_Motor_UV.set(addItem(tLastID = 6, "Electric Motor (UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L)}));
+ GregtechItemList.Electric_Motor_MAX.set(addItem(tLastID = 7, "Electric Motor (MAX)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(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[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 1L)}));
+ GregtechItemList.Conveyor_Module_ZPM.set(addItem(tLastID = 9, "Conveyor Module (ZPM)", "1 Stack every 5 secs (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ITER, 2L)}));
+ GregtechItemList.Conveyor_Module_UV.set(addItem(tLastID = 10, "Conveyor Module (UV)", "1 Stack every 1 sec (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(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[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(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[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L)}));
+ GregtechItemList.Electric_Piston_ZPM.set(addItem(tLastID = 13, "Electric Piston (ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L)}));
+ GregtechItemList.Electric_Piston_UV.set(addItem(tLastID = 14, "Electric Piston (UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L)}));
+ GregtechItemList.Electric_Piston_MAX.set(addItem(tLastID = 15, "Electric Piston (MAX)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(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[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 1L)}));
+ GregtechItemList.Robot_Arm_ZPM.set(addItem(tLastID = 17, "Robot Arm (ZPM)", "Inserts into specific Slots (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 2L)}));
+ GregtechItemList.Robot_Arm_UV.set(addItem(tLastID = 18, "Robot Arm (UV)", "Inserts into specific Slots (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.COGNITIO, 4L)}));
+ GregtechItemList.Robot_Arm_MAX.set(addItem(tLastID = 19, "Robot Arm (MAX)", "Inserts into specific Slots (as Cover)", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MOTUS, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.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[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L)}));
+ GregtechItemList.Field_Generator_ZPM.set(addItem(tLastID = 21, "Field Generator (ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 2L)}));
+ GregtechItemList.Field_Generator_UV.set(addItem(tLastID = 22, "Field Generator (UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L)}));
+ GregtechItemList.Field_Generator_MAX.set(addItem(tLastID = 23, "Field Generator (MAX)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(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[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 1L)}));
+ GregtechItemList.Emitter_ZPM.set(addItem(tLastID = 25, "Emitter (ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 2L)}));
+ GregtechItemList.Emitter_UV.set(addItem(tLastID = 26, "Emitter (UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 4L)}));
+ GregtechItemList.Emitter_MAX.set(addItem(tLastID = 27, "Emitter (MAX)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(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[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 1L)}));
+ GregtechItemList.Sensor_ZPM.set(addItem(tLastID = 29, "Sensor (ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 2L)}));
+ GregtechItemList.Sensor_UV.set(addItem(tLastID = 30, "Sensor (UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.SENSUS, 4L)}));
+ GregtechItemList.Sensor_MAX.set(addItem(tLastID = 31, "Sensor (MAX)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(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)});
+
+ }
+
+ 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]));
+
+
+ //FOOOOOOOOOOOOOOD
+ GregtechItemList.Food_Baked_Raisin_Bread.set(addItem(tLastID = 60, "Raisin Bread", "Extra Raisins, Just for "+EnumChatFormatting.DARK_PURPLE+"ImQ009", new Object[]{new GT_FoodStat(5, 0.5F, EnumAction.eat, null, false, true, false, new int[0]), new TC_Aspects.TC_AspectStack(TC_Aspects.CORPUS, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.FAMES, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.IGNIS, 1L)}));
+
+
+ //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[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 2L), new TC_Aspects.TC_AspectStack(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[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(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[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 3L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 3L), new TC_Aspects.TC_AspectStack(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[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(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[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.METALLUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.POTENTIA, 1L)}));
+ setElectricStats(32000 + tLastID, 5000000L, GT_Values.V[2], 4L, -3L, true);*/
+
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
new file mode 100644
index 0000000000..2ee00f99d4
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechTools.java
@@ -0,0 +1,39 @@
+package gtPlusPlus.xmod.gregtech.common.items;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.TC_Aspects;
+import gregtech.api.enums.ToolDictNames;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechToolDictNames;
+import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool;
+import gtPlusPlus.xmod.gregtech.common.tools.TOOL_Gregtech_Choocher;
+
+public class MetaGeneratedGregtechTools extends Gregtech_MetaTool {
+
+ public static final short TURBINE_SMALL = 10;
+ public static final short TURBINE = 12;
+ public static final short TURBINE_LARGE = 14;
+ public static final short HUGE_ITEM = 16;
+ public static final short TURBINE_BLADE = 18;
+
+ public static final short HARDHAMMER = 20;
+ public static final short SOFTHAMMER = 22;
+ public static final short WRENCH = 24;
+
+ public static MetaGeneratedGregtechTools INSTANCE;
+
+ public MetaGeneratedGregtechTools() {
+ super("MU-metaitem.02");
+ INSTANCE = this;
+
+ GregTech_API.registerTool(addTool(7734, "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);
+
+
+ //GregTech_API.registerTool(addTool(WRENCH, "Wrench", "Hold Leftclick to dismantle Machines", (Interface_ToolStats) new GT_Tool_Wrench(), new Object[]{ToolDictNames.craftingToolWrench, new TC_Aspects.TC_AspectStack(TC_Aspects.INSTRUMENTUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.ORDO, 2L)}), GregTech_API.sWrenchList);
+
+ //addTool(TURBINE_SMALL, "Small Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Small(), new Object[]{});
+ //addTool(TURBINE, "Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Normal(), new Object[]{});
+ //addTool(TURBINE_LARGE, "Large Turbine", "Turbine Rotors for your power station", new GT_Tool_Turbine_Large(), new Object[]{});
+ //addTool(HUGE_ITEM, "Huge Item", "Item 4 for your power station", new TOOL_Gregtech_MaxEfficiencyMultiBlockItem(), new Object[]{});
+
+ }
+}
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
new file mode 100644
index 0000000000..c2cadab478
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java
@@ -0,0 +1,144 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.generators;
+
+import gregtech.api.enums.Dyes;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.common.gui.GT_Container_Boiler;
+import gregtech.common.gui.GT_GUIContainer_Boiler;
+import gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.nbt.NBTTagCompound;
+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 {
+ 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(String aName, int aTier, String aDescription, 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;
+ }
+
+ 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];
+ }
+
+ public int maxProgresstime() {
+ return 500;
+ }
+
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 16000);
+ }
+
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png", 16000);
+ }
+
+ 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 void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ this.mRunTime = aNBT.getInteger("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/GregtechMetaTileEntityRocketFuelGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java
new file mode 100644
index 0000000000..20ebd611a2
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java
@@ -0,0 +1,119 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.generators;
+
+import gregtech.api.GregTech_API;
+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;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Recipe;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechRocketFuelGeneratorBase;
+import net.minecraft.item.ItemStack;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class GregtechMetaTileEntityRocketFuelGenerator
+ extends GregtechRocketFuelGeneratorBase {
+
+ public int mEfficiency;
+
+ public GregtechMetaTileEntityRocketFuelGenerator(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, "Requires liquid Fuel", new ITexture[0]);
+ onConfigLoad();
+ }
+
+ public GregtechMetaTileEntityRocketFuelGenerator(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 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 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;
+ }
+
+ @Override
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[]{super.getFront(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ }
+
+ @Override
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK)};
+ }
+
+ @Override
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BOTTOM)};
+ }
+
+ @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.DIESEL_GENERATOR_SIDE)};
+ }
+
+ @Override
+ public ITexture[] getFrontActive(byte aColor) {
+ return new ITexture[]{super.getFrontActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_FRONT_ACTIVE), Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]};
+ }
+
+ @Override
+ public ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.DIESEL_GENERATOR_BACK_ACTIVE)};
+ }
+
+ @Override
+ 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(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.DIESEL_GENERATOR_SIDE_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
new file mode 100644
index 0000000000..c41c1851fa
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java
@@ -0,0 +1,174 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.generators;
+
+import static gregtech.api.enums.GT_Values.V;
+import gregtech.api.GregTech_API;
+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;
+import gregtech.api.objects.GT_RenderedTexture;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_SolarGenerator;
+import gtPlusPlus.xmod.gregtech.api.gui.GUI_SolarGenerator;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.generators.GregtechMetaSolarGenerator;
+import net.minecraft.entity.player.InventoryPlayer;
+
+public class GregtechMetaTileEntitySolarGenerator extends GregtechMetaSolarGenerator {
+
+ 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]);
+ onConfigLoad();
+ }
+
+ public GregtechMetaTileEntitySolarGenerator(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 Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new CONTAINER_SolarGenerator(aPlayerInventory, aBaseMetaTileEntity, 16000);
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_SolarGenerator(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png", 16000);
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntitySolarGenerator(this.mName, this.mTier, this.mDescription, this.mTextures);
+ }
+
+ public void onConfigLoad() {
+ this.mEfficiency = GregTech_API.sMachineFile.get(ConfigCategories.machineconfig, "SunAbsorber.efficiency.tier." + this.mTier, 100 - this.mTier * 10);
+
+ }
+
+ @Override
+ 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 void inValidate() {
+
+ }
+
+ @Override
+ public int getEfficiency() {
+ return this.mEfficiency;
+ }
+
+ @Override
+ 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[] 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[] getBack(byte aColor) {
+ return new ITexture[]{super.getBack(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)};
+ }
+
+ @Override
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[]{super.getBottom(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)};
+ }
+
+ @Override
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[]{super.getTop(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL)};
+ }
+
+ @Override
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[]{super.getSides(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC)};
+ }
+
+ @Override
+ 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 ITexture[] getBackActive(byte aColor) {
+ return new ITexture[]{super.getBackActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)};
+ }
+
+ @Override
+ public ITexture[] getBottomActive(byte aColor) {
+ return new ITexture[]{super.getBottomActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_ACTIVE)};
+ }
+
+ @Override
+ public ITexture[] getTopActive(byte aColor) {
+ return new ITexture[]{super.getTopActive(aColor)[0], new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL)};
+ }
+
+ @Override
+ 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
new file mode 100644
index 0000000000..5d1befbbad
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySuperCondensor.java
@@ -0,0 +1,104 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.generators;
+
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+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(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;
+ }
+
+ public void onConfigLoad() {
+ this.mEfficiency = 100;
+ }
+
+ @Override
+ public int getEfficiency() {
+ 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/multi/GregtechMTENuclearReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTENuclearReactor.java
new file mode 100644
index 0000000000..32bae133ba
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTENuclearReactor.java
@@ -0,0 +1,287 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
+
+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.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.UtilsItems;
+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 GregtechMTENuclearReactor 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 int recipeCounter = 0;
+ private static Block IC2Glass = Block.getBlockFromItem(UtilsItems.getItem("IC2:blockAlloyGlass"));
+ //public FluidStack mFluidOut = Materials.UUMatter.getFluid(1L);
+
+ public GregtechMTENuclearReactor(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMTENuclearReactor(String aName) {
+ super(aName);
+ }
+
+ @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",
+ "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 = -2; i < 3; i++) {
+ for (int j = -2; j < 3; j++) {
+ for (int h = 0; h < 4; h++) {
+
+ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j);
+
+ if ((i != -2 && i != 2) && (j != -2 && j != 2)) {// innerer 3x3 ohne h�he
+ if (h == 0) {// inner floor 3x3
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Coils missings from the bottom layer, inner 3x3.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 8) {
+ Utils.LOG_INFO("Coils missings from the bottom layer, inner 3x3.");
+ return false;
+ }
+ } else if (h == 3) {//Roofing blocks 3x3 (casings + input + muffler)
+ if ((!addMufflerToMachineList(tTileEntity, 66))) {
+ if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != ModBlocks.blockCasingsMisc) {
+ Utils.LOG_INFO("Casings Missing from one of the top layers inner 3x3.");
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 9) {
+ Utils.LOG_INFO("Casings Missing from one of the top layers inner 3x3.");
+ return false;
+ }
+ }
+ } else {// Inner Air section, may require blocks here.
+ 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) {
+
+ 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;
+ }
+ }
+
+ 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;
+ }
+ }
+
+ 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 boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMTENuclearReactor(this.mName);
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java
new file mode 100644
index 0000000000..13ae8e424f
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCentrifuge.java
@@ -0,0 +1,326 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.GregTech_API;
+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;
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.lib.CORE.configSwitches;
+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 java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.server.MinecraftServer;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+
+import org.apache.commons.lang3.ArrayUtils;
+
+public class GregtechMetaTileEntityIndustrialCentrifuge
+extends GregtechMeta_MultiBlockBase {
+ private static boolean controller;
+ private static boolean isDisabled = false;
+ private static ITexture frontFace;
+ private static ITexture frontFaceActive;
+ private static Textures.BlockIcons.CustomIcon GT9_5_Active = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST_ACTIVE5");
+ private static Textures.BlockIcons.CustomIcon GT9_5 = new Textures.BlockIcons.CustomIcon("iconsets/LARGETURBINE_ST5");
+ 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");
+ //public static double recipesComplete = 0;
+
+ public GregtechMetaTileEntityIndustrialCentrifuge(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ frontFaceActive = new GT_RenderedTexture(GT9_5_Active);
+ frontFace = new GT_RenderedTexture(GT9_5);
+ }
+ else{
+ frontFaceActive = new GT_RenderedTexture(GT8_5_Active);
+ frontFace = new GT_RenderedTexture(GT8_5);
+ }
+ }
+
+ public GregtechMetaTileEntityIndustrialCentrifuge(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityIndustrialCentrifuge(this.mName);
+ }
+
+ @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};
+ }
+
+
+
+ @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 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");
+ 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");
+ 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) {
+ 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");
+ mLastRecipe = tRecipe;
+ this.mEUt = 0;
+ this.mOutputItems = null;
+ this.mOutputFluids = null;
+ if (!tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) {
+
+ Utils.LOG_WARNING("False: 1");
+ return false;
+ }
+
+ this.mMaxProgresstime = tRecipe.mDuration;
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+ 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 {
+ 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)]) {
+ this.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ 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);
+ }
+ 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();
+ for (int f = 0; f < tOut.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOut[f] != null) {
+ for (int g = 0; g < 1; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f))
+ tOut[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+ if (tFOut != null) {
+ int tSize = tFOut.amount;
+ tFOut.amount = tSize * 6;
+ }
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ this.mMaxProgresstime /= 4;
+ if (this.mMaxProgresstime <= 0){
+ this.mMaxProgresstime++;
+ }
+ 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) {
+ ItemStack tmp = tOut[f].copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize();
+ overStacks.add(tmp);
+ }
+ }
+ }
+ if (overStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[overStacks.size()];
+ tmp = overStacks.toArray(tmp);
+ tOut = ArrayUtils.addAll(tOut, tmp);
+ }
+ 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};
+ updateSlots();
+ Utils.LOG_WARNING("Centrifuge: True");
+ return true;
+ }
+ }
+ Utils.LOG_WARNING("Centrifuge: Recipe was invalid.");
+ return false;
+ }
+
+ @SuppressWarnings("static-method")
+ public Block getCasingBlock() {
+ return ModBlocks.blockCasingsMisc;
+ }
+
+ @SuppressWarnings("static-method")
+ public byte getCasingMeta() {
+ return 0;
+ }
+
+ @SuppressWarnings("static-method")
+ public byte getCasingTextureIndex() {
+ return 0;
+ }
+
+ @Override
+ 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)
+ Utils.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;
+ }
+
+ @SuppressWarnings("static-method")
+ public boolean ignoreController(Block tTileEntity) {
+ if (!controller && tTileEntity == GregTech_API.sBlockMachines) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java
new file mode 100644
index 0000000000..9c67502cae
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialCokeOven.java
@@ -0,0 +1,272 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
+
+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.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.xmod.gregtech.api.gui.GUI_MultiMachine;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase;
+
+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 GregtechMetaTileEntityIndustrialCokeOven
+ extends GregtechMeta_MultiBlockBase {
+ private int mLevel = 0;
+
+ public GregtechMetaTileEntityIndustrialCokeOven(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntityIndustrialCokeOven(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityIndustrialCokeOven(this.mName);
+ }
+
+ @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};
+ }
+
+ @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]};
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "CokeOven.png");
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return Recipe_GT.Gregtech_Recipe_Map.sCokeOvenRecipes;
+
+ }
+
+ /* @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() > 0) {
+ 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()));
+
+ 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 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);
+
+ 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 int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ /* @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }*/
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 24;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialElectrolyzer.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialElectrolyzer.java
new file mode 100644
index 0000000000..e300de3d88
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialElectrolyzer.java
@@ -0,0 +1,258 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
+
+import static gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks.GTID;
+import gregtech.api.GregTech_API;
+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.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
+
+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;
+
+import org.apache.commons.lang3.ArrayUtils;
+
+public class GregtechMetaTileEntityIndustrialElectrolyzer
+extends GT_MetaTileEntity_MultiBlockBase {
+ public GregtechMetaTileEntityIndustrialElectrolyzer(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntityIndustrialElectrolyzer(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityIndustrialElectrolyzer(this.mName);
+ }
+
+ @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};
+ }
+
+ @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)};
+ }
+ return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[GTID+5]};
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "IndustrialElectrolyzer.png");
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ ArrayList<ItemStack> tInputList = getStoredInputs();
+ GT_Recipe mLastRecipe;
+
+ @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);
+ if (tInputList.size() > 0) {
+ 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();
+ for (int f = 0; f < tOut.length; f++) {
+ if (tRecipe.mOutputs[f] != null && tOut[f] != null) {
+ for (int g = 0; g < 1; g++) {
+ if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(f))
+ tOut[f].stackSize += tRecipe.mOutputs[f].stackSize;
+ }
+ }
+ }
+ if (tFOut != null) {
+ int tSize = tFOut.amount;
+ tFOut.amount = tSize * 1;
+ }
+
+ 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) {
+ ItemStack tmp = tOut[f].copy();
+ tmp.stackSize = tmp.getMaxStackSize();
+ tOut[f].stackSize = tOut[f].stackSize - tOut[f].getMaxStackSize();
+ overStacks.add(tmp);
+ }
+ }
+ }
+ if (overStacks.size() > 0) {
+ ItemStack[] tmp = new ItemStack[overStacks.size()];
+ tmp = overStacks.toArray(tmp);
+ tOut = ArrayUtils.addAll(tOut, tmp);
+ }
+ 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};
+ updateSlots();
+
+ /* this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)};
+ updateSlots();*/
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ 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 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(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialMacerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialMacerator.java
new file mode 100644
index 0000000000..ff8b6c7f22
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialMacerator.java
@@ -0,0 +1,278 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.GregTech_API;
+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_OutputBus;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+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 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 GregtechMetaTileEntityIndustrialMacerator
+extends GregtechMeta_MultiBlockBase {
+ private static boolean controller;
+
+ public GregtechMetaTileEntityIndustrialMacerator(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntityIndustrialMacerator(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityIndustrialMacerator(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 ? Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_STEAM_MACERATOR)};
+ }
+ 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) {
+ 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);
+ if (tInputList.size() > 0) {
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sMaceratorRecipes.findRecipe(getBaseMetaTileEntity(), false, 9223372036854775807L, null, tInputs);
+ if ((tRecipe != null) && (tRecipe.isRecipeInputEqual(true, null, tInputs))) {
+ this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000);
+ this.mEfficiencyIncrease = 10000;
+
+ this.mEUt = (-tRecipe.mEUt);
+ this.mMaxProgresstime = Math.max(1, (tRecipe.mDuration/5));
+ this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0), tRecipe.getOutput(1)};
+ 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;
+ 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)))
+ {
+ 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;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 7) {
+ Utils.LOG_INFO("Returned False 2");
+ return false;
+ }
+ tAmount++;
+ }
+ }
+ }
+ }
+ }
+ if (this.mOutputHatches.size() != 0 || this.mInputBusses.size() != 1 || this.mOutputBusses.size() != 5) {
+ Utils.LOG_INFO("Returned False 3");
+ return false;
+ }
+ int height = this.getBaseMetaTileEntity().getYCoord();
+ if (this.mInputBusses.get(0).getBaseMetaTileEntity().getYCoord() != height) {
+ Utils.LOG_INFO("height: "+height+" | Returned False 4");
+ return false;
+ }
+ GT_MetaTileEntity_Hatch_OutputBus[] tmpHatches = new GT_MetaTileEntity_Hatch_OutputBus[5];
+ for (int i = 0; i < this.mOutputBusses.size(); i++) {
+ int hatchNumber = this.mOutputBusses.get(i).getBaseMetaTileEntity().getYCoord() - 1 - height;
+ if (tmpHatches[hatchNumber] == null) {
+ tmpHatches[hatchNumber] = this.mOutputBusses.get(i);
+ } else {
+ Utils.LOG_INFO("Returned False 5");
+ return false;
+ }
+ }
+ this.mOutputBusses.clear();
+ for (int i = 0; i < tmpHatches.length; i++) {
+ this.mOutputBusses.add(tmpHatches[i]);
+ }
+ return tAmount >= 26;
+ }
+
+ /*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;
+ 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)))
+ {
+ 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) {
+ return false;
+ }
+ if (aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j) != 1) {
+ return false;
+ }
+ tAmount++;
+ }
+ }
+ }
+ }
+ }
+ if (this.mOutputBusses.size() != 5 || this.mInputBusses.size() != 1) {
+ return false;
+ }
+ int height = this.getBaseMetaTileEntity().getYCoord();
+ if (this.mInputHatches.get(0).getBaseMetaTileEntity().getYCoord() != height) {
+ return false;
+ }
+ GT_MetaTileEntity_Hatch_OutputBus[] tmpHatches = new GT_MetaTileEntity_Hatch_OutputBus[5];
+ for (int i = 0; i < this.mOutputBusses.size(); i++) {
+ int hatchNumber = this.mOutputBusses.get(i).getBaseMetaTileEntity().getYCoord() - 1 - height;
+ if (tmpHatches[hatchNumber] == null) {
+ tmpHatches[hatchNumber] = this.mOutputBusses.get(i);
+ } else {
+ return false;
+ }
+ }
+ this.mOutputBusses.clear();
+ for (int i = 0; i < tmpHatches.length; i++) {
+ this.mOutputBusses.add(tmpHatches[i]);
+ }
+ return tAmount >= 26;
+ }*/
+
+ public boolean ignoreController(Block tTileEntity) {
+ if (!controller && tTileEntity == GregTech_API.sBlockMachines) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ /*@Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }*/
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 2;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialPlatePress.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialPlatePress.java
new file mode 100644
index 0000000000..df60138c60
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialPlatePress.java
@@ -0,0 +1,204 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
+
+import static gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks.GTID;
+import gregtech.api.GregTech_API;
+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.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.lib.CORE;
+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;
+
+public class GregtechMetaTileEntityIndustrialPlatePress
+extends GT_MetaTileEntity_MultiBlockBase {
+ public GregtechMetaTileEntityIndustrialPlatePress(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntityIndustrialPlatePress(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityIndustrialPlatePress(this.mName);
+ }
+
+ @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};
+ }
+
+ @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+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 Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return new GUI_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MaterialPress.png");
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeMap() {
+ return GT_Recipe.GT_Recipe_Map.sBenderRecipes;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @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);
+ if (tInputList.size() > 0) {
+ 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 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 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 int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialSinter.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialSinter.java
new file mode 100644
index 0000000000..ca5e102521
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialSinter.java
@@ -0,0 +1,263 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
+
+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;
+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;
+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 GregtechMetaTileEntityIndustrialSinter
+extends GT_MetaTileEntity_MultiBlockBase {
+
+
+ RenderBlocks asdasd = RenderBlocks.getInstance();
+
+ public GregtechMetaTileEntityIndustrialSinter(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntityIndustrialSinter(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityIndustrialSinter(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;
+ }
+
+ @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(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) {
+ int controllerX = aBaseMetaTileEntity.getXCoord();
+ int controllerY = aBaseMetaTileEntity.getYCoord();
+ int controllerZ = aBaseMetaTileEntity.getZCoord();
+
+ 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 (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;
+ }
+ for (byte i = 2; i < 6; i = (byte) (i + 1)) {
+ //UtilsRendering.drawBlockInWorld((controllerX+i), (controllerY), (controllerZ), Color.LIME_GREEN);
+ IGregTechTileEntity tTileEntity;
+ if ((null != (tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))) &&
+ (tTileEntity.getFrontFacing() == getBaseMetaTileEntity().getFrontFacing()) && (tTileEntity.getMetaTileEntity() != null) &&
+ ((tTileEntity.getMetaTileEntity() instanceof GregtechMetaTileEntityIndustrialSinter))) {
+ //Utils.LOG_INFO("False 1");
+ return false;
+ }
+ }
+ 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)) {
+ 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 (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 (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;
+ }
+ }
+ }
+ }
+ }
+ if (this.mOutputHatches.size() != 0 || this.mInputHatches.size() != 0) {
+ Utils.LOG_INFO("Use Busses, Not Hatches for Input/Output.");
+ return false;
+ }
+ if (this.mInputBusses.size() != 2 || this.mOutputBusses.size() != 2) {
+ Utils.LOG_INFO("Incorrect amount of Input & Output busses.");
+ return false;
+ }
+ this.mMaintenanceHatches.clear();
+ 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 = getCasingTextureIndex();
+ } else {
+ Utils.LOG_INFO("Maintenance hatch must be in the middle block on the back.");
+ return false;
+ }
+ }
+ if (this.mMaintenanceHatches.size() != 1 || this.mEnergyHatches.size() != 1) {
+ Utils.LOG_INFO("Incorrect amount of Maintenance or Energy hatches.");
+ return false;
+ }
+ } else {
+ Utils.LOG_INFO("False 5");
+ return false;
+ }
+ Utils.LOG_INFO("True");
+ return true;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ 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;
+ }
+
+ private boolean addToMachineList(IGregTechTileEntity tTileEntity) {
+ return ((addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex())) || (addInputToMachineList(tTileEntity, getCasingTextureIndex())) || (addOutputToMachineList(tTileEntity, getCasingTextureIndex())) || (addMufflerToMachineList(tTileEntity, getCasingTextureIndex())));
+ }
+
+ private boolean addEnergyInputToMachineList(IGregTechTileEntity tTileEntity) {
+ return ((addEnergyInputToMachineList(tTileEntity, getCasingTextureIndex())));
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialWireMill.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialWireMill.java
new file mode 100644
index 0000000000..b0bc87c74a
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIndustrialWireMill.java
@@ -0,0 +1,246 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
+
+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;
+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;
+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.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+
+public class GregtechMetaTileEntityIndustrialWireMill
+extends GT_MetaTileEntity_MultiBlockBase {
+ public GregtechMetaTileEntityIndustrialWireMill(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntityIndustrialWireMill(String aName) {
+ super(aName);
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityIndustrialWireMill(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]};
+ }
+
+ @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;
+ }
+
+ @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(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 (getBaseMetaTileEntity().getAirOffset(i, j, k)) {
+ tAirCount++;
+ }
+ }
+ }
+ }
+ if (tAirCount != 10) {
+ Utils.LOG_INFO("False 1");
+ return false;
+ }
+ for (byte i = 2; i < 6; i = (byte) (i + 1)) {
+ IGregTechTileEntity tTileEntity;
+ if ((null != (tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityAtSideAndDistance(i, 2))) &&
+ (tTileEntity.getFrontFacing() == getBaseMetaTileEntity().getFrontFacing()) && (tTileEntity.getMetaTileEntity() != null) &&
+ ((tTileEntity.getMetaTileEntity() instanceof GregtechMetaTileEntityIndustrialWireMill))) {
+ //Utils.LOG_INFO("False 1");
+ return false;
+ }
+ }
+ 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)) {
+ for (byte k = 0; k < 5; k = (byte) (k + 1)) {
+ 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 (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;
+ }
+ }
+ }
+ }
+ }
+ if (this.mOutputHatches.size() != 0 || this.mInputHatches.size() != 0) {
+ Utils.LOG_INFO("Use Busses, Not Hatches for Input/Output.");
+ return false;
+ }
+ if (this.mInputBusses.size() != 2 || this.mOutputBusses.size() != 2) {
+ Utils.LOG_INFO("Incorrect amount of Input & Output busses.");
+ return false;
+ }
+ this.mMaintenanceHatches.clear();
+ 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 = getCasingTextureIndex();
+ } else {
+ Utils.LOG_INFO("Maintenance hatch must be in the middle block on the back.");
+ return false;
+ }
+ }
+ if (this.mMaintenanceHatches.size() != 1 || this.mEnergyHatches.size() != 1) {
+ Utils.LOG_INFO("Incorrect amount of Maintenance or Energy hatches.");
+ return false;
+ }
+ } else {
+ Utils.LOG_INFO("False 5");
+ return false;
+ }
+ Utils.LOG_INFO("True");
+ return true;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ 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;
+ }
+
+ private boolean addToMachineList(IGregTechTileEntity tTileEntity) {
+ return ((addMaintenanceToMachineList(tTileEntity, getCasingTextureIndex())) || (addInputToMachineList(tTileEntity, getCasingTextureIndex())) || (addOutputToMachineList(tTileEntity, getCasingTextureIndex())) || (addMufflerToMachineList(tTileEntity, getCasingTextureIndex())));
+ }
+
+ private boolean addEnergyInputToMachineList(IGregTechTileEntity tTileEntity) {
+ return ((addEnergyInputToMachineList(tTileEntity, getCasingTextureIndex())));
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIronBlastFurnace.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIronBlastFurnace.java
new file mode 100644
index 0000000000..3edb17efcb
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityIronBlastFurnace.java
@@ -0,0 +1,380 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.MetaTileEntity;
+import gregtech.api.objects.GT_ItemStack;
+import gregtech.api.objects.GT_RenderedTexture;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_IronBlastFurnace;
+import gtPlusPlus.xmod.gregtech.api.gui.GUI_IronBlastFurnace;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class GregtechMetaTileEntityIronBlastFurnace
+ extends MetaTileEntity {
+ private static final ITexture[] FACING_SIDE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_SOLID_STEEL)};
+ private static final ITexture[] FACING_FRONT = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT)};
+ private static final ITexture[] FACING_ACTIVE = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_MAGIC_FRONT_ACTIVE)};
+ public int mMaxProgresstime = 0;
+ public int mUpdate = 30;
+ public int mProgresstime = 0;
+ public boolean mMachine = false;
+ public ItemStack mOutputItem1;
+ public ItemStack mOutputItem2;
+
+ public GregtechMetaTileEntityIronBlastFurnace(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional, 4);
+ }
+
+ public GregtechMetaTileEntityIronBlastFurnace(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 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
+ public boolean isElectric() {
+ return false;
+ }
+
+ @Override
+ public boolean isPneumatic() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnetInput() {
+ return false;
+ }
+
+ @Override
+ public boolean isEnetOutput() {
+ return false;
+ }
+
+ @Override
+ public boolean isInputFacing(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean isOutputFacing(byte aSide) {
+ return false;
+ }
+
+ @Override
+ public boolean isTeleporterCompatible() {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(byte aFacing) {
+ return aFacing > 1;
+ }
+
+ @Override
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ @Override
+ public int getProgresstime() {
+ return this.mProgresstime;
+ }
+
+ @Override
+ public int maxProgresstime() {
+ 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 GregtechMetaTileEntityIronBlastFurnace(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(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/GregtechMetaTileEntityMassFabricator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java
new file mode 100644
index 0000000000..2cd7164fe1
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityMassFabricator.java
@@ -0,0 +1,352 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
+
+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_MultiBlockBase;
+import gregtech.api.objects.GT_RenderedTexture;
+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.fluid.FluidUtils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.xmod.gregtech.api.gui.GUI_MatterFab;
+
+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 GregtechMetaTileEntityMassFabricator 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 int mAmplifierUsed = 0;
+ private int mMatterProduced = 0;
+ private static Block IC2Glass = Block.getBlockFromItem(UtilsItems.getItem("IC2:blockAlloyGlass"));
+ FluidStack tempFake = FluidUtils.getFluidStack("uuamplifier", 1);
+ GT_Recipe fakeRecipe;
+
+ public int getAmplifierUsed(){
+ return mAmplifierUsed;
+ }
+
+ public int getMatterProduced(){
+ return mMatterProduced;
+ }
+
+ //public FluidStack mFluidOut = Materials.UUMatter.getFluid(1L);
+
+ public GregtechMetaTileEntityMassFabricator(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntityMassFabricator(String aName) {
+ super(aName);
+ }
+
+ @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};
+ }
+
+ @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_MatterFab(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "MatterFabricator.png");
+ }
+
+ @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(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) {
+ //Utils.LOG_INFO("Input fluid found");
+ 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);
+ mMatterProduced++;
+ mAmplifierUsed++;
+ updateSlots();
+ Utils.LOG_INFO("Recipes Finished: "+mMatterProduced);
+ return true;
+ }
+ }
+ else {
+ Utils.LOG_INFO("Invalid Recipe");
+ return false;
+ }
+ }
+ }
+ else if (tFluids.length == 0) {
+ //Utils.LOG_INFO("Input fluid not found");
+ 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 - (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.mEUt *= 4;
+ this.mMaxProgresstime /= 2;
+ }
+
+ if (this.mEUt > 0) {
+ this.mEUt = (-this.mEUt);
+ }
+
+ if (fakeRecipe != null) {
+ this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
+ 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;
+ }
+ }
+ else {
+ //Utils.LOG_INFO("Invalid no input 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 = -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);
+
+ 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) {
+
+ 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;
+ }
+ }
+
+ 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;
+ }
+ }
+
+ 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 boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityMassFabricator(this.mName);
+ }
+
+} \ No newline at end of file
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityPowerSubStationController.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityPowerSubStationController.java
new file mode 100644
index 0000000000..b85e011115
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntityPowerSubStationController.java
@@ -0,0 +1,189 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi;
+
+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.GT_Config;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.gui.GUI_MultiMachine;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class GregtechMetaTileEntityPowerSubStationController extends GT_MetaTileEntity_MultiBlockBase {
+
+ private int recipeCounter = 0;
+
+ public GregtechMetaTileEntityPowerSubStationController(int aID, String aName, String aNameRegional) {
+ super(aID, aName, aNameRegional);
+ }
+
+ public GregtechMetaTileEntityPowerSubStationController(String aName) {
+ super(aName);
+ }
+
+ @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 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) {
+ 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);
+
+ 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");
+ 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;
+ }
+ 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");
+ return false;
+ }
+ }
+ }
+ } else {
+
+ }
+ }
+ }
+ }
+ }
+ Utils.LOG_INFO("Multiblock Formed.");
+ return true;
+ }
+
+ @Override
+ public boolean isCorrectMachinePart(ItemStack aStack) {
+ return true;
+ }
+
+ @Override
+ public int getMaxEfficiency(ItemStack aStack) {
+ return 10000;
+ }
+
+ @Override
+ public int getPollutionPerTick(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getDamageToComponent(ItemStack aStack) {
+ return 0;
+ }
+
+ @Override
+ public int getAmountOfOutputs() {
+ return 1;
+ }
+
+ @Override
+ public boolean explodesOnComponentBreak(ItemStack aStack) {
+ return false;
+ }
+
+ @Override
+ public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntityPowerSubStationController(this.mName);
+ }
+
+} \ 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
new file mode 100644
index 0000000000..11e8a6b240
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Base.java
@@ -0,0 +1,168 @@
+package gtPlusPlus.xmod.gregtech.common.tools;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.damagesources.GT_DamageSources;
+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;
+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.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];
+
+ @Override
+ public int getToolDamagePerBlockBreak() {
+ return 100;
+ }
+
+ @Override
+ public int getToolDamagePerDropConversion() {
+ return 100;
+ }
+
+ @Override
+ public int getToolDamagePerContainerCraft() {
+ return 800;
+ }
+
+ @Override
+ public int getToolDamagePerEntityAttack() {
+ return 200;
+ }
+
+ @Override
+ public float getSpeedMultiplier() {
+ return 1.0F;
+ }
+
+ @Override
+ public float getMaxDurabilityMultiplier() {
+ return 1.0F;
+ }
+
+ @Override
+ public int getHurtResistanceTime(int aOriginalHurtResistance, Entity aEntity) {
+ return aOriginalHurtResistance;
+ }
+
+ @Override
+ public String getMiningSound() {
+ return null;
+ }
+
+ @Override
+ public String getCraftingSound() {
+ return null;
+ }
+
+ @Override
+ public String getEntityHitSound() {
+ return null;
+ }
+
+ @Override
+ public String getBreakingSound() {
+ return (String) GregTech_API.sSoundList.get(Integer.valueOf(0));
+ }
+
+ @Override
+ public int getBaseQuality() {
+ return 0;
+ }
+
+ @Override
+ public boolean canBlock() {
+ return false;
+ }
+
+ @Override
+ public boolean isCrowbar() {
+ return false;
+ }
+
+ @Override
+ public boolean isWrench() {
+ return false;
+ }
+
+ @Override
+ public boolean isWeapon() {
+ return false;
+ }
+
+ @Override
+ public boolean isRangedWeapon() {
+ return false;
+ }
+
+ @Override
+ public boolean isMiningTool() {
+ return true;
+ }
+
+ @Override
+ 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);
+ }
+
+ public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) {
+ return new EntityDamageSource((aPlayer instanceof EntityPlayer) ? "player" : "mob", aPlayer).func_151519_b(aEntity);
+ }
+
+ @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) {
+ return 0;
+ }
+
+ @Override
+ public ItemStack getBrokenItem(ItemStack aStack) {
+ return null;
+ }
+
+ @Override
+ public Enchantment[] getEnchantments(ItemStack aStack) {
+ return ZERO_ENCHANTMENTS;
+ }
+
+ @Override
+ public int[] getEnchantmentLevels(ItemStack aStack) {
+ return ZERO_ENCHANTMENT_LEVELS;
+ }
+
+ @Override
+ public void onToolCrafted(ItemStack aStack, EntityPlayer aPlayer) {
+ aPlayer.triggerAchievement(AchievementList.openInventory);
+ aPlayer.triggerAchievement(AchievementList.mineWood);
+ aPlayer.triggerAchievement(AchievementList.buildWorkBench);
+ }
+
+ @Override
+ public void onStatsAddedToTool(Gregtech_MetaTool aItem, int aID) {
+ }
+
+ @Override
+ public float getNormalDamageAgainstEntity(float aOriginalDamage, Entity aEntity, ItemStack aStack, EntityPlayer aPlayer) {
+ return aOriginalDamage;
+ }
+
+ @Override
+ 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_BaseMultiblockItem.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_BaseMultiblockItem.java
new file mode 100644
index 0000000000..d4f566dcd4
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_BaseMultiblockItem.java
@@ -0,0 +1,49 @@
+package gtPlusPlus.xmod.gregtech.common.tools;
+
+import gregtech.api.interfaces.IIconContainer;
+import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool;
+import net.minecraft.block.Block;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IChatComponent;
+
+public abstract class TOOL_Gregtech_BaseMultiblockItem extends TOOL_Gregtech_Base {
+ @Override
+ public abstract float getBaseDamage();
+
+ @Override
+ public boolean isMinableBlock(Block aBlock, byte aMetaData) {
+ return false;
+ }
+
+ @Override
+ public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
+ return aIsToolHead ? getTurbineIcon() : null;
+ }
+
+ @Override
+ public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) {
+ return aIsToolHead ? Gregtech_MetaTool.getPrimaryMaterial(aStack).mRGBa : null;
+ }
+
+ @Override
+ public IChatComponent getDeathMessage(EntityLivingBase aPlayer, EntityLivingBase aEntity) {
+ return new ChatComponentText(EnumChatFormatting.GREEN + aPlayer.getCommandSenderName() + EnumChatFormatting.WHITE + " put " + EnumChatFormatting.RED +
+ aEntity.getCommandSenderName() + "s" + EnumChatFormatting.WHITE + " head into a turbine");
+ }
+
+ public abstract IIconContainer getTurbineIcon();
+
+ @Override
+ public abstract float getSpeedMultiplier();
+
+ @Override
+ public abstract float getMaxDurabilityMultiplier();
+
+ @Override
+ public ItemStack getBrokenItem(ItemStack aStack) {
+ return null;
+ }
+}
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
new file mode 100644
index 0000000000..43afea2310
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_Choocher.java
@@ -0,0 +1,198 @@
+package gtPlusPlus.xmod.gregtech.common.tools;
+
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.xmod.gregtech.api.items.Gregtech_MetaTool;
+import gtPlusPlus.xmod.gregtech.api.items.types.ToolType_HardHammer;
+import gtPlusPlus.xmod.gregtech.api.items.types.ToolType_Wrench;
+
+import java.util.Arrays;
+import java.util.List;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.monster.EntityIronGolem;
+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.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"});
+
+
+ @Override
+ 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 getToolDamagePerDropConversion() {
+ return 100;
+ }
+
+ @Override
+ public int getToolDamagePerContainerCraft() {
+ return 400;
+ }
+
+ @Override
+ public int getToolDamagePerEntityAttack() {
+ return 100;
+ }
+
+ @Override
+ public int getBaseQuality() {
+ return 0;
+ }
+
+ @Override
+ public float getBaseDamage() {
+ return 4.0F;
+ }
+
+ @Override
+ public float getSpeedMultiplier() {
+ return 0.85F;
+ }
+
+ @Override
+ public float getMaxDurabilityMultiplier() {
+ return 1.2F;
+ }
+
+ @Override
+ public String getCraftingSound() {
+ return null;
+ }
+
+ @Override
+ public String getEntityHitSound() {
+ return null;
+ }
+
+ @Override
+ public String getBreakingSound() {
+ return (String) GregTech_API.sSoundList.get(Integer.valueOf(0));
+ }
+
+ @Override
+ public String getMiningSound() {
+ return null;
+ }
+
+ @Override
+ public boolean canBlock() {
+ return true;
+ }
+
+ @Override
+ public boolean isWrench(){
+ return true;
+ }
+
+ @Override
+ public boolean isCrowbar() {
+ return false;
+ }
+
+ @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) {
+ return aIsToolHead ? Textures.ItemIcons.WIRE_CUTTER : Textures.ItemIcons.VOID;
+ }
+
+
+/* @Override
+ public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) {
+ return aIsToolHead ? Textures.class..ItemIcons.SKOOKUMCHOOCHER : null;
+ }
+*/
+ //
+
+ @Override
+ public short[] getRGBa(boolean aIsToolHead, ItemStack aStack) {
+ return aIsToolHead ? Gregtech_MetaTool.getPrimaryMaterial(aStack).mRGBa : null;
+ }
+
+ @Override
+ public void onStatsAddedToTool(Gregtech_MetaTool aItem, int aID) {
+ aItem.addItemBehavior(aID, new ToolType_Wrench(150));
+ aItem.addItemBehavior(aID, new ToolType_HardHammer(1, 1250));
+ }
+
+ @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 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);
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_MaxEfficiencyMultiBlockItem.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_MaxEfficiencyMultiBlockItem.java
new file mode 100644
index 0000000000..a9a43a9444
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tools/TOOL_Gregtech_MaxEfficiencyMultiBlockItem.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.xmod.gregtech.common.tools;
+
+import gregtech.api.enums.Textures;
+import gregtech.api.interfaces.IIconContainer;
+
+public class TOOL_Gregtech_MaxEfficiencyMultiBlockItem extends TOOL_Gregtech_BaseMultiblockItem {
+ @Override
+ public float getSpeedMultiplier() {
+ return 4.0F;
+ }
+
+ @Override
+ public float getMaxDurabilityMultiplier() {
+ return 4.0F;
+ }
+
+ @Override
+ public float getBaseDamage() {
+ return 3.0F;
+ }
+
+ @Override
+ public IIconContainer getTurbineIcon() {
+ return Textures.ItemIcons.TURBINE_HUGE;
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Block.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Block.java
new file mode 100644
index 0000000000..d368e5b9c9
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Block.java
@@ -0,0 +1,107 @@
+package gtPlusPlus.xmod.gregtech.loaders;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.ConfigCategories;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.SubTag;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator;
+import gtPlusPlus.xmod.gregtech.api.util.GregtechOreDictUnificator;
+import net.minecraft.item.ItemStack;
+
+public class Processing_Block implements Interface_OreRecipeRegistrator {
+
+ private boolean isGem = false;
+
+ public Processing_Block() {
+ GregtechOrePrefixes.block.add(this);
+ }
+
+ @Override
+ public void registerOre(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+ Utils.LOG_INFO("Processing Blocks");
+ GT_Values.RA.addCutterRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GregtechOreDictUnificator.get(GregtechOrePrefixes.plate, aMaterial, 9L), null, (int) Math.max(aMaterial.getMass() * 10L, 1L), 30);
+
+ ItemStack tStack1 = GregtechOreDictUnificator.get(GregtechOrePrefixes.ingot, aMaterial, 1L);
+ ItemStack tStack2 = GregtechOreDictUnificator.get(GregtechOrePrefixes.gem, aMaterial, 1L);
+ ItemStack tStack3 = GregtechOreDictUnificator.get(GregtechOrePrefixes.dust, aMaterial, 1L);
+
+ GT_ModHandler.removeRecipe(new ItemStack[]{GT_Utility.copyAmount(1L, new Object[]{aStack})});
+
+ if (tStack1 != null) {
+ GT_ModHandler.removeRecipe(new ItemStack[]{tStack1, tStack1, tStack1, tStack1, tStack1, tStack1, tStack1, tStack1, tStack1});
+ }
+ if (tStack2 != null) {
+ GT_ModHandler.removeRecipe(new ItemStack[]{tStack2, tStack2, tStack2, tStack2, tStack2, tStack2, tStack2, tStack2, tStack2});
+ }
+ if (tStack3 != null) {
+ GT_ModHandler.removeRecipe(new ItemStack[]{tStack3, tStack3, tStack3, tStack3, tStack3, tStack3, tStack3, tStack3, tStack3});
+ }
+ if (aMaterial.mStandardMoltenFluid != null) {
+ GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Block.get(0L, new Object[0]), aMaterial.getMolten(1296L), GregtechOreDictUnificator.get(GregtechOrePrefixes.block, aMaterial, 1L), 288, 8);
+ }
+ if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.storageblockcrafting, GregtechOrePrefixes.block.get(aMaterial).toString(), false)) {
+ if ((tStack1 == null) && (tStack2 == null) && (tStack3 != null)){
+ GT_ModHandler.addCraftingRecipe(GregtechOreDictUnificator.get(GregtechOrePrefixes.block, aMaterial, 1L), new Object[]{"XXX", "XXX", "XXX", Character.valueOf('X'), GregtechOrePrefixes.dust.get(aMaterial)});
+ }
+ if (tStack2 != null){
+ GT_ModHandler.addCraftingRecipe(GregtechOreDictUnificator.get(GregtechOrePrefixes.block, aMaterial, 1L), new Object[]{"XXX", "XXX", "XXX", Character.valueOf('X'), GregtechOrePrefixes.gem.get(aMaterial)});
+ }
+ if (tStack1 != null) {
+ GT_ModHandler.addCraftingRecipe(GregtechOreDictUnificator.get(GregtechOrePrefixes.block, aMaterial, 1L), new Object[]{"XXX", "XXX", "XXX", Character.valueOf('X'), GregtechOrePrefixes.ingot.get(aMaterial)});
+ }
+ }
+
+ if (aMaterial.contains(SubTag.CRYSTAL) && !aMaterial.contains(SubTag.METAL)){
+ isGem = true;
+ }
+ else {
+ isGem = false;
+ }
+ //Ingot
+ if (tStack1 != null) {
+ tStack1.stackSize = 9;
+ }
+ //Gem
+ if (tStack2 != null && !isGem) {
+ tStack2.stackSize = 9;
+ }
+ else if (tStack2 != null && isGem) {
+ tStack2.stackSize = 0;
+ }
+ //Dust
+ if (tStack3 != null && !isGem) {
+ tStack3.stackSize = 9;
+ }
+ else if (tStack3 != null && isGem) {
+ tStack3.stackSize = 0;
+ }
+
+ //Gems in FORGE HAMMER
+ if (tStack2 != null && !isGem) {
+ tStack2.stackSize = 9;
+ GT_Values.RA.addForgeHammerRecipe(aStack, tStack2, 100, 24);
+ }
+ else if (tStack2 != null && isGem) {
+ tStack2.stackSize = 9;
+ GT_Values.RA.addForgeHammerRecipe(aStack, tStack2, 100, 24);
+ tStack2.stackSize = 0;
+ }
+
+
+ if (GregTech_API.sRecipeFile.get(ConfigCategories.Recipes.storageblockdecrafting, GregtechOrePrefixes.block.get(aMaterial).toString(), tStack2 != null)) {
+ if (tStack3 != null)
+ GT_ModHandler.addShapelessCraftingRecipe(tStack3, new Object[]{GregtechOrePrefixes.block.get(aMaterial)});
+ if (tStack2 != null)
+ GT_ModHandler.addShapelessCraftingRecipe(tStack2, new Object[]{GregtechOrePrefixes.block.get(aMaterial)});
+ if (tStack1 != null) {
+ GT_ModHandler.addShapelessCraftingRecipe(tStack1, new Object[]{GregtechOrePrefixes.block.get(aMaterial)});
+ }
+ }
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_HotIngots.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_HotIngots.java
new file mode 100644
index 0000000000..e895b7cc0c
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_HotIngots.java
@@ -0,0 +1,23 @@
+package gtPlusPlus.xmod.gregtech.loaders;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator;
+import net.minecraft.item.ItemStack;
+
+public class Processing_HotIngots implements Interface_OreRecipeRegistrator {
+ public Processing_HotIngots() {
+ Utils.LOG_INFO("Generating Hot Ingot.");
+ GregtechOrePrefixes.ingotHot.add(this);
+ }
+
+ @Override
+ public void registerOre(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+ GT_Values.RA.addVacuumFreezerRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 3L, 1L));
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Ingot1.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Ingot1.java
new file mode 100644
index 0000000000..913597e47e
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Ingot1.java
@@ -0,0 +1,68 @@
+package gtPlusPlus.xmod.gregtech.loaders;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.enums.SubTag;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator;
+import gtPlusPlus.xmod.gregtech.api.util.GregtechRecipeRegistrator;
+import net.minecraft.item.ItemStack;
+
+public class Processing_Ingot1 implements Interface_OreRecipeRegistrator {
+ public Processing_Ingot1() {
+ GregtechOrePrefixes.ingot.add(this);
+ }
+
+ @Override
+ public void registerOre(GregtechOrePrefixes aPrefix, GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+ Utils.LOG_INFO("Processing Ingots");
+ if (aMaterial.mFuelPower > 0) {
+ GT_Values.RA.addFuel(GT_Utility.copyAmount(1L, new Object[]{aStack}), null, aMaterial.mFuelPower, aMaterial.mFuelType);
+ }
+ GT_Values.RA.addBoxingRecipe(GT_Utility.copyAmount(16L, new Object[]{aStack}), ItemList.Crate_Empty.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.crateGtIngot, aMaterial, 1L), 100, 8);
+ GT_Values.RA.addUnboxingRecipe(GT_OreDictUnificator.get(OrePrefixes.crateGtIngot, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 16L), ItemList.Crate_Empty.get(1L, new Object[0]), 800, 1);
+
+ if (aMaterial.mStandardMoltenFluid != null)
+ GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0L, new Object[0]), aMaterial.getMolten(144L), GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L), 32, 8);
+ GregtechRecipeRegistrator.registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null);
+ GregtechRecipeRegistrator.registerReverseMacerating(aStack, aMaterial, aPrefix.mMaterialAmount, null, null, null, false);
+ if (aMaterial.mSmeltInto.mArcSmeltInto != aMaterial) {
+ GregtechRecipeRegistrator.registerReverseArcSmelting(GT_Utility.copyAmount(1L, new Object[]{aStack}), aMaterial, aPrefix.mMaterialAmount, null, null, null);
+ }
+ if (!aMaterial.contains(SubTag.NO_SMASHING)) {
+ GT_Values.RA.addWiremillRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_Utility.copy(new Object[]{GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 2L), GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 8L)}), 100, 4);
+ GT_Values.RA.addForgeHammerRecipe(GT_Utility.copyAmount(2L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L), (int) Math.max(aMaterial.getMass(), 1L), 16);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 1L, 1L), 24);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(2L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateDouble, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 2L, 1L), 96);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(3L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateTriple, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 3L, 1L), 96);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(4L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 4L, 1L), 96);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(5L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateQuintuple, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 5L, 1L), 96);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(9L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 9L, 1L), 96);
+ }
+
+
+ if (!GregtechOrePrefixes.block.isIgnored(aMaterial))
+ GT_ModHandler.addCompressionRecipe(GT_Utility.copyAmount(9L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.block, aMaterial, 1L));
+ if (!aMaterial.contains(SubTag.NO_WORKING))
+ GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial.mMacerateInto, 2L), (int) Math.max(aMaterial.getMass() * 5L, 1L), 16);
+ if (!aMaterial.contains(SubTag.NO_SMELTING)) {
+ GT_Values.RA.addAlloySmelterRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), ItemList.Shape_Mold_Nugget.get(0L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial, 9L), 100, 1);
+ if ((GT_ModHandler.getSmeltingOutput(aStack, false, null) == null) && (GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 1L) != null) && (!GT_ModHandler.addSmeltingRecipe(aStack, GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 9L))))
+ GT_ModHandler.addShapelessCraftingRecipe(GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial.mSmeltInto, 9L), new Object[]{aOreDictName});
+ }
+ ItemStack tStack;
+ if ((null != (tStack = GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial.mMacerateInto, 1L))) && (
+ (aMaterial.mBlastFurnaceRequired) || (aMaterial.contains(SubTag.NO_SMELTING)))) {
+ GT_ModHandler.removeFurnaceSmelting(tStack);
+ }
+
+ GregtechRecipeRegistrator.registerUsagesForGT_Materials(GT_Utility.copyAmount(1L, new Object[]{aStack}), OrePrefixes.plate.get(aMaterial).toString(), !aMaterial.contains(SubTag.NO_SMASHING));
+
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Plate1.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Plate1.java
new file mode 100644
index 0000000000..3d4f439ef0
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Plate1.java
@@ -0,0 +1,56 @@
+package gtPlusPlus.xmod.gregtech.loaders;
+
+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.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import gtPlusPlus.xmod.gregtech.api.interfaces.internal.Interface_OreRecipeRegistrator;
+import net.minecraft.item.ItemStack;
+
+public class Processing_Plate1 implements Interface_OreRecipeRegistrator {
+ public Processing_Plate1() {
+ GregtechOrePrefixes.plate.add(this);
+ }
+
+ @Override
+ public void registerOre(GregtechOrePrefixes aPrefix, GregtechOrePrefixes.GT_Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) {
+ Utils.LOG_INFO("Processing Plates");
+ GT_ModHandler.removeRecipeByOutput(aStack);
+ GT_ModHandler.removeRecipe(new ItemStack[]{aStack});
+
+ GT_Values.RA.addBoxingRecipe(GT_Utility.copyAmount(16L, new Object[]{aStack}), ItemList.Crate_Empty.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.crateGtPlate, aMaterial, 1L), 100, 8);
+ GT_Values.RA.addUnboxingRecipe(GT_OreDictUnificator.get(OrePrefixes.crateGtPlate, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 16L), ItemList.Crate_Empty.get(1L, new Object[0]), 800, 1);
+
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, aMaterial, 1L), Materials.Tin.getMolten(32), GT_OreDictUnificator.get(OrePrefixes.rotor, aMaterial, 1L), 240, 24);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, aMaterial, 1L), Materials.Lead.getMolten(48), GT_OreDictUnificator.get(OrePrefixes.rotor, aMaterial, 1L), 240, 24);
+ GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 4L), GT_OreDictUnificator.get(OrePrefixes.ring, aMaterial, 1L), Materials.SolderingAlloy.getMolten(16), GT_OreDictUnificator.get(OrePrefixes.rotor, aMaterial, 1L), 240, 24);
+
+
+
+ if (aMaterial.mStandardMoltenFluid != null) {
+ GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Plate.get(0L, new Object[0]), aMaterial.getMolten(144L), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L), 32, 8);
+ }
+
+
+ if (aMaterial.mFuelPower > 0)
+ GT_Values.RA.addFuel(GT_Utility.copyAmount(1L, new Object[]{aStack}), null, aMaterial.mFuelPower, aMaterial.mFuelType);
+ GT_Utility.removeSimpleIC2MachineRecipe(GT_Utility.copyAmount(9L, new Object[]{aStack}), GT_ModHandler.getCompressorRecipeList(), GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L));
+ GT_Values.RA.addImplosionRecipe(GT_Utility.copyAmount(2L, new Object[]{aStack}), 2, GT_OreDictUnificator.get(OrePrefixes.compressed, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.DarkAsh, 1L));
+ if (!aMaterial.contains(gregtech.api.enums.SubTag.NO_WORKING)) {
+ GT_Values.RA.addLatheRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.lens, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial, 1L), (int) Math.max(aMaterial.getMass() / 2L, 1L), 16);
+ }
+ if (!aMaterial.contains(gregtech.api.enums.SubTag.NO_SMASHING)) {
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(1L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.foil, aMaterial, 4L), (int) Math.max(aMaterial.getMass() * 1L, 1L), 24);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(2L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateDouble, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 2L, 1L), 96);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(3L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateTriple, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 3L, 1L), 96);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(4L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 4L, 1L), 96);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(5L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateQuintuple, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 5L, 1L), 96);
+ GT_Values.RA.addBenderRecipe(GT_Utility.copyAmount(9L, new Object[]{aStack}), GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L), (int) Math.max(aMaterial.getMass() * 9L, 1L), 96);
+ }
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Textures_Items.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Textures_Items.java
new file mode 100644
index 0000000000..41e0511ace
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/Processing_Textures_Items.java
@@ -0,0 +1,10 @@
+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/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
new file mode 100644
index 0000000000..f5aa8720ef
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
@@ -0,0 +1,222 @@
+package gtPlusPlus.xmod.gregtech.recipes;
+
+import gregtech.api.GregTech_API;
+import gregtech.api.util.Recipe_GT;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder;
+import gtPlusPlus.xmod.gregtech.recipes.machines.RECIPEHANDLER_CokeOven;
+import gtPlusPlus.xmod.gregtech.recipes.machines.RECIPEHANDLER_Dehydrator;
+import gtPlusPlus.xmod.gregtech.recipes.machines.RECIPEHANDLER_MatterFabricator;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
+
+
+
+ @Override
+ 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) /*&& (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 (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);
+ Utils.LOG_WARNING("Something was null, returning false");
+ return false;
+ }
+
+ } 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);
+ Utils.LOG_WARNING("Something was null, returning false");
+ return false;
+ }
+
+ } 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);
+ }
+ 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);
+ }
+ RECIPEHANDLER_CokeOven.debug5(aInput1, aInput2, aFluidInput, aFluidOutput, aOutput, aDuration, aEUt);
+
+ return true;
+
+ } 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;
+ }
+ }
+
+ @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;
+ }
+ }
+
+ @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(ItemStack aInput, FluidStack aFluid, ItemStack[] aOutput, int aDuration, int aEUt) {
+ 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);
+ 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 aInput1, ItemStack aInput2, FluidStack aFluidInput, FluidStack aFluidOutput, ItemStack[] aOutputItems, int[] aChances, int aDuration, int aEUt) {
+ Utils.LOG_INFO("Trying to add a Dehydrator recipe.");
+ if (aInput1 != null){
+ Utils.LOG_INFO("Recipe requires input: "+aInput1.getDisplayName()+" x"+aInput1.stackSize);
+ }
+ if (aInput2 != null){
+ Utils.LOG_INFO("Recipe requires input: "+aInput2.getDisplayName()+" x"+aInput2.stackSize);
+ }
+ if (aFluidInput != null){
+ Utils.LOG_INFO("Recipe requires input: "+aFluidInput.getFluid().getName()+" "+aFluidInput.amount+"mbst");
+ }
+ if (((aInput1 == null) && (aFluidInput == null)) || ((aOutputItems == null) && (aFluidOutput == null))) {
+ return false;
+ }
+ if ((aOutputItems != null) && ((aDuration = GregTech_API.sRecipeFile.get("dehydrator", aOutputItems[0], aDuration)) <= 0)) {
+ return false;
+ }
+ if (aOutputItems != null){
+ Utils.LOG_INFO("Recipe will output: "+UtilsItems.getArrayStackNames(aOutputItems));
+ }
+ 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());
+ }
+ Recipe_GT.Gregtech_Recipe_Map.sChemicalDehydratorRecipes.addRecipe(true, new ItemStack[]{aInput1, aInput2}, aOutputItems, null, aChances, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, 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
new file mode 100644
index 0000000000..01b62e23ca
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_CokeOven.java
@@ -0,0 +1,46 @@
+package gtPlusPlus.xmod.gregtech.recipes.machines;
+
+import gtPlusPlus.core.util.Utils;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+public class RECIPEHANDLER_CokeOven {
+
+ 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(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("Passed.");
+ }
+ 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("Passed.");
+ }
+ 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("Passed.");
+ 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(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
new file mode 100644
index 0000000000..ea30cc1e6f
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_Dehydrator.java
@@ -0,0 +1,81 @@
+package gtPlusPlus.xmod.gregtech.recipes.machines;
+
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
+public class RECIPEHANDLER_Dehydrator {
+
+ 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(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("Passed.");
+ }
+ 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("Passed.");
+ }
+ 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("Passed.");
+ 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(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){
+ inputAname = aInput1.getDisplayName();
+ }
+ else {
+ inputAname = "null";
+ }
+
+ if (aInput2 != null){
+ inputBname = aInput2.getDisplayName();
+ }
+ else {
+ inputBname = "null";
+ }
+
+ if (aFluidInput != null){
+ inputFluidname = aFluidInput.getFluid().getName();
+ }
+ else {
+ inputFluidname = "null";
+ }
+
+ if (aFluidOutput != null){
+ outputFluidName = aFluidOutput.getFluid().getName();
+ }
+ else {
+ outputFluidName = "null";
+ }
+
+ Utils.LOG_INFO("Successfully added a Chemical Dehydrator recipe for: "+UtilsItems.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
new file mode 100644
index 0000000000..ff9f87d805
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/machines/RECIPEHANDLER_MatterFabricator.java
@@ -0,0 +1,55 @@
+package gtPlusPlus.xmod.gregtech.recipes.machines;
+
+import gtPlusPlus.core.util.Utils;
+import net.minecraftforge.fluids.FluidStack;
+
+public class RECIPEHANDLER_MatterFabricator {
+
+ 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(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("Passed.");
+ }
+ 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("Passed.");
+ }
+ 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("Passed.");
+ Utils.LOG_WARNING("aFluidInput:"+aFluidInput.toString()+" aFluidOutput:"+aFluidOutput.toString()+" aDuration:"+aDuration+" aEU/t:"+aEUt);
+
+ }
+ public static void debug5(FluidStack aFluidInput, FluidStack aFluidOutput, int aDuration, int aEUt){
+ String a = "nothing";
+ String b = "";
+
+ if (aFluidInput != null){
+ a = aFluidInput.getFluid().getName();
+ }
+ 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_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ Utils.LOG_WARNING("==================================================================================");
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java
new file mode 100644
index 0000000000..1f3537f355
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java
@@ -0,0 +1,291 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+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.util.Utils;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechOrePrefixes.GT_Materials;
+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};
+ *
+ */
+
+
+ private static int BasePipeID = 30700;
+
+
+ public static void run()
+ {
+ if (Gregtech){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Custom Cables/Wires/Pipes.");
+ run1();
+ }
+
+ }
+
+ 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("Superconductor", 524288, 30660, 0, 0, 8);
+ superConductorFactory("VoidMetal", 512, 30661, 0, 0, 8);
+
+ generateNonGTFluidPipes(GT_Materials.Staballoy, BasePipeID, 6250, 7500, true);
+ generateNonGTFluidPipes(GT_Materials.Tantalloy60, BasePipeID+5, 5000, 4250, true);
+ generateNonGTFluidPipes(GT_Materials.Tantalloy61, BasePipeID+10, 6000, 5800, true);
+ generateNonGTFluidPipes(GT_Materials.VoidMetal, BasePipeID+15, 250, 25000, true);
+ generateGTFluidPipes(Materials.Europium, BasePipeID+20, 12000, 7500, true);
+
+ generateNonGTFluidPipes(GT_Materials.Potin, BasePipeID+25, 375, 2000, true);
+ generateNonGTFluidPipes(GT_Materials.MaragingSteel300, BasePipeID+30, 7000, 2500, true);
+ generateNonGTFluidPipes(GT_Materials.MaragingSteel350, BasePipeID+35, 8000, 2500, true);
+ generateNonGTFluidPipes(GT_Materials.Inconel690, BasePipeID+40, 7500, 4800, true);
+ generateNonGTFluidPipes(GT_Materials.Inconel792, BasePipeID+45, 8000, 5500, true);
+ generateNonGTFluidPipes(GT_Materials.HastelloyX, 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){
+ V = 0;
+ }
+ else if (Voltage == 32){
+ V = 1;
+ }
+ else if (Voltage == 128){
+ V = 2;
+ }
+ else if (Voltage == 512){
+ V = 3;
+ }
+ else if (Voltage == 2048){
+ V = 4;
+ }
+ else if (Voltage == 8196){
+ V = 5;
+ }
+ else if (Voltage == 32768){
+ V = 6;
+ }
+ else if (Voltage == 131072){
+ V = 7;
+ }
+ else if (Voltage == 524288){
+ V = 8;
+ }
+ 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.");
+ V = 0;
+ }
+ //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 superConductorFactory(String Material, int Voltage, int ID, long insulatedLoss, long uninsulatedLoss, long Amps){
+ GT_Materials T = GT_Materials.valueOf(Material);
+ int V = 0;
+ if (Voltage == 8){
+ V = 0;
+ }
+ else if (Voltage == 32){
+ V = 1;
+ }
+ else if (Voltage == 128){
+ V = 2;
+ }
+ else if (Voltage == 512){
+ V = 3;
+ }
+ else if (Voltage == 2048){
+ V = 4;
+ }
+ else if (Voltage == 8196){
+ V = 5;
+ }
+ else if (Voltage == 32768){
+ V = 6;
+ }
+ else if (Voltage == 131072){
+ V = 7;
+ }
+ else if (Voltage == 524288){
+ V = 8;
+ }
+ 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.");
+ V = 0;
+ }
+ //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;
+ 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);
+ }
+
+ private static void generateNonGTFluidPipes(GT_Materials material, int startID, int transferRatePerSec, int heatResistance, boolean isGasProof){
+ int transferRatePerTick = transferRatePerSec/20;
+ 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);
+
+ }
+
+ private static void generatePipeRecipes(String materialName){
+
+ String output = materialName.substring(0, 1).toUpperCase() + materialName.substring(1);
+ output = output.replace("-", "").replace("_", "").replace(" ", "");
+
+ Utils.LOG_INFO("Generating "+output+" pipes & respective recipes.");
+ int multi = 5;
+
+ ItemStack pipeIngot = UtilsItems.getItemStackOfAmountFromOreDict("ingot"+output, 1).copy();
+ ItemStack pipePlate = UtilsItems.getItemStackOfAmountFromOreDict("plate"+output, 1).copy();
+
+ //Check all pipes are not null
+ Utils.LOG_WARNING("Generated pipeTiny from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Tiny"+output, 1) != null) ? true : false));
+ Utils.LOG_WARNING("Generated pipeSmall from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 1) != null) ? true : false));
+ Utils.LOG_WARNING("Generated pipeNormal from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 1) != null) ? true : false));
+ Utils.LOG_WARNING("Generated pipeLarge from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1) != null) ? true : false));
+ Utils.LOG_WARNING("Generated pipeHuge from "+ materialName +"? "+ ((UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1) != null) ? true : false));
+
+ //Add the Three Shaped Recipes First
+ UtilsRecipe.recipeBuilder(
+ pipePlate, "craftingToolWrench", pipePlate,
+ pipePlate, null, pipePlate,
+ pipePlate, "craftingToolHardHammer", pipePlate,
+ UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 6));
+
+ UtilsRecipe.recipeBuilder(
+ pipePlate, pipePlate, pipePlate,
+ "craftingToolWrench", null, "craftingToolHardHammer",
+ pipePlate, pipePlate, pipePlate,
+ UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 2));
+
+ UtilsRecipe.recipeBuilder(
+ pipePlate, "craftingToolHardHammer", pipePlate,
+ pipePlate, null, pipePlate,
+ pipePlate, "craftingToolWrench", pipePlate,
+ UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1));
+
+ GT_Values.RA.addExtruderRecipe(
+ UtilsItems.getSimpleStack(pipeIngot, 1),
+ ItemList.Shape_Extruder_Pipe_Tiny.get(0),
+ UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Tiny"+output, 2),
+ 32*multi, 8*multi);
+
+ GT_Values.RA.addExtruderRecipe(
+ UtilsItems.getSimpleStack(pipeIngot, 1),
+ ItemList.Shape_Extruder_Pipe_Small.get(0),
+ UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Small"+output, 1),
+ 32*multi, 16*multi);
+
+ GT_Values.RA.addExtruderRecipe(
+ UtilsItems.getSimpleStack(pipeIngot, 3),
+ ItemList.Shape_Extruder_Pipe_Medium.get(0),
+ UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Medium"+output, 1),
+ 32*multi, 32*multi);
+
+ GT_Values.RA.addExtruderRecipe(
+ UtilsItems.getSimpleStack(pipeIngot, 6),
+ ItemList.Shape_Extruder_Pipe_Large.get(0),
+ UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Large"+output, 1),
+ 32*multi, 64*multi);
+
+ GT_Values.RA.addExtruderRecipe(
+ UtilsItems.getSimpleStack(pipeIngot, 12),
+ ItemList.Shape_Extruder_Pipe_Huge.get(0),
+ UtilsItems.getItemStackOfAmountFromOreDict("pipe"+"Huge"+output, 1),
+ 32*multi, 128*multi);
+
+ }
+
+ 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 UtilsItems.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
new file mode 100644
index 0000000000..fd4ec45fbb
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechDehydrator.java
@@ -0,0 +1,99 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine_GT_Recipe;
+import gregtech.api.util.Recipe_GT;
+import gtPlusPlus.core.lib.CORE;
+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){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Chemical Dehydrators.");
+ 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) {
+
+ */
+
+ GregtechItemList.GT_Dehydrator_EV.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(
+ 813, "advancedmachine.dehydrator.tier.01", "Chemical Dehydrator I", 4,
+ "Remind Alkalus to add something here."+System.getProperty("line.separator")+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,
+ "Remind Alkalus to add something here."+System.getProperty("line.separator")+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,
+ "Remind Alkalus to add something here."+System.getProperty("line.separator")+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,
+ "Remind Alkalus to add something here."+System.getProperty("line.separator")+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));
+
+
+
+
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java
new file mode 100644
index 0000000000..6f81f5c44c
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechEnergyBuffer.java
@@ -0,0 +1,83 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+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;
+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){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Energy Buffer Blocks.");
+ run1();
+ }
+
+ }
+
+ @SuppressWarnings("deprecation")
+ 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);
+
+
+ //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));
+
+ 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/GregtechIndustrialCentrifuge.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCentrifuge.java
new file mode 100644
index 0000000000..14ccd6a142
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCentrifuge.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityIndustrialCentrifuge;
+
+public class GregtechIndustrialCentrifuge
+{
+
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Centrifuge Multiblock.");
+ run1();
+ }
+
+ }
+
+ private static void run1()
+ {
+ //Industrial Centrifuge Multiblock
+ GregtechItemList.Industrial_Centrifuge.set(new GregtechMetaTileEntityIndustrialCentrifuge(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
new file mode 100644
index 0000000000..15e1be1e6a
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialCokeOven.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityIndustrialCokeOven;
+
+public class GregtechIndustrialCokeOven
+{
+
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Coke Oven Multiblock.");
+ run1();
+ }
+
+ }
+
+ private static void run1()
+ {
+ //Industrial Centrifuge Multiblock
+ GregtechItemList.Industrial_CokeOven.set(new GregtechMetaTileEntityIndustrialCokeOven(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
new file mode 100644
index 0000000000..e165430580
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElectrolyzer.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityIndustrialElectrolyzer;
+
+public class GregtechIndustrialElectrolyzer
+{
+
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Electrolyzer Multiblock.");
+ run1();
+ }
+
+ }
+
+ private static void run1()
+ {
+ //Industrial Electrolyzer Multiblock
+ GregtechItemList.Industrial_Electrolyzer.set(new GregtechMetaTileEntityIndustrialElectrolyzer(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
new file mode 100644
index 0000000000..110e729f75
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMacerator.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityIndustrialMacerator;
+
+public class GregtechIndustrialMacerator
+{
+
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Maceration Stack Multiblock.");
+ run1();
+ }
+
+ }
+
+ private static void run1()
+ {
+ //Industrial Electrolyzer Multiblock
+ GregtechItemList.Industrial_MacerationStack.set(new GregtechMetaTileEntityIndustrialMacerator(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
new file mode 100644
index 0000000000..dcbc25ae88
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityMassFabricator;
+
+public class GregtechIndustrialMassFabricator
+{
+
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Mass Fabricator Multiblock.");
+ run1();
+ }
+
+ }
+
+ private static void run1()
+ {
+ //Industrial Electrolyzer Multiblock
+ GregtechItemList.Industrial_MassFab.set(new GregtechMetaTileEntityMassFabricator(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/GregtechIndustrialPlatePress.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialPlatePress.java
new file mode 100644
index 0000000000..96f26f050a
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialPlatePress.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityIndustrialPlatePress;
+
+public class GregtechIndustrialPlatePress
+{
+
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Press Multiblock.");
+ run1();
+ }
+
+ }
+
+ private static void run1()
+ {
+ //Industrial Centrifuge Multiblock
+ GregtechItemList.Industrial_PlatePress.set(new GregtechMetaTileEntityIndustrialPlatePress(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/GregtechIndustrialSinter.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialSinter.java
new file mode 100644
index 0000000000..d8ce73f460
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialSinter.java
@@ -0,0 +1,24 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityIndustrialSinter;
+
+public class GregtechIndustrialSinter{
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Sinter Furnace Multiblock.");
+ run1();
+ }
+
+ }
+
+ private static void run1()
+ {
+ //Industrial Electrolyzer Multiblock
+ GregtechItemList.Industrial_SinterFurnace.set(new GregtechMetaTileEntityIndustrialSinter(810, "industrialsinterfurnace.controller.tier.single", "Sinter Furnace").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
new file mode 100644
index 0000000000..2d69a2c6e3
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialWiremill.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityIndustrialWireMill;
+
+public class GregtechIndustrialWiremill
+{
+
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Wire Factory Multiblock.");
+ run1();
+ }
+
+ }
+
+ private static void run1()
+ {
+ //Industrial Electrolyzer Multiblock
+ GregtechItemList.Industrial_WireFactory.set(new GregtechMetaTileEntityIndustrialWireMill(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
new file mode 100644
index 0000000000..38768557bc
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIronBlastFurnace.java
@@ -0,0 +1,25 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityIronBlastFurnace;
+
+public class GregtechIronBlastFurnace
+{
+
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Iron Blast Furnace.");
+ run1();
+ }
+
+ }
+
+ private static void run1()
+ {
+ GregtechItemList.Machine_Iron_BlastFurnace.set(new GregtechMetaTileEntityIronBlastFurnace(768, "ironmachine.blastfurnace", "Iron Plated Blast Furnace").getStackForm(1L));
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java
new file mode 100644
index 0000000000..05ef99f79f
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerSubStation.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.GregtechMetaTileEntityPowerSubStationController;
+
+public class GregtechPowerSubStation
+{
+
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Power Substation Node.");
+ run1();
+ }
+
+ }
+
+ private static void run1()
+ {
+ //Steam Condensors
+ GregtechItemList.PowerSubStation.set(new GregtechMetaTileEntityPowerSubStationController(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
new file mode 100644
index 0000000000..a58d258ff3
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechRocketFuelGenerator.java
@@ -0,0 +1,25 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntityRocketFuelGenerator;
+
+public class GregtechRocketFuelGenerator {
+
+ public static void run()
+ {
+ if (LoadedMods.Gregtech){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Industrial Rocket Engines.");
+ 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));
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java
new file mode 100644
index 0000000000..e0632c1f0a
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSafeBlock.java
@@ -0,0 +1,53 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+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){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Lockable Safe Blocks.");
+ 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));
+
+ 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
new file mode 100644
index 0000000000..aaa60d377d
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarGenerators.java
@@ -0,0 +1,36 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+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.enableSolarGenerators){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Solar Generator Blocks.");
+ 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));
+
+
+ }
+}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamCondenser.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamCondenser.java
new file mode 100644
index 0000000000..a3b92daea0
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSteamCondenser.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GregtechMetaCondensor;
+
+public class GregtechSteamCondenser
+{
+
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Steam Condensor.");
+ run1();
+ }
+
+ }
+
+ 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
new file mode 100644
index 0000000000..fc7927d3f2
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSuperConductionPoint.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.xmod.gregtech.registration.gregtech;
+
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+import gtPlusPlus.xmod.gregtech.common.tileentities.generators.GregtechMetaTileEntitySuperCondensor;
+
+public class GregtechSuperConductionPoint
+{
+
+
+
+ public static void run()
+ {
+ if (gtPlusPlus.core.lib.LoadedMods.Gregtech){
+ Utils.LOG_INFO("Gregtech5u Content | Registering Super Conductor Input Node.");
+ run1();
+ }
+
+ }
+
+ 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/growthcraft/HANDLER_GC.java b/src/Java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java
new file mode 100644
index 0000000000..fae897734b
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/growthcraft/HANDLER_GC.java
@@ -0,0 +1,28 @@
+package gtPlusPlus.xmod.growthcraft;
+
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.xmod.growthcraft.booze.Register_Booze;
+
+public class HANDLER_GC {
+
+
+ //Run me during Pre-Init
+ public static void preInit(){
+ if (LoadedMods.Growthcraft){
+ Register_Booze.preInit();
+ }
+ }
+
+ public static void init(){
+ if (LoadedMods.Growthcraft){
+
+ }
+ }
+
+ public static void postInit(){
+ if (LoadedMods.Growthcraft){
+
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/growthcraft/booze/Register_Booze.java b/src/Java/gtPlusPlus/xmod/growthcraft/booze/Register_Booze.java
new file mode 100644
index 0000000000..88174aac4e
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/growthcraft/booze/Register_Booze.java
@@ -0,0 +1,64 @@
+package gtPlusPlus.xmod.growthcraft.booze;
+
+import growthcraft.api.cellar.Booze;
+import growthcraft.api.cellar.CellarRegistry;
+import growthcraft.cellar.block.BlockFluidBooze;
+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;
+import net.minecraft.init.Items;
+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;
+
+ //Run me during Pre-Init
+ public static void preInit(){
+ if (LoadedMods.Growthcraft){
+ start();
+ }
+ }
+
+ 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/ic2/HANDLER_IC2.java b/src/Java/gtPlusPlus/xmod/ic2/HANDLER_IC2.java
new file mode 100644
index 0000000000..55875fc02d
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/HANDLER_IC2.java
@@ -0,0 +1,30 @@
+package gtPlusPlus.xmod.ic2;
+
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.xmod.ic2.block.RTGGenerator.BlockRTG;
+import gtPlusPlus.xmod.ic2.item.IC2_Items;
+import gtPlusPlus.xmod.ic2.recipe.RECIPE_IC2;
+import ic2.core.init.InternalName;
+
+public class HANDLER_IC2{
+
+ 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){
+ RECIPE_IC2.initRecipes();
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java b/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java
new file mode 100644
index 0000000000..9d238e4c97
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/BlockRTG.java
@@ -0,0 +1,207 @@
+package gtPlusPlus.xmod.ic2.block.RTGGenerator;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.xmod.ic2.block.kieticgenerator.tileentity.TileEntityKineticWindGenerator;
+import gtPlusPlus.xmod.ic2.item.IC2_Items;
+import gtPlusPlus.xmod.ic2.item.ItemGenerators;
+import ic2.core.IC2;
+import ic2.core.Ic2Items;
+import ic2.core.block.BlockMultiID;
+import ic2.core.block.TileEntityBlock;
+import ic2.core.block.reactor.tileentity.TileEntityNuclearReactorElectric;
+import ic2.core.init.InternalName;
+
+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.EnumRarity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+
+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);
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ setHardness(3.0F);
+ setStepSound(soundTypeMetal);
+
+ IC2_Items.blockRTG = new ItemStack(this, 1, 0);
+ IC2_Items.blockKineticGenerator = new ItemStack(this, 1, 1);
+
+ GameRegistry.registerTileEntity(TileEntityRTG.class, "RTG Mach II");
+ GameRegistry.registerTileEntity(TileEntityKineticWindGenerator.class, "Wind Ripper Mach II");
+ }
+
+ @Override
+ 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++)
+ {
+ ItemStack is = new ItemStack(this, 1, i);
+ if (is.getItem().getUnlocalizedName(is) == null) {
+ break;
+ }
+ itemList.add(is);
+ }
+ }
+ }
+
+
+ @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(int meta, MutableObject<Class<?>[]> ctorArgTypes, MutableObject<Object[]> ctorArgs)
+ {
+ try
+ {
+ switch (meta)
+ {
+ case 0:
+ return TileEntityRTG.class;
+ case 1:
+ return TileEntityKineticWindGenerator.class;
+ }
+ }
+ 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)
+ */
+
+ @Override
+ public void randomDisplayTick(World world, int x, int y, int z, Random random)
+ {
+ if (!IC2.platform.isRendering()) {
+ return;
+ }
+ 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;
+ }
+ 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)
+ {
+ TileEntityNuclearReactorElectric te = (TileEntityNuclearReactorElectric)getOwnTe(world, x, y, z);
+ if (te == null) {
+ return;
+ }
+ int puffs = te.heat / 1000;
+ if (puffs <= 0) {
+ return;
+ }
+ 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);
+ }
+ 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);
+ }
+ }
+ }
+
+ @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
new file mode 100644
index 0000000000..cea09bdd5c
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/TileEntityRTG.java
@@ -0,0 +1,86 @@
+package gtPlusPlus.xmod.ic2.block.RTGGenerator;
+
+import gtPlusPlus.xmod.ic2.block.RTGGenerator.gui.CONTAINER_RTG;
+import gtPlusPlus.xmod.ic2.block.RTGGenerator.gui.GUI_RTG;
+import ic2.core.ContainerBase;
+import ic2.core.Ic2Items;
+import ic2.core.block.generator.tileentity.TileEntityRTGenerator;
+import ic2.core.block.invslot.InvSlotConsumable;
+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 final InvSlotConsumable fuelSlot;
+
+ public TileEntityRTG()
+ {
+ this.fuelSlot = new InvSlotConsumableId(this, "fuelSlot", 0, 12, new Item[] { Ic2Items.RTGPellets.getItem() });
+ }
+
+ @Override
+ 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;
+ }
+
+ @Override
+ public boolean gainFuel()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean needsFuel()
+ {
+ return true;
+ }
+
+ @Override
+ public String getInventoryName()
+ {
+ return "RTG";
+ }
+
+ @Override
+ public ContainerBase<TileEntityRTGenerator> getGuiContainer(EntityPlayer entityPlayer)
+ {
+ return new CONTAINER_RTG(entityPlayer, this);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin)
+ {
+ return new GUI_RTG(new CONTAINER_RTG(entityPlayer, this));
+ }
+
+ @Override
+ 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
new file mode 100644
index 0000000000..e9c7b5cc81
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RTG.java
@@ -0,0 +1,37 @@
+package gtPlusPlus.xmod.ic2.block.RTGGenerator.gui;
+
+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(EntityPlayer entityPlayer, TileEntityRTG tileEntity1)
+ {
+ super(entityPlayer, tileEntity1);
+ for (int i = 0; i < 4; i++) {
+ addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + i * 18, 18));
+ }
+ for (int i = 4; i < 8; i++) {
+ addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + (i - 4) * 18, 36));
+ }
+ for (int i = 8; i < 12; i++) {
+ addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + (i - 8) * 18, 54));
+ }
+ }
+
+ @Override
+ public List<String> getNetworkedFields()
+ {
+ List<String> ret = super.getNetworkedFields();
+
+ ret.add("storage");
+
+ return ret;
+ }
+}
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
new file mode 100644
index 0000000000..0d5f701b7a
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java
@@ -0,0 +1,52 @@
+package gtPlusPlus.xmod.ic2.block.RTGGenerator.gui;
+
+import gtPlusPlus.xmod.ic2.block.RTGGenerator.TileEntityRTG;
+import ic2.core.IC2;
+import ic2.core.block.generator.gui.GuiRTGenerator;
+import ic2.core.util.GuiTooltipHelper;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.StatCollector;
+
+import org.lwjgl.opengl.GL11;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+@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
new file mode 100644
index 0000000000..74d94011ea
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_BlockKineticGenerator.java
@@ -0,0 +1,76 @@
+package gtPlusPlus.xmod.ic2.block.kieticgenerator;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import ic2.core.block.BlockMultiID;
+import ic2.core.block.kineticgenerator.tileentity.TileEntityManualKineticGenerator;
+import ic2.core.block.kineticgenerator.tileentity.TileEntityWindKineticGenerator;
+import ic2.core.init.InternalName;
+import ic2.core.item.block.ItemKineticGenerator;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+
+import org.apache.commons.lang3.mutable.MutableObject;
+
+import cpw.mods.fml.common.registry.GameRegistry;
+
+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
new file mode 100644
index 0000000000..f356441921
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/IC2_TEComponent.java
@@ -0,0 +1,48 @@
+package gtPlusPlus.xmod.ic2.block.kieticgenerator;
+
+import ic2.core.block.TileEntityBlock;
+
+import java.io.DataInput;
+import java.io.IOException;
+
+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(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
new file mode 100644
index 0000000000..b3ceea52d4
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/ContainerKineticWindgenerator.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.xmod.ic2.block.kieticgenerator.container;
+
+import ic2.core.ContainerFullInv;
+import ic2.core.block.kineticgenerator.tileentity.TileEntityWindKineticGenerator;
+import ic2.core.slot.SlotInvSlot;
+
+import java.util.List;
+
+import net.minecraft.entity.player.EntityPlayer;
+
+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/container/IC2_ContainerBase.java b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/IC2_ContainerBase.java
new file mode 100644
index 0000000000..740991c5d3
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/container/IC2_ContainerBase.java
@@ -0,0 +1,5 @@
+package gtPlusPlus.xmod.ic2.block.kieticgenerator.container;
+
+public class IC2_ContainerBase {
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/gui/GuiKineticWindGenerator.java b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/gui/GuiKineticWindGenerator.java
new file mode 100644
index 0000000000..f677e7fcfb
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/gui/GuiKineticWindGenerator.java
@@ -0,0 +1,76 @@
+package gtPlusPlus.xmod.ic2.block.kieticgenerator.gui;
+
+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;
+
+import org.lwjgl.opengl.GL11;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+@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
new file mode 100644
index 0000000000..f094c8f928
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/block/kieticgenerator/tileentity/TileEntityKineticWindGenerator.java
@@ -0,0 +1,392 @@
+package gtPlusPlus.xmod.ic2.block.kieticgenerator.tileentity;
+
+import ic2.api.energy.tile.IKineticSource;
+import ic2.api.item.IKineticRotor;
+import ic2.api.item.IKineticRotor.GearboxType;
+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;
+import net.minecraft.item.ItemStack;
+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
+{
+ 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);
+ }
+
+
+ public void update2Entity()
+ {
+ super.updateEntity();
+
+ assert (IC2.platform.isSimulating());
+ if (this.updateTicker++ % getTickRate() != 0) {
+ return;
+ }
+ 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;
+ }
+ }
+ else
+ {
+ if (getActive()) {
+ setActive(false);
+ }
+ needsInvUpdate = true;
+ }
+ if (getActive())
+ {
+ this.crossSection = (getRotorDiameter() / 2 * 2 * 2 + 1);
+
+ 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();
+
+ float speed = (float)Util.limit((this.windStrength - getMinWindStrength()) / getMaxWindStrength(), 0.0D, 2.0D);
+
+
+ setRotationSpeed(speed*2);
+ if (this.windStrength >= getMinWindStrength()) {
+ if (this.windStrength <= getMaxWindStrength()) {
+ this.rotorSlot.damage(1, false);
+ } else {
+ this.rotorSlot.damage(4, false);
+ }
+ }
+ }
+ }
+
+
+
+ @Override
+ public List<String> getNetworkedFields()
+ {
+ List<String> ret = new Vector<String>(1);
+
+ ret.add("rotationSpeed");
+ ret.add("rotorSlot");
+ ret.addAll(super.getNetworkedFields());
+
+ return ret;
+ }
+
+ @Override
+ public ContainerBase<TileEntityWindKineticGenerator> getGuiContainer(EntityPlayer entityPlayer)
+ {
+ return new ContainerWindKineticGenerator(entityPlayer, this);
+ }
+
+ @Override
+ @SideOnly(Side.CLIENT)
+ public GuiScreen getGui(EntityPlayer entityPlayer, boolean isAdmin)
+ {
+ return new GuiWindKineticGenerator(new ContainerWindKineticGenerator(entityPlayer, this));
+ }
+
+ @Override
+ public boolean facingMatchesDirection(ForgeDirection direction)
+ {
+ return direction.ordinal() == getFacing();
+ }
+
+ @Override
+ public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side)
+ {
+ if ((side == 0) || (side == 1)) {
+ return false;
+ }
+ return getFacing() != side;
+ }
+
+ @Override
+ public void setFacing(short side)
+ {
+ super.setFacing(side);
+ }
+
+ public boolean enableUpdateEntity()
+ {
+ return IC2.platform.isSimulating();
+ }
+
+ @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 "";
+ }
+
+ @Override
+ 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 String getInventoryName()
+ {
+ return "Advanced Kinetic Wind Generator";
+ }
+
+ @Override
+ public void onGuiClosed(EntityPlayer entityPlayer) {}
+
+ @Override
+ public boolean shouldRenderInPass(int pass)
+ {
+ return pass == 0;
+ }
+
+ @Override
+ public int checkSpace(int length, boolean onlyrotor)
+ {
+ int box = getRotorDiameter() / 2;
+ int lentemp = 0;
+ if (onlyrotor)
+ {
+ length = 1;
+ lentemp = length + 1;
+ }
+ 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 boolean checkrotor()
+ {
+ return !this.rotorSlot.isEmpty();
+ }
+
+ @Override
+ 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");
+ }
+ }
+
+ @Override
+ public int getTickRate()
+ {
+ return 32;
+ }
+
+ @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 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 0.0F;
+ }
+
+ @Override
+ 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 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 getMaxWindStrength()
+ {
+ ItemStack stack = this.rotorSlot.get();
+ if ((stack != null) && ((stack.getItem() instanceof IKineticRotor))) {
+ return ((IKineticRotor)stack.getItem()).getMaxWindStrength(stack)*2;
+ }
+ return 0;
+ }
+
+ @Override
+ 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 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");
+ }
+
+ @Override
+ public boolean guiisoverload()
+ {
+ if (this.windStrength > getMaxWindStrength()) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean guiisminWindStrength()
+ {
+ return this.windStrength >= getMinWindStrength();
+ }
+
+ @Override
+ public int getKuOutput()
+ {
+ if ((this.windStrength >= getMinWindStrength()) && (getActive())) {
+ return (int)(this.windStrength * 50.0D * getefficiency());
+ }
+ return 0;
+ }
+
+ @Override
+ 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
new file mode 100644
index 0000000000..b6ec4d66df
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradual.java
@@ -0,0 +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;
+
+public class IC2_ItemGradual
+extends CoreItem
+{
+ public IC2_ItemGradual(String internalName)
+ {
+ super(internalName, AddToCreativeTab.tabMachines, 1, 10000, "", EnumRarity.uncommon);
+ setNoRepair();
+ }
+
+ @Override
+ public boolean isDamaged(ItemStack stack)
+ {
+ return getDamage(stack) > 1;
+ }
+
+ @Override
+ public boolean showDurabilityBar(ItemStack stack)
+ {
+ return true;
+ }
+
+ @Override
+ @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
new file mode 100644
index 0000000000..4922e0f806
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemGradualInteger.java
@@ -0,0 +1,53 @@
+package gtPlusPlus.xmod.ic2.item;
+
+import ic2.api.item.ICustomDamageItem;
+import ic2.core.util.StackUtil;
+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(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
new file mode 100644
index 0000000000..852830dc5c
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_ItemIC2.java
@@ -0,0 +1,104 @@
+package gtPlusPlus.xmod.ic2.item;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.lib.CORE;
+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
+{
+ public IC2_ItemIC2(String internalName)
+ {
+ setUnlocalizedName(internalName);
+ setCreativeTab(AddToCreativeTab.tabMachines);
+ setTextureName(CORE.MODID + ":" + internalName);
+
+ GameRegistry.registerItem(this, internalName);
+ }
+
+ public String getTextureFolder()
+ {
+ return null;
+ }
+
+ /* 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];
+ }*/
+
+ @Override
+ public String getUnlocalizedName()
+ {
+ return super.getUnlocalizedName();
+ }
+
+ @Override
+ public String getUnlocalizedName(ItemStack itemStack)
+ {
+ return getUnlocalizedName();
+ }
+
+ @Override
+ public String getItemStackDisplayName(ItemStack itemStack)
+ {
+ return StatCollector.translateToLocal(getUnlocalizedName(itemStack));
+ }
+
+ 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
new file mode 100644
index 0000000000..bf6f3bc1cd
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/item/IC2_Items.java
@@ -0,0 +1,72 @@
+package gtPlusPlus.xmod.ic2.item;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.item.base.CoreItem;
+import gtPlusPlus.core.lib.LoadedMods;
+import ic2.core.IC2;
+import ic2.core.init.InternalName;
+import net.minecraft.item.ItemStack;
+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_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 blockRTG;
+ public static ItemStack blockKineticGenerator;
+
+ public static void register(){
+
+ 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
+ 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
new file mode 100644
index 0000000000..2d73638ce9
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/item/ItemGenerators.java
@@ -0,0 +1,55 @@
+package gtPlusPlus.xmod.ic2.item;
+
+import ic2.core.item.block.ItemBlockIC2;
+
+import java.util.List;
+
+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(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
new file mode 100644
index 0000000000..06e33d6793
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/item/RotorBase.java
@@ -0,0 +1,99 @@
+package gtPlusPlus.xmod.ic2.item;
+
+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{
+
+ 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(InternalName internalName, int Radius, int durability, float efficiency, int minWindStrength, int maxWindStrength, ResourceLocation RenderTexture)
+ {
+ super(internalName, Radius, durability, efficiency, minWindStrength, maxWindStrength, RenderTexture);
+
+
+
+ setMaxStackSize(1);
+ setMaxDamage(durability);
+
+ this.radius = Radius;
+ this.efficiency = efficiency;
+ this.renderTexture = RenderTexture;
+ this.minWindStrength = minWindStrength;
+ this.maxWindStrength = maxWindStrength;
+ this.water = (internalName != InternalName.itemwoodrotor);
+ }
+
+ @Override
+ 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))) {
+ type = IKineticRotor.GearboxType.WATER;
+ } 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)));
+ }
+ }
+
+ @Override
+ 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);
+ }
+}
+
diff --git a/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java b/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java
new file mode 100644
index 0000000000..f35b1e88f0
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/item/RotorIridium.java
@@ -0,0 +1,121 @@
+package gtPlusPlus.xmod.ic2.item;
+
+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;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.StatCollector;
+
+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;
+
+ public RotorIridium(InternalName internalName, int Radius, int durability, float efficiency, int minWindStrength, int maxWindStrength, ResourceLocation RenderTexture)
+ {
+ super(internalName, Radius, durability, efficiency, minWindStrength, maxWindStrength, RenderTexture);
+
+
+
+ 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);
+ }
+
+ @Override
+ 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))) {
+ type = IKineticRotor.GearboxType.WATER;
+ } 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)));
+ }
+ }
+
+ @Override
+ 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
new file mode 100644
index 0000000000..af648e73e2
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/ic2/recipe/RECIPE_IC2.java
@@ -0,0 +1,151 @@
+package gtPlusPlus.xmod.ic2.recipe;
+
+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.UtilsItems;
+import gtPlusPlus.core.util.recipe.UtilsRecipe;
+import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList;
+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 = UtilsItems.getSimpleStack(IC2_Items.rotor_Blade_Material_1.getItem());
+ private static ItemStack rotor_blade_T2 = UtilsItems.getSimpleStack(IC2_Items.rotor_Blade_Material_2.getItem());
+ private static ItemStack rotor_blade_T3 = UtilsItems.getSimpleStack(IC2_Items.rotor_Blade_Material_3.getItem());
+ private static ItemStack rotor_blade_T4 = UtilsItems.getSimpleStack(IC2_Items.rotor_Blade_Material_4.getItem());
+
+ private static ItemStack shaft_T1 = UtilsItems.getSimpleStack(IC2_Items.shaft_Material_1.getItem());
+ private static ItemStack shaft_T2 = UtilsItems.getSimpleStack(IC2_Items.shaft_Material_2.getItem());
+ private static ItemStack shaft_T3 = UtilsItems.getSimpleStack(IC2_Items.shaft_Material_3.getItem());
+ private static ItemStack shaft_T4 = UtilsItems.getSimpleStack(IC2_Items.shaft_Material_4.getItem());
+
+ private static ItemStack rotor_T1 = UtilsItems.getSimpleStack(IC2_Items.rotor_Material_1.getItem());
+ private static ItemStack rotor_T2 = UtilsItems.getSimpleStack(IC2_Items.rotor_Material_2.getItem());
+ private static ItemStack rotor_T3 = UtilsItems.getSimpleStack(IC2_Items.rotor_Material_3.getItem());
+ private static ItemStack rotor_T4 = UtilsItems.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
+ UtilsRecipe.recipeBuilder(
+ plate_T1, ingot_T1, plate_T1,
+ plate_T1, ingot_T1, plate_T1,
+ plate_T1, ingot_T1, plate_T1,
+ rotor_blade_T1);
+
+ UtilsRecipe.recipeBuilder(
+ plate_T2, ingot_T2, plate_T2,
+ plate_T2, ingot_T2, plate_T2,
+ plate_T2, ingot_T2, plate_T2,
+ rotor_blade_T2);
+
+ UtilsRecipe.recipeBuilder(
+ plate_T3, ingot_T3, plate_T3,
+ plate_T3, ingot_T3, plate_T3,
+ plate_T3, ingot_T3, plate_T3,
+ rotor_blade_T3);
+
+ UtilsRecipe.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, 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, 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, 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, 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
+ UtilsRecipe.recipeBuilder(
+ null, rotor_blade_T1, null,
+ rotor_blade_T1, shaft_T1, rotor_blade_T1,
+ null, rotor_blade_T1, null,
+ rotor_T1);
+
+ UtilsRecipe.recipeBuilder(
+ null, rotor_blade_T2, null,
+ rotor_blade_T2, shaft_T2, rotor_blade_T2,
+ null, rotor_blade_T2, null,
+ rotor_T2);
+
+ UtilsRecipe.recipeBuilder(
+ null, rotor_blade_T3, null,
+ rotor_blade_T3, shaft_T3, rotor_blade_T3,
+ null, rotor_blade_T3, null,
+ rotor_T3);
+
+ UtilsRecipe.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
new file mode 100644
index 0000000000..2e13745564
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/psychedelicraft/HANDLER_Psych.java
@@ -0,0 +1,27 @@
+package gtPlusPlus.xmod.psychedelicraft;
+
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.xmod.psychedelicraft.fluids.PS_Fluids;
+
+
+public class HANDLER_Psych {
+
+ public static void preInit(){
+ if (LoadedMods.Psychedelicraft){
+ PS_Fluids.registerFluids();
+ }
+ }
+
+ public static void init(){
+ if (LoadedMods.Psychedelicraft){
+ PS_Fluids.registerAlcohols();
+ }
+ }
+
+ public static void postInit(){
+ if (LoadedMods.Psychedelicraft){
+
+ }
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/psychedelicraft/fluids/PS_Fluids.java b/src/Java/gtPlusPlus/xmod/psychedelicraft/fluids/PS_Fluids.java
new file mode 100644
index 0000000000..4de44c7efc
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/psychedelicraft/fluids/PS_Fluids.java
@@ -0,0 +1,54 @@
+package gtPlusPlus.xmod.psychedelicraft.fluids;
+
+import gtPlusPlus.core.lib.CORE;
+import ivorius.ivtoolkit.gui.IntegerRange;
+import ivorius.psychedelicraft.blocks.TileEntityMashTub;
+import ivorius.psychedelicraft.config.PSConfig;
+import ivorius.psychedelicraft.fluids.FluidAlcohol;
+import ivorius.psychedelicraft.items.PSItems;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.oredict.ShapelessOreRecipe;
+import cpw.mods.fml.common.registry.GameRegistry;
+
+public class PS_Fluids {
+
+ public static FluidAlcohol alcJD;
+
+ public static void registerFluids(){
+ alcJD = new FluidAlcohol("psc_JD", 2, 0.45D, 1.9D, 0.15D, PSConfig.alcInfoPotato);
+ alcJD.addName(CORE.MODID + ":" + "drinkMash", new IntegerRange(0, -1), new IntegerRange(0, 0));
+ alcJD.addName(CORE.MODID + ":" + "drinkAgedWhisky", new IntegerRange(0, 0), new IntegerRange(1, -1));
+ alcJD.addName(CORE.MODID + ":" + "drinkWhisky", new IntegerRange(0, -1), new IntegerRange(1, -1));
+ alcJD.setColor(-1426150904);
+ alcJD.setStillIconName(CORE.MODID + ":" + "mash_still");
+ alcJD.setFlowingIconName(CORE.MODID + ":" + "mash_flow");
+ alcJD.addIcon(new IntegerRange(-1, -1), new IntegerRange(0, 3), new IntegerRange(2, -1), CORE.MODID + ":" + "clear_still", CORE.MODID + ":" + "clear_flow");
+ alcJD.addIcon(new IntegerRange(-1, -1), new IntegerRange(4, 13), new IntegerRange(0, -1), CORE.MODID + ":" + "rum_semi_mature_still", CORE.MODID + ":" + "rum_semi_mature_flow");
+ alcJD.addIcon(new IntegerRange(-1, -1), new IntegerRange(14, -1), new IntegerRange(0, -1), CORE.MODID + ":" + "rum_mature_still", CORE.MODID + ":" + "rum_mature_flow");
+ FluidRegistry.registerFluid(alcJD);
+ }
+
+ public static void registerAlcohols(){
+ addMashTubRecipe2(new FluidStack(alcJD, TileEntityMashTub.MASH_TUB_CAPACITY), new Object[] { "foodPotato", "foodPotato", "foodPotato", "foodPotato", "foodPotato", "foodBanana", "foodBanana", "foodBanana" });
+ }
+
+ private static void addMashTubRecipe2(FluidStack fluid, Object... ingredients)
+ {
+ ItemStack mashTubStack = new ItemStack(PSItems.itemMashTub);
+ PSItems.itemMashTub.fill(mashTubStack, fluid, true);
+
+ Object[] ing = new Object[ingredients.length + 1];
+ System.arraycopy(ingredients, 0, ing, 1, ingredients.length);
+ ing[0] = new ItemStack(PSItems.itemMashTub);
+
+ addShapelessRecipe2(mashTubStack, ing);
+ }
+
+ private static void addShapelessRecipe2(ItemStack output, Object... params)
+ {
+ GameRegistry.addRecipe(new ShapelessOreRecipe(output, params));
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java
new file mode 100644
index 0000000000..e28ad4a145
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/HANDLER_TF.java
@@ -0,0 +1,37 @@
+package gtPlusPlus.xmod.thermalfoundation;
+
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.xmod.thermalfoundation.block.TF_Blocks;
+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 static void preInit(){
+ if (LoadedMods.CoFHCore){
+ TF_Fluids.preInit();
+ TF_Items.preInit();
+ TF_Blocks.preInit();
+ }
+ }
+
+ public static void init(){
+ if (LoadedMods.CoFHCore){
+ TF_Fluids.init();
+ TF_Blocks.init();
+ TF_Items.init();
+ }
+ }
+
+ public static void postInit(){
+ if (LoadedMods.CoFHCore){
+ TF_Fluids.postInit();
+ TF_Items.postInit();
+ TF_Blocks.postInit();
+ if(LoadedMods.Gregtech){
+ TF_Gregtech_Recipes.run();
+ }
+ }
+ }
+}
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
new file mode 100644
index 0000000000..58afd0c52c
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Cryotheum.java
@@ -0,0 +1,189 @@
+package gtPlusPlus.xmod.thermalfoundation.block;
+
+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.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.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
+{
+ 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
new file mode 100644
index 0000000000..f45cc1d839
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Block_Fluid_Pyrotheum.java
@@ -0,0 +1,182 @@
+package gtPlusPlus.xmod.thermalfoundation.block;
+
+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.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;
+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
+{
+ 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
new file mode 100644
index 0000000000..867f8c7f7d
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/block/TF_Blocks.java
@@ -0,0 +1,26 @@
+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 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
new file mode 100644
index 0000000000..984ff4604b
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/fluid/TF_Fluids.java
@@ -0,0 +1,67 @@
+package gtPlusPlus.xmod.thermalfoundation.fluid;
+
+import gtPlusPlus.core.lib.LoadedMods;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.xmod.thermalfoundation.item.TF_Items;
+import net.minecraft.block.BlockDispenser;
+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 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 init() {}
+
+ 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
new file mode 100644
index 0000000000..86037d3a0c
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/item/TF_Items.java
@@ -0,0 +1,79 @@
+package gtPlusPlus.xmod.thermalfoundation.item;
+
+import gtPlusPlus.core.creative.AddToCreativeTab;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.xmod.thermalfoundation.block.TF_Blocks;
+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 preInit(){
+
+
+ itemBucket = (ItemBucket)new ItemBucket("GTplusplus").setUnlocalizedName("bucket").setCreativeTab(AddToCreativeTab.tabMisc);
+ itemMaterial = (ItemBase)new ItemBase("GTplusplus").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);
+
+
+ itemRodBlizz = UtilsItems.simpleMetaStack(itemMaterial, 1, 1);
+ itemDustBlizz = UtilsItems.simpleMetaStack(itemMaterial, 2, 1);
+ itemDustPyrotheum = UtilsItems.simpleMetaStack(itemMaterial, 3, 1);
+ itemDustCryotheum = UtilsItems.simpleMetaStack(itemMaterial, 4, 1);
+
+
+
+ }
+
+ 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);
+
+
+ }
+
+ public static void postInit(){
+
+ 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" }));
+
+
+
+ }
+
+}
diff --git a/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java
new file mode 100644
index 0000000000..24096749f2
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/thermalfoundation/recipe/TF_Gregtech_Recipes.java
@@ -0,0 +1,62 @@
+package gtPlusPlus.xmod.thermalfoundation.recipe;
+
+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;
+import gtPlusPlus.core.util.item.UtilsItems;
+import gtPlusPlus.xmod.thermalfoundation.item.TF_Items;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidRegistry;
+import net.minecraftforge.fluids.FluidStack;
+
+public class TF_Gregtech_Recipes {
+
+ public static void run(){
+ start();
+ }
+
+ 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 = UtilsItems.simpleMetaStack(TF_Items.itemMaterial, 2, 3);
+ ItemStack rod_Blizz = TF_Items.itemRodBlizz.copy();
+ FluidStack moltenRedstone = getFluidStack("molten.redstone", 250);
+
+ //Gelid Cryotheum
+ Utils.LOG_INFO("Adding Recipes for Gelid Cryotheum");
+ 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
+ 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);
+
+ //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_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, 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;
+ }
+
+ }
+
+}