From ddf455fbe95c5328ac82bea5da22cd157fb5d0ef Mon Sep 17 00:00:00 2001 From: Adubbz G Date: Fri, 21 Jun 2013 15:36:29 +1000 Subject: [PATCH] Added Tinkers Construct integration. Material likely needs some tweaking and the textures need to be changed, but is for the most part done --- .../biomesoplenty/BiomesOPlenty.java | 3 + .../configuration/BOPConfiguration.java | 60 ++ .../handlers/EntityEventHandler.java | 1 + .../biomesoplenty/helpers/Localizations.java | 67 +- .../integration/BOPCrossIntegration.java | 17 +- .../integration/TConstructIntegration.java | 21 + .../tinkersconstruct/BOPCraftingItem.java | 61 ++ .../tinkersconstruct/BOPToolPart.java | 42 + .../tinkersconstruct/BOPToolShard.java | 46 ++ .../integration/tinkersconstruct/TCItems.java | 122 +++ .../BiomesOPlenty/localizations/en_US.xml | 2 + .../textures/items/axe/alumite_axe_handle.png | Bin 0 -> 104 bytes .../textures/items/axe/alumite_axe_head.png | Bin 0 -> 208 bytes .../items/axe/alumite_axe_head_broken.png | Bin 0 -> 125 bytes .../battleaxe/amethyst_battleaxe_back.png | Bin 0 -> 102 bytes .../battleaxe/amethyst_battleaxe_backhead.png | Bin 0 -> 127 bytes .../battleaxe/amethyst_battleaxe_binding.png | Bin 0 -> 102 bytes .../battleaxe/amethyst_battleaxe_front.png | Bin 0 -> 121 bytes .../amethyst_battleaxe_fronthead.png | Bin 0 -> 121 bytes .../amethyst_battleaxe_fronthead_broken.png | Bin 0 -> 129 bytes .../battleaxe/amethyst_battleaxe_handle.png | Bin 0 -> 108 bytes .../battleaxe/amethyst_battleaxe_head.png | Bin 0 -> 127 bytes .../amethyst_battleaxe_head_broken.png | Bin 0 -> 129 bytes .../battlesign/amethyst_battlesign_handle.png | Bin 0 -> 108 bytes .../battlesign/amethyst_battlesign_head.png | Bin 0 -> 152 bytes .../amethyst_battlesign_head_broken.png | Bin 0 -> 172 bytes .../broadsword/amethyst_sword_accessory.png | Bin 0 -> 219 bytes .../items/broadsword/amethyst_sword_blade.png | Bin 0 -> 170 bytes .../amethyst_sword_blade_broken.png | Bin 0 -> 209 bytes .../broadsword/amethyst_sword_handle.png | Bin 0 -> 173 bytes .../items/chisel/amethyst_chisel_handle.png | Bin 0 -> 157 bytes .../items/chisel/amethyst_chisel_head.png | Bin 0 -> 276 bytes .../chisel/amethyst_chisel_head_broken.png | Bin 0 -> 220 bytes .../items/cleaver/amethyst_cleaver_guard.png | Bin 0 -> 193 bytes .../items/cleaver/amethyst_cleaver_handle.png | Bin 0 -> 148 bytes .../items/cleaver/amethyst_cleaver_head.png | Bin 0 -> 253 bytes .../cleaver/amethyst_cleaver_head_broken.png | Bin 0 -> 199 bytes .../items/cleaver/amethyst_cleaver_shield.png | Bin 0 -> 276 bytes .../items/cutlass/amethyst_cutlass_blade.png | Bin 0 -> 273 bytes .../cutlass/amethyst_cutlass_blade_broken.png | Bin 0 -> 294 bytes .../items/cutlass/amethyst_cutlass_guard.png | Bin 0 -> 170 bytes .../items/cutlass/amethyst_cutlass_handle.png | Bin 0 -> 182 bytes .../dagger/amethyst_dagger_accessory.png | Bin 0 -> 179 bytes .../items/dagger/amethyst_dagger_blade.png | Bin 0 -> 270 bytes .../dagger/amethyst_dagger_blade_broken.png | Bin 0 -> 225 bytes .../items/dagger/amethyst_dagger_handle.png | Bin 0 -> 154 bytes .../excavator/amethyst_excavator_binding.png | Bin 0 -> 309 bytes .../excavator/amethyst_excavator_grip.png | Bin 0 -> 190 bytes .../excavator/amethyst_excavator_handle.png | Bin 0 -> 192 bytes .../excavator/amethyst_excavator_head.png | Bin 0 -> 268 bytes .../amethyst_excavator_head_broken.png | Bin 0 -> 156 bytes .../items/frypan/amethyst_frypan_handle.png | Bin 0 -> 107 bytes .../items/frypan/amethyst_frypan_head.png | Bin 0 -> 176 bytes .../frypan/amethyst_frypan_head_broken.png | Bin 0 -> 187 bytes .../items/hammer/amethyst_hammer_back.png | Bin 0 -> 120 bytes .../items/hammer/amethyst_hammer_front.png | Bin 0 -> 116 bytes .../items/hammer/amethyst_hammer_handle.png | Bin 0 -> 101 bytes .../hammer/amethyst_hammer_handle_broken.png | Bin 0 -> 118 bytes .../items/hammer/amethyst_hammer_head.png | Bin 0 -> 150 bytes .../amethyst_longsword_accessory.png | Bin 0 -> 115 bytes .../longsword/amethyst_longsword_blade.png | Bin 0 -> 103 bytes .../amethyst_longsword_blade_broken.png | Bin 0 -> 107 bytes .../longsword/amethyst_longsword_handle.png | Bin 0 -> 109 bytes .../lumberaxe/amethyst_lumberaxe_binding.png | Bin 0 -> 343 bytes .../lumberaxe/amethyst_lumberaxe_handle.png | Bin 0 -> 162 bytes .../lumberaxe/amethyst_lumberaxe_head.png | Bin 0 -> 271 bytes .../amethyst_lumberaxe_head_broken.png | Bin 0 -> 200 bytes .../lumberaxe/amethyst_lumberaxe_shield.png | Bin 0 -> 250 bytes .../items/mattock/amethyst_mattock_back.png | Bin 0 -> 123 bytes .../items/mattock/amethyst_mattock_handle.png | Bin 0 -> 105 bytes .../items/mattock/amethyst_mattock_head.png | Bin 0 -> 130 bytes .../mattock/amethyst_mattock_head_broken.png | Bin 0 -> 123 bytes .../items/parts/amethyst_axe_head.png | Bin 0 -> 305 bytes .../items/parts/amethyst_battlesign_head.png | Bin 0 -> 151 bytes .../textures/items/parts/amethyst_binding.png | Bin 0 -> 206 bytes .../items/parts/amethyst_chisel_head.png | Bin 0 -> 282 bytes .../textures/items/parts/amethyst_chunk.png | Bin 0 -> 378 bytes .../items/parts/amethyst_crossbar.png | Bin 0 -> 223 bytes .../items/parts/amethyst_excavator_head.png | Bin 0 -> 274 bytes .../items/parts/amethyst_frypan_head.png | Bin 0 -> 173 bytes .../items/parts/amethyst_full_guard.png | Bin 0 -> 249 bytes .../items/parts/amethyst_hammer_head.png | Bin 0 -> 344 bytes .../items/parts/amethyst_knife_blade.png | Bin 0 -> 263 bytes .../items/parts/amethyst_large_guard.png | Bin 0 -> 286 bytes .../parts/amethyst_large_sword_blade.png | Bin 0 -> 204 bytes .../items/parts/amethyst_largeplate.png | Bin 0 -> 169 bytes .../items/parts/amethyst_lumberaxe_head.png | Bin 0 -> 266 bytes .../items/parts/amethyst_medium_guard.png | Bin 0 -> 297 bytes .../items/parts/amethyst_pickaxe_head.png | Bin 0 -> 419 bytes .../textures/items/parts/amethyst_rod.png | Bin 0 -> 214 bytes .../items/parts/amethyst_scythe_head.png | Bin 0 -> 365 bytes .../items/parts/amethyst_shovel_head.png | Bin 0 -> 270 bytes .../items/parts/amethyst_sword_blade.png | Bin 0 -> 157 bytes .../items/parts/amethyst_toughbind.png | Bin 0 -> 314 bytes .../items/parts/amethyst_toughrod.png | Bin 0 -> 107 bytes .../pickaxe/amethyst_pickaxe_accessory.png | Bin 0 -> 102 bytes .../items/pickaxe/amethyst_pickaxe_handle.png | Bin 0 -> 110 bytes .../items/pickaxe/amethyst_pickaxe_head.png | Bin 0 -> 136 bytes .../pickaxe/amethyst_pickaxe_head_broken.png | Bin 0 -> 122 bytes .../items/rapier/alumite_rapier_accessory.png | Bin 0 -> 112 bytes .../items/rapier/alumite_rapier_blade.png | Bin 0 -> 100 bytes .../rapier/alumite_rapier_blade_broken.png | Bin 0 -> 95 bytes .../items/rapier/alumite_rapier_handle.png | Bin 0 -> 101 bytes .../items/scythe/alumite_scythe_accessory.png | Bin 0 -> 107 bytes .../items/scythe/alumite_scythe_binding.png | Bin 0 -> 103 bytes .../items/scythe/alumite_scythe_handle.png | Bin 0 -> 157 bytes .../items/scythe/alumite_scythe_head.png | Bin 0 -> 122 bytes .../scythe/alumite_scythe_head_broken.png | Bin 0 -> 112 bytes .../items/shovel/alumite_shovel_handle.png | Bin 0 -> 175 bytes .../items/shovel/alumite_shovel_head.png | Bin 0 -> 228 bytes .../shovel/alumite_shovel_head_broken.png | Bin 0 -> 228 bytes .../tconstruct/library/ActiveToolMod.java | 58 ++ .../library/TConstructRegistry.java | 353 ++++++++ .../library/blocks/InventoryBlock.java | 157 ++++ .../library/blocks/InventoryLogic.java | 174 ++++ .../client/TConstructClientRegistry.java | 148 ++++ .../library/client/ToolGuiElement.java | 25 + .../tconstruct/library/crafting/AlloyMix.java | 93 +++ .../library/crafting/CastingRecipe.java | 35 + .../library/crafting/Detailing.java | 126 +++ .../library/crafting/LiquidCasting.java | 84 ++ .../library/crafting/PatternBuilder.java | 227 ++++++ .../library/crafting/ShapelessToolRecipe.java | 68 ++ .../tconstruct/library/crafting/Smeltery.java | 172 ++++ .../library/crafting/ToolBuilder.java | 397 +++++++++ .../library/crafting/ToolRecipe.java | 130 +++ .../library/event/ToolCraftEvent.java | 24 + .../library/tools/AbilityHelper.java | 522 ++++++++++++ .../library/tools/DualHarvestTool.java | 138 ++++ .../tconstruct/library/tools/HarvestTool.java | 128 +++ .../tconstruct/library/tools/ToolCore.java | 758 ++++++++++++++++++ .../library/tools/ToolMaterial.java | 83 ++ .../tconstruct/library/tools/ToolMod.java | 210 +++++ .../tconstruct/library/tools/Weapon.java | 113 +++ .../tconstruct/library/util/CoordTuple.java | 54 ++ .../tconstruct/library/util/IActiveLogic.java | 7 + .../tconstruct/library/util/IFacingLogic.java | 11 + .../tconstruct/library/util/IMasterLogic.java | 6 + .../tconstruct/library/util/IPattern.java | 10 + .../library/util/IServantLogic.java | 9 + .../tconstruct/library/util/IToolPart.java | 13 + .../library/util/PiercingEntityDamage.java | 13 + .../tconstruct/library/util/TabTools.java | 24 + 143 files changed, 4790 insertions(+), 22 deletions(-) create mode 100644 src/minecraft/biomesoplenty/integration/TConstructIntegration.java create mode 100644 src/minecraft/biomesoplenty/integration/tinkersconstruct/BOPCraftingItem.java create mode 100644 src/minecraft/biomesoplenty/integration/tinkersconstruct/BOPToolPart.java create mode 100644 src/minecraft/biomesoplenty/integration/tinkersconstruct/BOPToolShard.java create mode 100644 src/minecraft/biomesoplenty/integration/tinkersconstruct/TCItems.java create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/axe/alumite_axe_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/axe/alumite_axe_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/axe/alumite_axe_head_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_back.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_backhead.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_binding.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_front.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_fronthead.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_fronthead_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_head_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/battlesign/amethyst_battlesign_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/battlesign/amethyst_battlesign_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/battlesign/amethyst_battlesign_head_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/broadsword/amethyst_sword_accessory.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/broadsword/amethyst_sword_blade.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/broadsword/amethyst_sword_blade_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/broadsword/amethyst_sword_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/chisel/amethyst_chisel_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/chisel/amethyst_chisel_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/chisel/amethyst_chisel_head_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/cleaver/amethyst_cleaver_guard.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/cleaver/amethyst_cleaver_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/cleaver/amethyst_cleaver_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/cleaver/amethyst_cleaver_head_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/cleaver/amethyst_cleaver_shield.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/cutlass/amethyst_cutlass_blade.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/cutlass/amethyst_cutlass_blade_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/cutlass/amethyst_cutlass_guard.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/cutlass/amethyst_cutlass_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/dagger/amethyst_dagger_accessory.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/dagger/amethyst_dagger_blade.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/dagger/amethyst_dagger_blade_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/dagger/amethyst_dagger_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/excavator/amethyst_excavator_binding.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/excavator/amethyst_excavator_grip.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/excavator/amethyst_excavator_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/excavator/amethyst_excavator_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/excavator/amethyst_excavator_head_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/frypan/amethyst_frypan_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/frypan/amethyst_frypan_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/frypan/amethyst_frypan_head_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/hammer/amethyst_hammer_back.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/hammer/amethyst_hammer_front.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/hammer/amethyst_hammer_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/hammer/amethyst_hammer_handle_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/hammer/amethyst_hammer_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/longsword/amethyst_longsword_accessory.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/longsword/amethyst_longsword_blade.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/longsword/amethyst_longsword_blade_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/longsword/amethyst_longsword_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/lumberaxe/amethyst_lumberaxe_binding.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/lumberaxe/amethyst_lumberaxe_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/lumberaxe/amethyst_lumberaxe_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/lumberaxe/amethyst_lumberaxe_head_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/lumberaxe/amethyst_lumberaxe_shield.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/mattock/amethyst_mattock_back.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/mattock/amethyst_mattock_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/mattock/amethyst_mattock_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/mattock/amethyst_mattock_head_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_axe_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_battlesign_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_binding.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_chisel_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_chunk.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_crossbar.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_excavator_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_frypan_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_full_guard.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_hammer_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_knife_blade.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_large_guard.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_large_sword_blade.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_largeplate.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_lumberaxe_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_medium_guard.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_pickaxe_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_rod.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_scythe_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_shovel_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_sword_blade.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_toughbind.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_toughrod.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/pickaxe/amethyst_pickaxe_accessory.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/pickaxe/amethyst_pickaxe_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/pickaxe/amethyst_pickaxe_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/pickaxe/amethyst_pickaxe_head_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/rapier/alumite_rapier_accessory.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/rapier/alumite_rapier_blade.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/rapier/alumite_rapier_blade_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/rapier/alumite_rapier_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/scythe/alumite_scythe_accessory.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/scythe/alumite_scythe_binding.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/scythe/alumite_scythe_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/scythe/alumite_scythe_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/scythe/alumite_scythe_head_broken.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/shovel/alumite_shovel_handle.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/shovel/alumite_shovel_head.png create mode 100755 src/minecraft/mods/BiomesOPlenty/textures/items/shovel/alumite_shovel_head_broken.png create mode 100755 src/minecraft/mods/tinker/tconstruct/library/ActiveToolMod.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/TConstructRegistry.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/blocks/InventoryBlock.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/blocks/InventoryLogic.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/client/TConstructClientRegistry.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/client/ToolGuiElement.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/crafting/AlloyMix.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/crafting/CastingRecipe.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/crafting/Detailing.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/crafting/LiquidCasting.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/crafting/PatternBuilder.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/crafting/ShapelessToolRecipe.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/crafting/Smeltery.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/crafting/ToolBuilder.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/crafting/ToolRecipe.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/event/ToolCraftEvent.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/tools/AbilityHelper.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/tools/DualHarvestTool.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/tools/HarvestTool.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/tools/ToolCore.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/tools/ToolMaterial.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/tools/ToolMod.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/tools/Weapon.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/util/CoordTuple.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/util/IActiveLogic.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/util/IFacingLogic.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/util/IMasterLogic.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/util/IPattern.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/util/IServantLogic.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/util/IToolPart.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/util/PiercingEntityDamage.java create mode 100755 src/minecraft/mods/tinker/tconstruct/library/util/TabTools.java diff --git a/src/minecraft/biomesoplenty/BiomesOPlenty.java b/src/minecraft/biomesoplenty/BiomesOPlenty.java index a5081af5c..334836a17 100644 --- a/src/minecraft/biomesoplenty/BiomesOPlenty.java +++ b/src/minecraft/biomesoplenty/BiomesOPlenty.java @@ -30,6 +30,7 @@ import biomesoplenty.helpers.CreativeTabsBOP; import biomesoplenty.helpers.Localizations; import biomesoplenty.helpers.Version; import biomesoplenty.integration.BOPCrossIntegration; +import biomesoplenty.integration.TConstructIntegration; import biomesoplenty.world.WorldProviderBOPhell; import biomesoplenty.world.WorldProviderPromised; import biomesoplenty.world.WorldTypeSize; @@ -91,6 +92,8 @@ public class BiomesOPlenty GameRegistry.registerCraftingHandler(new BOPCraftHandler()); MinecraftForge.EVENT_BUS.register(new SoundHandler()); + + BOPCrossIntegration.preInit(); } @Init diff --git a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java index 336c7b47c..db545bcfa 100644 --- a/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java +++ b/src/minecraft/biomesoplenty/configuration/BOPConfiguration.java @@ -4,11 +4,14 @@ import java.io.File; import java.util.logging.Level; import biomesoplenty.BiomesOPlenty; +import biomesoplenty.integration.TConstructIntegration; +import net.minecraft.item.Item; import net.minecraftforge.common.Configuration; import net.minecraftforge.common.Property; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.Loader; public class BOPConfiguration { @@ -256,6 +259,35 @@ public class BOPConfiguration { public static int scytheAmethystID; public static int flowerBandID; + + //Tinkers Construct Compat Item IDs + + public static int bindingID; + public static int toughBindingID; + public static int toughRodID; + public static int heavyPlateID; + + public static int toolRodID; + public static int toolShardID; + + public static int pickaxeHeadID; + public static int shovelHeadID; + public static int hatchetHeadID; + public static int frypanHeadID; + public static int signHeadID; + public static int chiselHeadID; + public static int scytheBladeID; + public static int broadAxeHeadID; + public static int excavatorHeadID; + public static int hammerHeadID; + + public static int swordBladeID; + public static int largeSwordBladeID; + public static int knifeBladeID; + + public static int wideGuardID; + public static int handGuardID; + public static int crossbarID; //Liquid IDs public static int springWaterStillID; @@ -814,7 +846,35 @@ public class BOPConfiguration { scytheDiamondID = config.getItem("Diamond Scythe ID", 21085).getInt(); scytheMudID = config.getItem("Mud Scythe ID", 21086).getInt(); scytheAmethystID = config.getItem("Amethyst Scythe ID", 21087).getInt(); + + bindingID = config.get("TC Compat IDs", "Binding ID", 21088).getInt(); + toughBindingID = config.get("TC Compat IDs", "Tough Binding ID", 21089).getInt(); + toughRodID = config.get("TC Compat IDs", "Tough Rod ID", 21090).getInt(); + heavyPlateID = config.get("TC Compat IDs", "Heavy Plate", 21091).getInt(); + + toolRodID = config.get("TC Compat IDs", "Tool Rod ID", 21092).getInt(); + toolShardID = config.get("TC Compat IDs", "Tool Shard ID", 21093).getInt(); + pickaxeHeadID = config.get("TC Compat IDs", "Pickaxe Head", 21094).getInt(); + shovelHeadID = config.get("TC Compat IDs", "Shovel Head", 21095).getInt(); + hatchetHeadID = config.get("TC Compat IDs", "Hatchet Head", 21906).getInt(); + frypanHeadID = config.get("TC Compat IDs", "Frypan Head", 21097).getInt(); + signHeadID = config.get("TC Compat IDs", "Sign Head", 21098).getInt(); + chiselHeadID = config.get("TC Compat IDs", "Chisel Head", 21099).getInt(); + scytheBladeID = config.get("TC Compat IDs", "Scythe Blade", 21100).getInt(); + broadAxeHeadID = config.get("TC Compat IDs", "Broad Axe Head", 21101).getInt(); + excavatorHeadID = config.get("TC Compat IDs", "Excavator Head", 21102).getInt(); + hammerHeadID = config.get("TC Compat IDs", "Hammer Head", 21103).getInt(); + + swordBladeID = config.get("TC Compat IDs", "Sword Blad", 21104).getInt(); + largeSwordBladeID = config.get("TC Compat IDs", "Large Sword Blade", 21105).getInt(); + knifeBladeID = config.get("TC Compat IDs", "Knife Blade", 21106).getInt(); + + wideGuardID = config.get("TC Compat IDs", "Wide Guard", 21107).getInt(); + handGuardID = config.get("TC Compat IDs", "Hand Guard", 21108).getInt(); + crossbarID = config.get("TC Compat IDs", "Crossbar", 21109).getInt(); + + //Reserve 10 Item IDs for future TC items //Liquid Ids springWaterStillID = config.get("Liquid IDs", "Spring Water Still ID (ID before this must be free!)", 1971, null).getInt(); diff --git a/src/minecraft/biomesoplenty/handlers/EntityEventHandler.java b/src/minecraft/biomesoplenty/handlers/EntityEventHandler.java index 813217a06..e8704f2e8 100644 --- a/src/minecraft/biomesoplenty/handlers/EntityEventHandler.java +++ b/src/minecraft/biomesoplenty/handlers/EntityEventHandler.java @@ -30,6 +30,7 @@ import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.living.LivingHurtEvent; import net.minecraftforge.event.entity.living.LivingSpawnEvent.CheckSpawn; import net.minecraftforge.event.entity.player.EntityInteractEvent; +import biomesoplenty.api.Biomes; import biomesoplenty.api.Blocks; import biomesoplenty.api.Items; import biomesoplenty.configuration.BOPConfiguration; diff --git a/src/minecraft/biomesoplenty/helpers/Localizations.java b/src/minecraft/biomesoplenty/helpers/Localizations.java index e57762af0..8979a13d0 100644 --- a/src/minecraft/biomesoplenty/helpers/Localizations.java +++ b/src/minecraft/biomesoplenty/helpers/Localizations.java @@ -9,29 +9,54 @@ public class Localizations { private static final String localizationLocation = "/mods/BiomesOPlenty/localizations/"; - public static String[] localeFiles = { localizationLocation + "en_US.xml", localizationLocation + "de_DE.xml", localizationLocation + "nl_NL.xml" }; - - public static boolean isXMLLanguageFile(String fileName) - { - return fileName.endsWith(".xml"); - } + public static String[] localeFiles = { localizationLocation + "en_US.xml", localizationLocation + "de_DE.xml", localizationLocation + "nl_NL.xml" }; - public static String getLocaleFromFileName(String fileName) - { - FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[BiomesOPlenty] Localizations loaded for " + fileName.substring(fileName.lastIndexOf('/') + 1, fileName.lastIndexOf('.'))); - return fileName.substring(fileName.lastIndexOf('/') + 1, fileName.lastIndexOf('.')); - } + public static boolean isXMLLanguageFile(String fileName) + { + return fileName.endsWith(".xml"); + } - public String getLocalizedString(String key) - { - return LanguageRegistry.instance().getStringLocalization(key); - } - - public static void loadLanguages() - { - for (String localizationFile : localeFiles) + public static String getLocaleFromFileName(String fileName) + { + FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[BiomesOPlenty] Localizations loaded for " + fileName.substring(fileName.lastIndexOf('/') + 1, fileName.lastIndexOf('.'))); + return fileName.substring(fileName.lastIndexOf('/') + 1, fileName.lastIndexOf('.')); + } + + public String getLocalizedString(String key) + { + return LanguageRegistry.instance().getStringLocalization(key); + } + + public static void loadLanguages() + { + for (String localizationFile : localeFiles) + { + LanguageRegistry.instance().loadLocalization(localizationFile, getLocaleFromFileName(localizationFile), isXMLLanguageFile(localizationFile)); + } + + for (int mat = 0; mat < materialTypes.length; mat++) + { + for (int type = 0; type < toolMaterialNames.length; type++) + { + String internalName = new StringBuilder().append("item.bop.tc.").append(materialTypes[mat]).append(".").append(toolMaterialNames[type]).append(".name").toString(); + String visibleName = new StringBuilder().append(toolMaterialNames[type]).append(materialNames[mat]).toString(); + LanguageRegistry.instance().addStringLocalization(internalName, "en_US", visibleName); + } + } + + for (int i = 0; i < shardNames.length; i++) { - LanguageRegistry.instance().loadLocalization(localizationFile, getLocaleFromFileName(localizationFile), isXMLLanguageFile(localizationFile)); + String internalName = "item.bop.tc.ToolShard." + toolMaterialNames[i] + ".name"; + String visibleName = shardNames[i]; + LanguageRegistry.instance().addStringLocalization(internalName, "en_US", visibleName); } - } + } + + public static final String[] shardNames = new String[] { "Amethyst" }; + + public static final String[] toolMaterialNames = new String[] { "Amethyst" }; + + public static final String[] materialTypes = new String[] { "ToolRod", "PickaxeHead", "ShovelHead", "AxeHead", "SwordBlade", "LargeGuard", "MediumGuard", "Crossbar", "Binding", "FrypanHead", "SignHead", "LumberHead", "KnifeBlade", "ChiselHead", "ScytheBlade", "LumberHead", "ThickRod", "ThickBinding", "LargeSwordBlade", "LargePlate", "ExcavatorHead", "HammerHead", "FullGuard" }; + + public static final String[] materialNames = new String[] { " Rod", " Pickaxe Head", " Shovel Head", " Axe Head", " Sword Blade", " Wide Guard", " Hand Guard", " Crossbar", " Binding", " Pan", " Board", " Broad Axe Head", " Knife Blade", " Chisel Head", " Scythe Blade", " Broad Axe Head", " Tough Tool Rod", " Tough Binding", " Large Sword Blade", " Large Plate", " Excavator Head", " Hammer Head", " Full Guard"}; } diff --git a/src/minecraft/biomesoplenty/integration/BOPCrossIntegration.java b/src/minecraft/biomesoplenty/integration/BOPCrossIntegration.java index 3bff3e4e6..615bab9e7 100644 --- a/src/minecraft/biomesoplenty/integration/BOPCrossIntegration.java +++ b/src/minecraft/biomesoplenty/integration/BOPCrossIntegration.java @@ -3,6 +3,10 @@ package biomesoplenty.integration; import cpw.mods.fml.common.Loader; public class BOPCrossIntegration { + + public static void preInit() + { + } public static void init() { @@ -16,7 +20,18 @@ public class BOPCrossIntegration { e.printStackTrace(System.err); } } - + + if (Loader.isModLoaded("TConstruct")) + { + try { + TConstructIntegration.init(); + } + catch (Exception e) { + System.out.println("[BiomesOPlenty] There was an error while integrating TConstruct with Biomes O' Plenty!"); + e.printStackTrace(System.err); + } + } + if (Loader.isModLoaded("Thaumcraft")) { try { diff --git a/src/minecraft/biomesoplenty/integration/TConstructIntegration.java b/src/minecraft/biomesoplenty/integration/TConstructIntegration.java new file mode 100644 index 000000000..992aa56ec --- /dev/null +++ b/src/minecraft/biomesoplenty/integration/TConstructIntegration.java @@ -0,0 +1,21 @@ +package biomesoplenty.integration; + +import mods.tinker.tconstruct.library.TConstructRegistry; +import net.minecraft.item.ItemStack; +import biomesoplenty.api.Blocks; +import biomesoplenty.integration.tinkersconstruct.TCItems; +import cpw.mods.fml.common.event.FMLInterModComms; + +public class TConstructIntegration +{ + public static void init() + { + addMaterials(); + TCItems.init(); + } + + private static void addMaterials() + { + TConstructRegistry.addToolMaterial(150, "Amethyst", 4, 750, 800, 3, 1.3F, 2, 0f, "", ""); + } +} diff --git a/src/minecraft/biomesoplenty/integration/tinkersconstruct/BOPCraftingItem.java b/src/minecraft/biomesoplenty/integration/tinkersconstruct/BOPCraftingItem.java new file mode 100644 index 000000000..49fe8b411 --- /dev/null +++ b/src/minecraft/biomesoplenty/integration/tinkersconstruct/BOPCraftingItem.java @@ -0,0 +1,61 @@ +package biomesoplenty.integration.tinkersconstruct; + +import java.util.List; + +import mods.tinker.tconstruct.library.TConstructRegistry; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.util.MathHelper; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BOPCraftingItem extends Item +{ + public String[] textureNames; + public String[] unlocalizedNames; + public String folder; + public Icon[] icons; + public BOPCraftingItem(int id, String[] names, String[] tex, String folder) + { + super(id); + this.setCreativeTab(TConstructRegistry.materialTab); + this.setMaxDamage(0); + this.setHasSubtypes(true); + this.textureNames = tex; + this.unlocalizedNames = names; + this.folder = folder; + } + + @SideOnly(Side.CLIENT) + public Icon getIconFromDamage(int meta) + { + return icons[meta]; + } + + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IconRegister iconRegister) + { + this.icons = new Icon[textureNames.length]; + + for (int i = 0; i < this.icons.length; ++i) + { + this.icons[i] = iconRegister.registerIcon("BiomesOPlenty:"+folder+textureNames[i]); + } + } + + public String getUnlocalizedName(ItemStack stack) + { + int arr = MathHelper.clamp_int(stack.getItemDamage(), 0, unlocalizedNames.length); + return getUnlocalizedName() + "." +unlocalizedNames[arr]; + } + + public void getSubItems (int id, CreativeTabs tab, List list) + { + for (int i = 0; i < unlocalizedNames.length; i++) + list.add(new ItemStack(id, 1, i)); + } +} diff --git a/src/minecraft/biomesoplenty/integration/tinkersconstruct/BOPToolPart.java b/src/minecraft/biomesoplenty/integration/tinkersconstruct/BOPToolPart.java new file mode 100644 index 000000000..a1f88f575 --- /dev/null +++ b/src/minecraft/biomesoplenty/integration/tinkersconstruct/BOPToolPart.java @@ -0,0 +1,42 @@ +package biomesoplenty.integration.tinkersconstruct; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import mods.tinker.tconstruct.library.TConstructRegistry; +import mods.tinker.tconstruct.library.util.IToolPart; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.util.MathHelper; + +public class BOPToolPart extends BOPCraftingItem implements IToolPart +{ + public BOPToolPart(int id, String partType, String textureType) + { + super(id, toolMaterialNames, buildTextureNames(textureType), "parts/"); + this.setHasSubtypes(true); + this.setMaxDamage(0); + } + + private static String[] buildTextureNames (String textureType) + { + String[] names = new String[toolMaterialNames.length]; + for (int i = 0; i < toolMaterialNames.length; i++) + names[i] = toolTextureNames[i]+textureType; + return names; + } + + public static final String[] toolMaterialNames = new String[] { "Amethyst" }; + + public static final String[] toolTextureNames = new String[] { "amethyst" }; + + @Override + public int getMaterialID (ItemStack stack) + { + return 150 + stack.getItemDamage(); + } +} diff --git a/src/minecraft/biomesoplenty/integration/tinkersconstruct/BOPToolShard.java b/src/minecraft/biomesoplenty/integration/tinkersconstruct/BOPToolShard.java new file mode 100644 index 000000000..d80ef200e --- /dev/null +++ b/src/minecraft/biomesoplenty/integration/tinkersconstruct/BOPToolShard.java @@ -0,0 +1,46 @@ +package biomesoplenty.integration.tinkersconstruct; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; + +public class BOPToolShard extends BOPToolPart +{ + public BOPToolShard(int id, String part, String tex) + { + super(id, part, tex); + this.setHasSubtypes(true); + this.setMaxDamage(0); + } + + private static String[] buildTextureNames (String textureType) + { + String[] names = new String[toolMaterialNames.length]; + for (int i = 0; i < toolMaterialNames.length; i++) + names[i] = toolTextureNames[i]+textureType; + return names; + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IconRegister iconRegister) + { + this.icons = new Icon[textureNames.length]; + + for (int i = 0; i < textureNames.length; ++i) + { + this.icons[i] = iconRegister.registerIcon("BiomesOPlenty:"+folder+textureNames[i]); + } + } + + public void getSubItems (int id, CreativeTabs tab, List list) + { + for (int i = 0; i < toolMaterialNames.length; i++) + list.add(new ItemStack(id, 1, i)); + } +} diff --git a/src/minecraft/biomesoplenty/integration/tinkersconstruct/TCItems.java b/src/minecraft/biomesoplenty/integration/tinkersconstruct/TCItems.java new file mode 100644 index 000000000..6998fae33 --- /dev/null +++ b/src/minecraft/biomesoplenty/integration/tinkersconstruct/TCItems.java @@ -0,0 +1,122 @@ +package biomesoplenty.integration.tinkersconstruct; + +import java.util.Iterator; + +import mods.tinker.tconstruct.library.TConstructRegistry; +import mods.tinker.tconstruct.library.client.TConstructClientRegistry; +import mods.tinker.tconstruct.library.crafting.PatternBuilder; +import mods.tinker.tconstruct.library.crafting.ToolBuilder; +import mods.tinker.tconstruct.library.tools.ToolCore; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import biomesoplenty.api.Items; +import biomesoplenty.configuration.BOPConfiguration; + +public class TCItems +{ + public static Item binding; + public static Item toughBinding; + public static Item toughRod; + public static Item heavyPlate; + + public static Item toolRod; + public static Item toolShard; + + public static Item pickaxeHead; + public static Item shovelHead; + public static Item hatchetHead; + public static Item frypanHead; + public static Item signHead; + public static Item chiselHead; + public static Item scytheBlade; + public static Item broadAxeHead; + public static Item excavatorHead; + public static Item hammerHead; + + public static Item swordBlade; + public static Item largeSwordBlade; + public static Item knifeBlade; + + public static Item wideGuard; + public static Item handGuard; + public static Item crossbar; + + public static void init() + { + initializeItems(); + addCrafting(); + } + + private static void initializeItems() + { + toolRod = new BOPToolPart(BOPConfiguration.toolRodID, "ToolRod", "_rod").setUnlocalizedName("bop.tc.ToolRod"); + toolShard = new BOPToolShard(BOPConfiguration.toolShardID, "ToolShard", "_chunk").setUnlocalizedName("bop.tc.ToolShard"); + + pickaxeHead = new BOPToolPart(BOPConfiguration.pickaxeHeadID, "PickaxeHead", "_pickaxe_head").setUnlocalizedName("bop.tc.PickaxeHead"); + shovelHead = new BOPToolPart(BOPConfiguration.shovelHeadID, "ShovelHead", "_shovel_head").setUnlocalizedName("bop.tc.ShovelHead"); + hatchetHead = new BOPToolPart(BOPConfiguration.hatchetHeadID, "AxeHead", "_axe_head").setUnlocalizedName("bop.tc.AxeHead"); + binding = new BOPToolPart(BOPConfiguration.bindingID, "Binding", "_binding").setUnlocalizedName("bop.tc.Binding"); + toughBinding = new BOPToolPart(BOPConfiguration.toughBindingID, "ThickBinding", "_toughbind").setUnlocalizedName("bop.tc.ThickBinding"); + toughRod = new BOPToolPart(BOPConfiguration.toughRodID, "ThickRod", "_toughrod").setUnlocalizedName("bop.tc.ThickRod"); + heavyPlate = new BOPToolPart(BOPConfiguration.heavyPlateID, "LargePlate", "_largeplate").setUnlocalizedName("bop.tc.LargePlate"); + + swordBlade = new BOPToolPart(BOPConfiguration.swordBladeID, "SwordBlade", "_sword_blade").setUnlocalizedName("bop.tc.SwordBlade"); + wideGuard = new BOPToolPart(BOPConfiguration.wideGuardID, "LargeGuard", "_large_guard").setUnlocalizedName("bop.tc.LargeGuard"); + handGuard = new BOPToolPart(BOPConfiguration.handGuardID, "MediumGuard", "_medium_guard").setUnlocalizedName("bop.tc.MediumGuard"); + crossbar = new BOPToolPart(BOPConfiguration.crossbarID, "Crossbar", "_crossbar").setUnlocalizedName("bop.tc.Crossbar"); + knifeBlade = new BOPToolPart(BOPConfiguration.knifeBladeID, "KnifeBlade", "_knife_blade").setUnlocalizedName("bop.tc.KnifeBlade"); + + frypanHead = new BOPToolPart(BOPConfiguration.frypanHeadID, "FrypanHead", "_frypan_head").setUnlocalizedName("bop.tc.FrypanHead"); + signHead = new BOPToolPart(BOPConfiguration.signHeadID, "SignHead", "_battlesign_head").setUnlocalizedName("bop.tc.SignHead"); + chiselHead = new BOPToolPart(BOPConfiguration.chiselHeadID, "ChiselHead", "_chisel_head").setUnlocalizedName("bop.tc.ChiselHead"); + + scytheBlade = new BOPToolPart(BOPConfiguration.scytheBladeID, "ScytheBlade", "_scythe_head").setUnlocalizedName("bop.tc.ScytheBlade"); + broadAxeHead = new BOPToolPart(BOPConfiguration.broadAxeHeadID, "LumberHead", "_lumberaxe_head").setUnlocalizedName("bop.tc.LumberHead"); + excavatorHead = new BOPToolPart(BOPConfiguration.excavatorHeadID, "ExcavatorHead", "_excavator_head").setUnlocalizedName("bop.tc.ExcavatorHead"); + largeSwordBlade = new BOPToolPart(BOPConfiguration.largeSwordBladeID, "LargeSwordBlade", "_large_sword_blade").setUnlocalizedName("bop.tc.LargeSwordBlade"); + hammerHead = new BOPToolPart(BOPConfiguration.hammerHeadID, "HammerHead", "_hammer_head").setUnlocalizedName("bop.tc.HammerHead"); + } + + private static void addCrafting() + { + PatternBuilder pb = PatternBuilder.instance; + pb.registerFullMaterial(new ItemStack(Items.miscItems.get(), 1, 2), 2, "Amethyst", new ItemStack(toolShard, 1, 0), new ItemStack(toolRod, 1, 0), 150); + + Item[] patternOutputs = new Item[] { toolRod, pickaxeHead, shovelHead, hatchetHead, swordBlade, wideGuard, handGuard, crossbar, binding, frypanHead, signHead, knifeBlade, chiselHead, toughRod, toughBinding, heavyPlate, broadAxeHead, scytheBlade, excavatorHead, largeSwordBlade, hammerHead }; + String[] partTypes = { "amethyst" }; + + for (int mat = 0; mat < 1; mat++) + { + for (int meta = 0; meta < patternOutputs.length; meta++) + { + TConstructRegistry.addPartMapping(TConstructRegistry.getItem("woodPattern").itemID, meta + 1, 150, new ItemStack(patternOutputs[meta], 1, mat)); + } + } + + for (int partIter = 0; partIter < partTypes.length; partIter++) + { + TConstructClientRegistry.addMaterialRenderMapping(150 + partIter, "BiomesOPlenty", partTypes[partIter], true); + } + + ToolBuilder tb = ToolBuilder.instance; + tb.addNormalToolRecipe((ToolCore)TConstructRegistry.getItem("pickaxe"), pickaxeHead, toolRod, binding); + tb.addNormalToolRecipe((ToolCore)TConstructRegistry.getItem("broadsword"), swordBlade, toolRod, wideGuard); + tb.addNormalToolRecipe((ToolCore)TConstructRegistry.getItem("hatchet"), hatchetHead, toolRod); + tb.addNormalToolRecipe((ToolCore)TConstructRegistry.getItem("shovel"), shovelHead, toolRod); + tb.addNormalToolRecipe((ToolCore)TConstructRegistry.getItem("longsword"), swordBlade, toolRod, handGuard); + tb.addNormalToolRecipe((ToolCore)TConstructRegistry.getItem("rapier"), swordBlade, toolRod, crossbar); + tb.addNormalToolRecipe((ToolCore)TConstructRegistry.getItem("frypan"), frypanHead, toolRod); + tb.addNormalToolRecipe((ToolCore)TConstructRegistry.getItem("battlesign"), signHead, toolRod); + tb.addNormalToolRecipe((ToolCore)TConstructRegistry.getItem("mattock"), hatchetHead, toolRod, shovelHead); + //tb.addNormalToolRecipe((ToolCore)TConstructRegistry.getItem("dagger"), knifeBlade, crossbar); + tb.addNormalToolRecipe((ToolCore)TConstructRegistry.getItem("chisel"), chiselHead, toolRod); + tb.addNormalToolRecipe((ToolCore)TConstructRegistry.getItem("scythe"), scytheBlade, toughRod, toughBinding, toughRod); + tb.addNormalToolRecipe((ToolCore)TConstructRegistry.getItem("lumberaxe"), broadAxeHead, toughRod, heavyPlate, toughBinding); + tb.addNormalToolRecipe((ToolCore)TConstructRegistry.getItem("cleaver"), largeSwordBlade, toughRod, heavyPlate, toughRod); + tb.addNormalToolRecipe((ToolCore)TConstructRegistry.getItem("excavator"), excavatorHead, toughRod, heavyPlate, toughBinding); + tb.addNormalToolRecipe((ToolCore)TConstructRegistry.getItem("hammer"), hammerHead, toughRod, heavyPlate, heavyPlate); + tb.addNormalToolRecipe((ToolCore)TConstructRegistry.getItem("battleaxe"), broadAxeHead, toughRod, broadAxeHead, toughBinding); + } +} diff --git a/src/minecraft/mods/BiomesOPlenty/localizations/en_US.xml b/src/minecraft/mods/BiomesOPlenty/localizations/en_US.xml index 6b58f9ca8..0d86ebe1b 100644 --- a/src/minecraft/mods/BiomesOPlenty/localizations/en_US.xml +++ b/src/minecraft/mods/BiomesOPlenty/localizations/en_US.xml @@ -339,6 +339,8 @@ Lush Flower Band Exotic Flower Band + + Spring Water Bucket Liquid Poison Bucket diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/axe/alumite_axe_handle.png b/src/minecraft/mods/BiomesOPlenty/textures/items/axe/alumite_axe_handle.png new file mode 100755 index 0000000000000000000000000000000000000000..983ea25ebc344b7c233cfe2e10d75cda7a702748 GIT binary patch literal 104 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%``kpS1Ar-fh6C_xjSxnfZ|JLs@ zf4qP1qBHfIOy+}rLo7~jz39u;pdi4S;D1}! zDo8xz{<_fJyBr^^Q{Xxx^YCQKKQ_*M)%U^fivQw*FK3^6zG>H#d+w3_AB=)p87!VY zY}gw8N|5W6XG$LXbP1LxtN|x;xHe}_Zf;s0d~wfpHFnq2X&GiRj8mkpJT8%E5_9D^ z@Z0jx>8jvVhDZ0+s+s>dahy8WVAfdB5%h)IqE*0N^);LD4(HyeHLN;7Co*`t`njxg HN@xNA13W)|KC`~VFe$d_tmu=f=k_`}9^bgknkC#0YB(@6 Yu$!cu?|kZW9cUhdr>mdKI;Vst0G0eJ-~a#s literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_back.png b/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_back.png new file mode 100755 index 0000000000000000000000000000000000000000..00bc7077b73415daaa6141349acd01e3ae2b7f9c GIT binary patch literal 102 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`x}GkMAr-fh6C@%Z{JQe^zy8v< zzx=m7(@($mhy9{THrq|FZD}da5^e`I7Kk!1tUfRE>5JfQC7?zIPgg&ebxsLQ004v{ AqyPW_ literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_backhead.png b/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_backhead.png new file mode 100755 index 0000000000000000000000000000000000000000..c3cfcade0e00a5a4d4a920a43039f3f56d95d8ce GIT binary patch literal 127 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Zk{fVAr-fh6BHQqmcISPf0$

#qbt19#Fqk1WbkzLb6Mw<&;$UIJt}Sh literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_binding.png b/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_binding.png new file mode 100755 index 0000000000000000000000000000000000000000..00bc7077b73415daaa6141349acd01e3ae2b7f9c GIT binary patch literal 102 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`x}GkMAr-fh6C@%Z{JQe^zy8v< zzx=m7(@($mhy9{THrq|FZD}da5^e`I7Kk!1tUfRE>5JfQC7?zIPgg&ebxsLQ004v{ AqyPW_ literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_front.png b/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_front.png new file mode 100755 index 0000000000000000000000000000000000000000..a4fafb83d400af02c1dc537785fca9615721355f GIT binary patch literal 121 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`4xTQKAr-fh6C_wu8oe`j|7$jg zoE5)r@7Mp&XTSgN*pTAvFw61B>6zwFBpEI-T=JR5D3aMG>9FnoN}*qi8O#|N)<;H9 Uek{w#0W^!j)78&qol`;+0K+UPLjV8( literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_fronthead.png b/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_fronthead.png new file mode 100755 index 0000000000000000000000000000000000000000..a4fafb83d400af02c1dc537785fca9615721355f GIT binary patch literal 121 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`4xTQKAr-fh6C_wu8oe`j|7$jg zoE5)r@7Mp&XTSgN*pTAvFw61B>6zwFBpEI-T=JR5D3aMG>9FnoN}*qi8O#|N)<;H9 Uek{w#0W^!j)78&qol`;+0K+UPLjV8( literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_fronthead_broken.png b/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_fronthead_broken.png new file mode 100755 index 0000000000000000000000000000000000000000..7eab770413404b9f1bb3001d8cce8b0fea2f1132 GIT binary patch literal 129 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`9-c0aAr-fh6BHQqmcISPf0$

@*?E(8Do literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_handle.png b/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_handle.png new file mode 100755 index 0000000000000000000000000000000000000000..c0653a954bb63e55c292b8f0759601fe5c70c7d3 GIT binary patch literal 108 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`#-1*YAr-fh6C_xj8SbpH{q_I! zO!NOIul@Oa_WS?om&*RC-%i_P+JDPO|EvPTC68@s3JeUw-q9W(dLPULYG?3t^>bP0 Hl+XkK9ET?? literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_head.png b/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_head.png new file mode 100755 index 0000000000000000000000000000000000000000..c3cfcade0e00a5a4d4a920a43039f3f56d95d8ce GIT binary patch literal 127 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Zk{fVAr-fh6BHQqmcISPf0$

#qbt19#Fqk1WbkzLb6Mw<&;$UIJt}Sh literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_head_broken.png b/src/minecraft/mods/BiomesOPlenty/textures/items/battleaxe/amethyst_battleaxe_head_broken.png new file mode 100755 index 0000000000000000000000000000000000000000..7eab770413404b9f1bb3001d8cce8b0fea2f1132 GIT binary patch literal 129 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`9-c0aAr-fh6BHQqmcISPf0$

@*?E(8Do literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/battlesign/amethyst_battlesign_handle.png b/src/minecraft/mods/BiomesOPlenty/textures/items/battlesign/amethyst_battlesign_handle.png new file mode 100755 index 0000000000000000000000000000000000000000..8b43760bffad3533cff9b106d8c3c87b1d9600b1 GIT binary patch literal 108 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`#-1*YAr_~T6C_v{Cj>O>r{DYY z|L3#c|GhJJ|C^k8;Plq*|Nj5|THe6B-~_iquYu3y18fWrT8wl~-&1J-YG?3t^>bP0 Hl+XkKHP0wn literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/battlesign/amethyst_battlesign_head.png b/src/minecraft/mods/BiomesOPlenty/textures/items/battlesign/amethyst_battlesign_head.png new file mode 100755 index 0000000000000000000000000000000000000000..1380200f6415e30d0fc2ed2abede9830d8baf316 GIT binary patch literal 152 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`@t!V@Ar_~T6Be-j`2G5Qeb9%c zTVnqk@>J~ncJ2TC{C&v@6Ov}gbo?uN##_eh(4^3_j#G{AQFF!|wuH^H(#NtHHU&@I z>oQGz!rWdRKWqI4m5!qlYzO9ea-~VIHghmAyqP>#cK-?ucA!-Zp00i_>zopr0A6M` AGXMYp literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/battlesign/amethyst_battlesign_head_broken.png b/src/minecraft/mods/BiomesOPlenty/textures/items/battlesign/amethyst_battlesign_head_broken.png new file mode 100755 index 0000000000000000000000000000000000000000..1f120508ca1369b4f72ed6d696a3cffde9aa3ec9 GIT binary patch literal 172 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`#hxyXAr_~T6Be-k`2G5Qea(-c zTkHN;nEtEzEZY;mZZB&X&!WUX`sw!)%o);*JQO#n2}mDfzgWTBaFgjWM=__-u`GsN zX#%{PCu-;)nA87;H6>j+c@EoyA}cHT<%|lPGgQu~rS#~uB{J+X?mWn|I6;7s!F_RA Ust+^&MWFQzp00i_>zopr0B@Z;n*aa+ literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/broadsword/amethyst_sword_accessory.png b/src/minecraft/mods/BiomesOPlenty/textures/items/broadsword/amethyst_sword_accessory.png new file mode 100755 index 0000000000000000000000000000000000000000..44fc42f72d45e45ba4f2942ae2f15211134d0f2b GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP)8xM<&set~y*Fd2RPZ!4!i_^&o60FS}F>NapC$j$60ab&~fCjjvY9X5k&XwGH;%`PtA21djRBq?J9{6r?{r zJe1uwUw{82(-y(_iUUky>lIrT^(TCpB>YKYBLlZV5d*`D2*-E1RWm_uWAJqKb6Mw< G&;$TT$Vt=y literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/broadsword/amethyst_sword_blade.png b/src/minecraft/mods/BiomesOPlenty/textures/items/broadsword/amethyst_sword_blade.png new file mode 100755 index 0000000000000000000000000000000000000000..f78c3bb194866ac1af5c78df6842ba7dd9016bd7 GIT binary patch literal 170 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP)8xM<&S*KcmAW+EM)5S5w;&gI~0&|Sl?XUA2V+u5L zum9h_|KGp=MbFOGPvUjD_UHTc_)9zzSAG1?8aPaR7U+=9z+f|Ps=8Ru<=sFd7(8A5 KT-G@yGywqYqc(H^ literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/broadsword/amethyst_sword_blade_broken.png b/src/minecraft/mods/BiomesOPlenty/textures/items/broadsword/amethyst_sword_blade_broken.png new file mode 100755 index 0000000000000000000000000000000000000000..3e1fdc8f1423a83ec71edd4d2e6ab95329f13ca0 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP)8xM<&Mc%wcVL+icPZ!4!i_^&o3(R*++4lPX(k-$7 z6Km9hOpOf;3^bNX8Y)OTZF#nT|G$6#i=LhR4`dvQJ?PYR_P+k!^d07}Wtf4W`JRrs vTUSmS<21(2lIyuOHc7H^+_d3h1KQ2^JuUz5gVXDPHZgd*`njxgN@xNA&;mvd literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/broadsword/amethyst_sword_handle.png b/src/minecraft/mods/BiomesOPlenty/textures/items/broadsword/amethyst_sword_handle.png new file mode 100755 index 0000000000000000000000000000000000000000..30efa5c41d9f87fe8851f60b6e00d066da8995b9 GIT binary patch literal 173 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP)8xM<&rR2;>2Y^CWo-U3d7N?UFBv=`~!I0^s& literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/chisel/amethyst_chisel_handle.png b/src/minecraft/mods/BiomesOPlenty/textures/items/chisel/amethyst_chisel_handle.png new file mode 100755 index 0000000000000000000000000000000000000000..7de2e368426b63246bc2bca215fc43ede5b2b3d0 GIT binary patch literal 157 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`DV{ElAr-fh6C^kUE<8AyAhgDR z-?L@HN1sSCY@V5OR^+D7#AjDrH!>%DK6`61PksGg)%efTjq@e+mcCW;Hx~HMe(T@- zoU;zM|1;bP0 Hl+XkK=AS*T literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/chisel/amethyst_chisel_head.png b/src/minecraft/mods/BiomesOPlenty/textures/items/chisel/amethyst_chisel_head.png new file mode 100755 index 0000000000000000000000000000000000000000..7a7e80028081f6ddd36fd1227d64e5d9f3637cac GIT binary patch literal 276 zcmV+v0qg#WP)t+)&TY6NTk`|Iz23`3AL<>cfr zR8&-;U}Vi-&b+}i1f(%EG!%>{HZ?M=UNDEDxxSuZ*6jIU%|H!c1F&ia0gw|xhP2j} zGi1dlFdW=}0F2Q!gJ`T_05agljT>-pq$NgU)m&6m1eV8X01RW(JZ;)E2BHkWr5UdQ zFhj6uUa?{YVa*@_(+t!IHw31cC<8z)K++8M4oL=J3ru7K2x^8I08$Jy0H&E}1MuYw ang9Sy_Z_#}VG7&;0000}1e~7VYWo+wYo#V$; z;4{f>#xw8C-4ZTUp&jN4-=-L}G04Yma1;3V`?dZIHfaYQhwFcyo{`?6=)$NH{a<*k z|kt(Y4la*VP^Q`G1+@c T^@k@w=Q4P@`njxgN@xNAbl*>~ literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/cleaver/amethyst_cleaver_guard.png b/src/minecraft/mods/BiomesOPlenty/textures/items/cleaver/amethyst_cleaver_guard.png new file mode 100755 index 0000000000000000000000000000000000000000..ebe10046157c98f9e312b3fd90208cd21bf827c8 GIT binary patch literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`9iA?ZAr-fh6BL+du)IEO7&&XU zpNR33To2W|3@K+7W~nf@HKgS%^qO>5;ba4w{|=>1b9jTM?9!N4W3MdjFzMOr;Qs&Y zi6zb*+a#C#JU!F=zy8v5S^GaH;4cL literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/cleaver/amethyst_cleaver_head.png b/src/minecraft/mods/BiomesOPlenty/textures/items/cleaver/amethyst_cleaver_head.png new file mode 100755 index 0000000000000000000000000000000000000000..e65ce18dd712aad205a6f49ee47a827e55315471 GIT binary patch literal 253 zcmV7ndX5_jBOi_X)Df7%-ZlvJVi@yw&O*Qk_8i=rl&Yx_}g>&W($*`m>vtS yBcDUi(}On|R5SyWyr%^}WD_W2HS0CtVK{&G<*MD;Hu^x9F?hQAxvXL_7=ndVr|Bz zIlxC3x26-DL&2D2n~^n=rTP2Y8F)2=)cpJR54YyWr$TUQ28r_~N`Uc!um3RP6`y7x z4VD9`0a=D&0LWB)ny*hi4weULKHHOzY5+(Qgz;&H8L*+mn_=^{+o=8rNdh&26`=bW z8G|%pXhsGg+hNHR7A_#KfoPl>;h6#oKrR8f2$wuE0A~Y`q(F%*ToKH_!~nPf_-w(Y a5rzT&SwDSN9Hbfm0000!lvI6;>1s;*b z3=Dh+L6~vJ#O${~L8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3Q$0figD*u3fvS2v zT^vI!{HIRX$lGAR!@?|Vz$zqcAlP##;EcmjnJFP26EAv8Se_I2D?IyA+*?JEvv}R^ zh;6BFUR+pwur`LZz+}S>1N)!sb@SR>lwFhMvwD0*HSNq2)5~2`HuBdbo-doq@MhP2 zjgU#NOW0R@;s5b|n%9KaNButsbQ%=N25>4FF4)AX6%8UDdsH!g)MR{VY^fUvbQpuD LtDnm{r-UW|o=RJ6 literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/cutlass/amethyst_cutlass_blade_broken.png b/src/minecraft/mods/BiomesOPlenty/textures/items/cutlass/amethyst_cutlass_blade_broken.png new file mode 100755 index 0000000000000000000000000000000000000000..1ce29b2265e5d31966c210f8bdcc1233a889932f GIT binary patch literal 294 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3 zQ$0figD*u3fvTo@x;Tbd_)nd1kh9f5fOWBGMC%9b4NAI47p*yXdHvzV>W*P@J3eiy zY=2_FFkW6;o>*ZPK|Ex1~=Pn<$icwoE~FMQ7s_ iU5}ehKq9h#Df_P_e`LzPg((9a$l&Sf=d#Wzp$Pyv>S$g7 literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/cutlass/amethyst_cutlass_guard.png b/src/minecraft/mods/BiomesOPlenty/textures/items/cutlass/amethyst_cutlass_guard.png new file mode 100755 index 0000000000000000000000000000000000000000..e9d2ec59fa1534ee3cd4a9b3a0518d70864f035b GIT binary patch literal 170 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=Dh+L6~vJ#O${~L8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3Q$0figD*u3fvVIz zT^vI!{F5bE7bg@ndS~wbci14LqrzdDn#2MRV-B7@j8hod*cj|HMP{V!v)d2U!QkoY K=d#Wzp$P!0el8vW literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/cutlass/amethyst_cutlass_handle.png b/src/minecraft/mods/BiomesOPlenty/textures/items/cutlass/amethyst_cutlass_handle.png new file mode 100755 index 0000000000000000000000000000000000000000..4614db03cb92328d501ea896a94dd2f43c7ee603 GIT binary patch literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmSN`?>!lvI6;>1s;*b z3=Dh+L6~vJ#O${~L8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3Q$0figD*u3fvSu= zT^vI!{F5bE7bnbU^3L4-ui0RVw-iI>p2+GcHp~vQ;@0hT-Ium0myL0P+b0ua0|tgp Xadke987zB&x*0rO{an^LB{Ts5I+-&y literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/dagger/amethyst_dagger_accessory.png b/src/minecraft/mods/BiomesOPlenty/textures/items/dagger/amethyst_dagger_accessory.png new file mode 100755 index 0000000000000000000000000000000000000000..abdea45ff01dadbccd8574343261433ba8775cf2 GIT binary patch literal 179 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Rh}-6Ar-fh6BL+du)IEO7&&XU zpNR33To2W|3@K+7W~nf@H9Ygq+sRv-z9G4S`L6c#4mn-n#uk z+XR{GFWM$7xp~=VisE5^zC4aI)-Kuae8ST&On7{ZBjn4CgHp98W^uaew=pfK|ER5` ebm4><1A|#gpZLXuSGGV`FnGH9xvX+ky>}1e~7VYWo+wYo#V$; z;4{f>Mp`GU6_3(hts~L~)m{?L4gGqDmu`vuzfeMl&8$J9Va?CeGtCpEmPo4ji7;gT z`2AWx!nlL&W9KJrALC7DT{4%QNJ}~U!tAq}m%#ypYZb1~k~d4HuV_|rSf->d5MXmS zhs{+ouu&~QiTfJIqKmPvMMA8SOvR#+3~2(6&K#Da^KC4o56toI3x3EpK`P;dD+9y5 X`%~vuFHK(sbTfmetDnm{r-UW|tY%Ke literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/dagger/amethyst_dagger_handle.png b/src/minecraft/mods/BiomesOPlenty/textures/items/dagger/amethyst_dagger_handle.png new file mode 100755 index 0000000000000000000000000000000000000000..3d73dba7de549b1337d6b7c25e77ed5c086c07cf GIT binary patch literal 154 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`iJmTwAr-fh6C^kUE<8AyAhgDR z-?L@HN1sSCY@V5OR^+D7#AjDrH!>%DK6`61PksGg)%efTjq@e+mcCW;{#?J{?El7D z|0ge%%rO2rOLG%Y$DU511qYP;jn6QM@$zjdR%3`_3gjqfvc3VdjKR~@&t;ucLK6TJ CG&$e^ literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/excavator/amethyst_excavator_binding.png b/src/minecraft/mods/BiomesOPlenty/textures/items/excavator/amethyst_excavator_binding.png new file mode 100755 index 0000000000000000000000000000000000000000..b6ba713921c54f8af9e5f3935e9686f97488d173 GIT binary patch literal 309 zcmV-50m}Y~P)5;ba4w{|+UA+RfiI4o^4E?%^{huh2W?ZyJz=UO$U{B+$|H8t1 nCAb`<3MCy%uCZjQ9cN&eDbXz|_MPVh&_N8Iu6{1-oD!M=Wxg}9*A~VkusY#C{ rmk8dy@4_5#iYakInt+;VJp)7E(Rw}C#UV$5PGazM^>bP0l+XkKDcedO literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/excavator/amethyst_excavator_head.png b/src/minecraft/mods/BiomesOPlenty/textures/items/excavator/amethyst_excavator_head.png new file mode 100755 index 0000000000000000000000000000000000000000..1367677d8ff263858b4e4709e47d264dc3dec384 GIT binary patch literal 268 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`mpxq^Ln>}1Cmdk%@%4RZVPGK8 zr@!>=uk#K33fV5^3`->=q|LGZN1GSR^6P#u|o1UHDn5pu9!aB(# z>NiC5x9kIh`p1GJ98)78&qol`;+ E00ewCeEHvZfm$*q+vH+;6G2{2@;L>mJQuwkeWX!xPr0@Tgm>FVdQ&MBb@ E0Do{IaR2}S literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/frypan/amethyst_frypan_head.png b/src/minecraft/mods/BiomesOPlenty/textures/items/frypan/amethyst_frypan_head.png new file mode 100755 index 0000000000000000000000000000000000000000..4c625f6418a38bde8c393c07b4a2347435d4dad7 GIT binary patch literal 176 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`<(@8%Ar_~T6BHQqmcISPf0$

Guv8USw0uuG#rbOh#GSWlLI$c*76-`!(#zbJ`B@I9%ts%wf#3nz6-1*o0*^ zqk(UI{a@DPNjwLZ%~Z)(kan1omcl$ibaD2vY=$!eDZU0iQ_{Xn>3GA`HOb_pR68F7 Z!=+m*yyN{Z{{lLJ!PC{xWt~$(69BBRJVF2f literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/frypan/amethyst_frypan_head_broken.png b/src/minecraft/mods/BiomesOPlenty/textures/items/frypan/amethyst_frypan_head_broken.png new file mode 100755 index 0000000000000000000000000000000000000000..733ce65eeb02e1d9d6e34436066639dade9bb58b GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`O`a}}Ar_~vPV(kzFyL`1j>><| zYSXMe{hq^%Ac5AT%*0ayZ`F4g8C-C^|C&YX(u~v@c`iE48S`WPws$$n-#FFxt~N$r4Z{ZEm}4c}Q~L^C=i(-`Bg6@)TyI(vw( l`Oj?rs59-wzR(+T~<@1}8{FAd2Otcw#o7#OrHoqT40dtM1N OhQZU-&t;ucLK6U6s3qC} literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/hammer/amethyst_hammer_handle.png b/src/minecraft/mods/BiomesOPlenty/textures/items/hammer/amethyst_hammer_handle.png new file mode 100755 index 0000000000000000000000000000000000000000..099a0172e2ff7668ad5d050aeeb901f6c423cbc0 GIT binary patch literal 101 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`I-V|$Ar-fh6C_v<%kGJ(e*OQv z`ThU(mY<*fU%Dmszq={F|5*iwODu<c`oKwNl>DaImsE@(Z)z4*}Q$iB}xzr)? literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/hammer/amethyst_hammer_handle_broken.png b/src/minecraft/mods/BiomesOPlenty/textures/items/hammer/amethyst_hammer_handle_broken.png new file mode 100755 index 0000000000000000000000000000000000000000..9f5780780cb342bbdb84f7148818115e93e8c081 GIT binary patch literal 118 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`ww^AIAr-fh6C_v<%kGJ(e*OQv z`ThU(mY<*fU%Dms|I5XaO9b5}FO|H>FlnxDVT0oC1dbLno(7YH29|N`3=Wr53%?xt Ru@-0$gQu&X%Q~loCIE`JDo+3a literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/hammer/amethyst_hammer_head.png b/src/minecraft/mods/BiomesOPlenty/textures/items/hammer/amethyst_hammer_head.png new file mode 100755 index 0000000000000000000000000000000000000000..d716c4744404dee017cf57d0bed56b1eb3447383 GIT binary patch literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`v7RoDAr-fh6BL+Yyl#J$Zl xDUf7hQfX!1q^OeV#xK0dBzVpYH^yE@hSKJ9zpu=B@fBzhgQu&X%Q~loCIHo~Fs1+i literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/longsword/amethyst_longsword_accessory.png b/src/minecraft/mods/BiomesOPlenty/textures/items/longsword/amethyst_longsword_accessory.png new file mode 100755 index 0000000000000000000000000000000000000000..62777eeb8a5457f74bf7c4260b5fe087ca3a61ef GIT binary patch literal 115 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`R-P`7Ar_~T6C_v{H_UnvbZgyz z1D|QnW^Z->zdxq>_5bO{`6tX-S~QJV(gaQjbn!4$w&yS>v|Z5s#&FoePPFy=CKsS7 N44$rjF6*2UngEhACO!ZF literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/longsword/amethyst_longsword_blade.png b/src/minecraft/mods/BiomesOPlenty/textures/items/longsword/amethyst_longsword_blade.png new file mode 100755 index 0000000000000000000000000000000000000000..4452b6960fbaca1ec805a4e13017dfc77cab1724 GIT binary patch literal 103 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`dY&$hAr_~T6BL+Zyl#J$Z##ME z&-d&1|Hq%(qjKw^OoZbPs+8H7PLgER`1$b#7* z5a6RroFOoqL7GAM*wGf^G@sZU3dSGPn0cmcia%Gr3B@DkIAdTPO&R}?Pvxecx zrF6KTL7G6CL5ART2~6|jQy~l=o=#x+{HT%P)%6;NxA)o@Uaq~x@bk@ghA(H{FkDL8 z1vcQo*MFD>fHc3joX7C;dLhG&qX`Ue?zUpp3{s0>0J8rKOn4002ovPDHLkV1ktqjt>9; literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/lumberaxe/amethyst_lumberaxe_handle.png b/src/minecraft/mods/BiomesOPlenty/textures/items/lumberaxe/amethyst_lumberaxe_handle.png new file mode 100755 index 0000000000000000000000000000000000000000..efe665d094005e3461460ae8b176df299daed736 GIT binary patch literal 162 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`nVv3=Ar-fh6C^kUE<8AyAhgDR zU)m<#hRi&xK%ZTVAs6TD(wJs*c2B1ePx-rZ=^P&}s``IEy>}1Cmdk%@%4RZVPGK8 zr@!>=FaAS3I~X>(r7$N*{r~ri`&b0;!DW&y6HV(ZKR^3_-uynN^n}Ti4+jJWG9EKv zc9@m;!l#!WfKMrZZNUJ}zbr+!lP40jM~K!SO8630;Y72TX)>8TQpU3NtW-&ar)_ TCR?fu^dW<%tDnm{r-UW|Cv$BC literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/lumberaxe/amethyst_lumberaxe_head_broken.png b/src/minecraft/mods/BiomesOPlenty/textures/items/lumberaxe/amethyst_lumberaxe_head_broken.png new file mode 100755 index 0000000000000000000000000000000000000000..d9957c2716c0be7f6f8819c4aa6af7797cb36a30 GIT binary patch literal 200 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`{hlt4Ar-fhKg3wHGPV^mPEM#b zsMXB9UN7J_@yK#P7K^zo4pIka{r~ri`arf^E%nc`mUSb1a#e!t8La?IzEm>&xZTa~L)$o-k`R5zb{W yYLIL()#_wrwA+=xowp$sw*fE>Fg8r%mosk|e!lq*7Hc|DjNJg329RQ8 zn?ZaSe!2G6f1vn(yqaMKVAD*{0FX104S?}sny*hij%ffaRAJ7BYJl^RHRCiOpurO! zFi09HvZfm$*q+vH+;6G2{2@;gc~zNFRKuk+*}e1)XU)M>gTe~DWM4f DR_G%L literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/mattock/amethyst_mattock_head.png b/src/minecraft/mods/BiomesOPlenty/textures/items/mattock/amethyst_mattock_head.png new file mode 100755 index 0000000000000000000000000000000000000000..91a2c4554b48b070fc10955d51c5c768fb7bca10 GIT binary patch literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`o}Mm_Ar_~T6BHQqmcIRU-a(Hc z^WX2+@9Q`5G-m!Qdd4d;Ifr8xV~X^r&u7bbFzR2wr*vLGfGtz)wm?d=Lt8_PYv7xn droaY1h6<&u{}mTE6$1@r@O1TaS?83{1OPZoEtdcQ literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/mattock/amethyst_mattock_head_broken.png b/src/minecraft/mods/BiomesOPlenty/textures/items/mattock/amethyst_mattock_head_broken.png new file mode 100755 index 0000000000000000000000000000000000000000..4828acd06e3a99f06cbacab0377ef0d7366baa94 GIT binary patch literal 123 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`PM$7~Ar_~T6Bd~6n6mA)J;&s= zKTppz{~y0@uj@R;6Ko9`lXw|3fBbxAeTQLF3==nV7muSEM+(P@&=mGJ8WOBG7#LoB WiEb3V$8-p28iS{+pUXO@geCybd?=6r literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_axe_head.png b/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_axe_head.png new file mode 100755 index 0000000000000000000000000000000000000000..1b4674201a2f3a7e94f93c7c46598fdde51325e4 GIT binary patch literal 305 zcmV-10nYx3P)c^m=|nL@-iB1d27okyFi4@q0v#|LrWr(| zy9~pLAe%uN1xjSWY!C?W(Z#PB*>;d3kY*4*cC>|f%^+|oZP$Mg1}O$_4ogmGjG6#fHZ+LgA9SW1gil74W1~PVHjozNHalKzzq2L<~!Vgmuqjq z4Z*1yWqKr6IeND00000NkvXXu0mjf DqaX?}y3fwReAm)Z=A4*o@jQVnOzawOI>p73-1 zCKMUxP-eEt;_V)WNeW`g5)8#^nllnb4lpvv@0u$+^R>Y`piK;(u6{1-oD!M}1CrEGzTzGIYL1>Nt zzO+re4VigXfjzeyyfb(IYc|j;+%qeYYyX_e<|K}ezn{;RZ;%M|bHB!LsJ{L$>t#l} zT}OV4r*ZfgceAl)GO~TP+?2CQd$kf~rJP-Gh4qq0QAi_$M(V`5n;RGyJmP0Xym0uh3v?iZr>mdKI;Vst E0Qy!<7ytkO literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_chisel_head.png b/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_chisel_head.png new file mode 100755 index 0000000000000000000000000000000000000000..bbff9ae2c9712044ad9bff97358cf0fd33ef50a9 GIT binary patch literal 282 zcmV+#0pa**wo0ddchoq=K6YuS+nPZH3Kz(4ET>#GYEj32r{I# zwwxg=K7rxj{sUkP(+t!IHw0@KfDE{C;|AOtX^GJ=Kci?aDk=iY<1_$}Fh9CzfvH=7&!@>ci7-j%W gGtma%%NH~O0BJ26tEVM**8l(j07*qoM6N<$g1{ha(f|Me literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_chunk.png b/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_chunk.png new file mode 100755 index 0000000000000000000000000000000000000000..59cad63b6550ad9059193d88b5d69dc96ea66273 GIT binary patch literal 378 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP)8z&PtD}&mzKn4azc25__5R21ygEn?GJBY|Q?@`ui zk>C*1OiEXO$-i!oS%Lh+_=vmlPn4OqX)>2-Hr*{-=Ao!Q-FZ{T>QCz|M8ceXX4^zm zocYu?vy#8!$E8~g-^7-n{w%i8YWfyeW7-p=` zVK~4i{VMdx-UhwjEuT~tdxeFZ>;lrK?K0)QGa2~?&y>F6E7#4Y6WnPuRiZE6por&% zSaY7?nQ*hRcW#P-IvtPsB`!p01mFB4I+0;>Z{Mebrq-@10WMAl-TD|0p5N~L$F@d0 z@tVr6qZ3-w=hWQe42n#Ck@xcIpXv6I=d6x=yFU9`wa3EUOU<6Gu{W{F|I4`cS?O7$ T4I5p6p~T?n>gTe~DWM4fA`p~m literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_crossbar.png b/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_crossbar.png new file mode 100755 index 0000000000000000000000000000000000000000..467e4f12920618b969cebc75e09c7369c3bab662 GIT binary patch literal 223 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`%RF5iLn>}1e~7VYWo#>CoSaZQ zr>MfTiDCIeGE7htVB6`C)X10Tyunhk#nG(Uglo!)rke@^4;FjRQ8bwC zILq+}6y)xanZUw_$VIR`{b>CgUgX z*Y8hoc9`Wb%d_a{>8;xz=ryt`Y@8*z;M~9dH?nL=j5-%CFi%bV!RYj}ql`^KoRQ(r X)mr^ivd(Eh7c+Re`njxgN@xNA@pVYP)GM_xpeQt{j^;QUW1%R13Es4P@Q25=x(vlD|#!yvN5;x2WKd-GMDgjs& zg=D|o(CK(kn9%_~&UX<+H^Hiq?A9w<&gLF=!#|SbH6Uo3MkFEZAc;znZ=eDMg9^K~ zrH7l~kfdM;F3Xalg05sToVo@&Vy&e~g70H-UDpJ7l%Oj?Lct)c0t~A_;n9M=fAN?4 Y0Fd`b+v?@|p8x;=07*qoM6N<$g0CrZf&c&j literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_frypan_head.png b/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_frypan_head.png new file mode 100755 index 0000000000000000000000000000000000000000..ba5c762ae86f8fd70b92e575dc93568e6fdceb7f GIT binary patch literal 173 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`C7v#hAr-fh6BdZ>n6mA)J&r_h1@> z&*l5^^#^CDFmK3IJ1KpFO<<|yO@@@CFJ^s|VlZZj6y_0LDru{#w7X%Eiti@3UCay- XrYpP|_B}ffw4cG#)z4*}Q$iB}Zs$D? literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_full_guard.png b/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_full_guard.png new file mode 100755 index 0000000000000000000000000000000000000000..e05fef77d78553cf08c60cd718a81c0a7cc84338 GIT binary patch literal 249 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3 zQ$0figD*u3fvPe*T^vI!{O_LG$lG8b;C#{N^n^1GNBK&om?*fqg-3WRiE5G<99;DE>Et7Sc?AH~aJiaUN%|E8dnl2Oc<6z?h8PCR~1J32{ nyV?&qXUPN=oP06iqwN%7rv)Nbd0f>Xmoa#{`njxgN@xNAp+!=~ literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_hammer_head.png b/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_hammer_head.png new file mode 100755 index 0000000000000000000000000000000000000000..ad77dc66b000c933e2c74959d9f6ff35e1fb21b2 GIT binary patch literal 344 zcmV-e0jK_nP)e*& z>1TLkcjyKO&+FI1UbH50(e_b<^oHb4)J{50;&R8M2x;t2nacB7AJWgNBb?SL0DuFv z5CAYeo5hO_Ea6lE($Anzy0s7tUtN{BGJ+)>rbfBuxgtc_E`O%RGai;(lB{QksFX)C11tt7oa@eAI1~rvW8z?h+a4V0000ujP)fPWB|6nL^gn+W|#pW#V`Y4nu#_5U%sFT007$!3M*n6_&)#u N002ovPDHLkV1hZCUsM19 literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_large_guard.png b/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_large_guard.png new file mode 100755 index 0000000000000000000000000000000000000000..6fa5f4f68bd5d38798efedf74244d9ee1cc934ee GIT binary patch literal 286 zcmV+(0pb3MP)IVL2>F75K4z2NQW*xK`1KdSP(DZq7Gibsd@uX5&Hr!B#sRJOtqPAiy~XA%v5rY2rYdrtr$H3UfXkpejq) z?T?Tx=J2@PHG=U1BxCu#eQE?tv*|=5)kZ+ETAGz!pzAt=d@mo3$hwAN%}p`S^Duz1 z0V+xZL6mf6a@OY4q^kC;QU@U kEATP_RE`2;{)@ky9|mg!R5gwhQ~&?~07*qoM6N<$g2U@@EdT%j literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_large_sword_blade.png b/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_large_sword_blade.png new file mode 100755 index 0000000000000000000000000000000000000000..e2b674f0d591656503a1328adf23fd499471c8c8 GIT binary patch literal 204 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)3=%SbV$lGf;%Hz$3Dl zfr0NZ2s0kfUy%Y7WH0gbb!ETH#>J{B?6PZ(H&7_j)5S5w;&gI?M8*M+HHW-2cmG@5 z{qk&4a*ATu=662fZSnc_27l^4OnvzJa5;~Dxt+qjXa7Oq=d<7c_0#YDso(kST7Aws r$*VS7OqHdbwxy*wpSWg|z`zhCa3=T6+I4GzmN0m_`njxgN@xNAwDwF- literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_largeplate.png b/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_largeplate.png new file mode 100755 index 0000000000000000000000000000000000000000..f94f069e6be1d0696184a6e4da5e086673acd2f4 GIT binary patch literal 169 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`1)eUBAr-fh6Be-j@Mo*o`R!Ug z4|CnVpMD~2nfs<}@#D*62EAqvBZg&? zv$H$Q80PXC_hjflC=xu$wjldhCd01%7Y%)k!p`Jx~13Vow>W< zl<}j>9IXEnv%aS7Ok9zCXz@>bX6D27Z#B>H+zOsEkyj~)Vbihq)9)Go`T2$WZs-nP zhp;byFIBSvLEC-)eMTL-wG&ENh4pSH&XSankl1He({3zKSlQSZ+9>V%dAE4}##PCV z;umH=Jyy|~c)cE|ZN}!ptYgx>7e4&x&$BqJae#p#B-*O^Qm5@{pc5H9UHx3vIVCg! E0OmDfkN^Mx literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_medium_guard.png b/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_medium_guard.png new file mode 100755 index 0000000000000000000000000000000000000000..bd18f4ea1aea0389b71e03df0d67dfb34799808c GIT binary patch literal 297 zcmV+^0oMMBP)c^m=|nL@-iB1d27okyFi4@q0v#|LrWr(| zy9~pLAe%uN1xjSWY!C?W(Z#PB*>;d3kY*4*cC>|f%^+|oZP$Mo25D}na%Gr3B@Ao` zUT4EJ->g0Q|K-|S|G%7h12zPt8Dt2|C0GpzXz)Za1cZ?d0cj@aiqu81@Tl@M6J>xI z0-`}0acV|40HnDyT^;Tn5Y0dgfN9R~lVi}3V_n`wrRfA&s)Fl(b!!#knEa#l7V*x?8=!t>MT zrCVbE@1Ilo`Tx^f(f>DAPUM{bY%l+LV~dsPhKKenn3C2a=;yP;q`LcqkwKAx;f*)X zQ!dPYdhAEhbLO`7{Pz=Aq#jKDEEp%(mjC;{Va|?^JbK4<^^Y7l@PT2wc!F8{inj?H zZk|8+;rTIsk)v~}nk4iRT(-}g*xY&WmdK II;Vst0HmwD8~^|S literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_rod.png b/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_rod.png new file mode 100755 index 0000000000000000000000000000000000000000..09e8e0489c517eef85fc760a60b798fbfe739891 GIT binary patch literal 214 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP)8z+;xsro}8FDok2)JCVzja6H z`v;wumzNsGM!nW$Rt(Ky5!5l$jhZ<0u&cMP`{}>*2RoPOog=;lg}hUmlsM*|QF$@X&s-we?u@lu z#k|i48+l%uXq8BbGJN{p#ISc-XJ!UNNA-ia(<}!}OwzQ?_c|P0wYus0{^Kc*GBTD2 zA67q(y{`7TamLyh`4CPHnd*m(SKgX2%&K8n5TN_WZ#%;kH+`ib0d=jAZiXF~a~+f( zeXG;2|FKA;)1!FH`FGQos~mrN|1GD^%HKkJr=itopcz;1rMzHMyfMjY+LgcS zz0a81yt8M`@;n)P=xjQ3dikUDdOux(RncM=Tgs>XVJ>M4@!!LKaUw7j7(8A5T-G@y GGywpe5Rg6q literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_shovel_head.png b/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_shovel_head.png new file mode 100755 index 0000000000000000000000000000000000000000..3ae87129ca495af26c2078b07a2204ddf9c49c49 GIT binary patch literal 270 zcmV+p0rCEcP)p`xM!1<#lgS*4lE0toQ`5hD&L?{=;x{RRu#yLLA(c zSPi&w;|5#-NYme6f5G_6nKxiVK;lJ3MfeQ>VVGu+#+Pevf!QFjY15_=HUM2Sh$hMa zbVEqijLRD^%_JM}|NnomAuCp_U?AE6bVEQG*#Lr?VFrK{!wi6FCfWde`GO_@0Mb?d U)d8->DgXcg07*qoM6N<$fU-XRk2E!)P<_v-Q5My4`W?ltvW1Ut;)5F3% zCuda(t4g?3g&r_DIm^*gc*#W9=H@SF7`>*YJl9cRV3;hu{OQx2jsT#244$rjF6*2U FngBfpHiZBH literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_toughbind.png b/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_toughbind.png new file mode 100755 index 0000000000000000000000000000000000000000..4a1c097686e2ebb58dc4f1595a019239486617d6 GIT binary patch literal 314 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)3=%SbV$lGf;%Hz$3Dl zfq`2Xgc%uT&5-~KvX^-Jy0YJ8;}lWhC{d_&1_~Ybba4!^IDK}~LcV4LfwupX1YP7A z8dn}x-0(T#9#eOG)2-+a8aG(mR~1sn7G~{STY86+kaBc)I$ztaD0e F0sx(_cLe|d literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_toughrod.png b/src/minecraft/mods/BiomesOPlenty/textures/items/parts/amethyst_toughrod.png new file mode 100755 index 0000000000000000000000000000000000000000..14af1854ca6884248765cb55b53e54d4eabfa76f GIT binary patch literal 107 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`MxHK?Ar-fh6C{crq`kfPU!g`b z_j>&%lm9iJ|NftDobO?t5b}9N+N~@$#tCW?%c`F-F?@+zZj#ib8wS+P;OXk;vd$@? F2>_>tBw+vm literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/pickaxe/amethyst_pickaxe_accessory.png b/src/minecraft/mods/BiomesOPlenty/textures/items/pickaxe/amethyst_pickaxe_accessory.png new file mode 100755 index 0000000000000000000000000000000000000000..555eda0b52d79c8b23ef3a0ef6563187bfe69d37 GIT binary patch literal 102 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`x}GkMAr_~T6C@%Z1l?NqU%_V^ zWBj>2KmUKf9{-8Aa_6^e^%E3Db|#7RFwJ6MXgDEN+qBcU5~z{E)78&qol`;+0NlMI AP5=M^ literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/pickaxe/amethyst_pickaxe_handle.png b/src/minecraft/mods/BiomesOPlenty/textures/items/pickaxe/amethyst_pickaxe_handle.png new file mode 100755 index 0000000000000000000000000000000000000000..2234e6c320e2da17f048068a552de33ecb7e77ba GIT binary patch literal 110 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`rk*a2Ar_~T6C_ww8fR~H|Np<{ z^I!X$v-Z!a{QN)Y*1G>Gw|%xf3!MEj)A;5rM}{R6bIwj-V0fjJs%OgS(Frtw!PC{x JWt~$(698q^C!GKQ literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/pickaxe/amethyst_pickaxe_head.png b/src/minecraft/mods/BiomesOPlenty/textures/items/pickaxe/amethyst_pickaxe_head.png new file mode 100755 index 0000000000000000000000000000000000000000..afe316de9a7ff445ce04c54a8c47da163f613049 GIT binary patch literal 136 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`{+=$5Ar_~T6C|cQ2)ecI{|$qa zZGZlL{r-QtasI#kG1c5YlXC<%y;X2_kWllRwmo5;;%SB%iYM+ZJR#7zopr08t<^rvLx| literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/pickaxe/amethyst_pickaxe_head_broken.png b/src/minecraft/mods/BiomesOPlenty/textures/items/pickaxe/amethyst_pickaxe_head_broken.png new file mode 100755 index 0000000000000000000000000000000000000000..afe6ed61082a9a153d6157a6862cb9564fc0d176 GIT binary patch literal 122 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`j-D=#Ar_~T6C|!Y2)ecI|A`qo z%=_k4e*XXTR&>HFo#upD4s8tvK0Qj;C!{i*5lDF-kiy~07Vw1WNkggxYcmT2!=1#$ VV;{4EuLBKZ@O1TaS?83{1ONv$Dop?Y literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/rapier/alumite_rapier_accessory.png b/src/minecraft/mods/BiomesOPlenty/textures/items/rapier/alumite_rapier_accessory.png new file mode 100755 index 0000000000000000000000000000000000000000..e22afe9ede24ae9af4f5007c71c9b2d3a3b33bdd GIT binary patch literal 112 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`=AJH&Ar_~T6C_v{H}Di_=3cKC zP>X&%-8kRFoMFks_v`mR$!wEkxb&y!t?s9s_M1Kv@3ZG`VPZ)BXK#C;PqqkX1cRrm KpUXO@geCyU`XuWB literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/rapier/alumite_rapier_blade.png b/src/minecraft/mods/BiomesOPlenty/textures/items/rapier/alumite_rapier_blade.png new file mode 100755 index 0000000000000000000000000000000000000000..9e43e729b4bc2c850f077deca837e20c4ffbe844 GIT binary patch literal 100 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`+MX_sAr_~TcTCy#`v2Kmi~mcW yU{zrL_wSc=7RM~b_;Y(COe literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/rapier/alumite_rapier_handle.png b/src/minecraft/mods/BiomesOPlenty/textures/items/rapier/alumite_rapier_handle.png new file mode 100755 index 0000000000000000000000000000000000000000..0dfb04c25356c12cb68aea0618d4a75d1c36c2cf GIT binary patch literal 101 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`I-V|$Ar_~T6C_v{H^e=7zkdJ! z{A+T5{kJhrzf|`3f6+7Er)@mO(*uqQ2(U4nwz3QJ=YD)1sE@(Z)z4*}Q$iB}pSB?- literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/scythe/alumite_scythe_accessory.png b/src/minecraft/mods/BiomesOPlenty/textures/items/scythe/alumite_scythe_accessory.png new file mode 100755 index 0000000000000000000000000000000000000000..4b653ded93e36361b8b22890de57d9e9992835cb GIT binary patch literal 107 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`MxHK?Ar-fh6C_x#u$yQ1|6A_y z`F?!;e|}--eRC>5*C!+~rhHzyCHBc}zDqV|codhgF)TLl&gXGI)eY3m;OXk;vd$@? F2>?haBFg{( literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/scythe/alumite_scythe_binding.png b/src/minecraft/mods/BiomesOPlenty/textures/items/scythe/alumite_scythe_binding.png new file mode 100755 index 0000000000000000000000000000000000000000..f7ad4e2c140f34ca5a02527d190ef91454c81bf6 GIT binary patch literal 103 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`dY&$hAr-fh6C_wunrCly{~zyl z`|JFiv-S0VRqr!Qc&49zZ$dtUhw{x??guxpFc`d6s7{V_JPXvx;OXk;vd$@?2>{VP BA;JIv literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/scythe/alumite_scythe_handle.png b/src/minecraft/mods/BiomesOPlenty/textures/items/scythe/alumite_scythe_handle.png new file mode 100755 index 0000000000000000000000000000000000000000..908797d1456d61c0b8d99aef8f4a38f3a3266e4d GIT binary patch literal 157 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`DV{ElAr-fh6C_wunrCly{~zyl z`|JFiv-S0VkLEIXFe;vnKey*#9)l0#E=2{qO=m0S_UCYHa@%vxZ9C@^mlFU#*}7`Q$QgbPZ!4!i_^&o60FLMch=bc`hR++ z`G5VTZ-4nud$xc7ze(#WJ8sr&{`R82D_70kn7e1;y_~ZZFI6SYg1H#JCizTuW7)z9 PG>5^{)z4*}Q$iB}Gx#{N literal 0 HcmV?d00001 diff --git a/src/minecraft/mods/BiomesOPlenty/textures/items/shovel/alumite_shovel_head.png b/src/minecraft/mods/BiomesOPlenty/textures/items/shovel/alumite_shovel_head.png new file mode 100755 index 0000000000000000000000000000000000000000..918ca7b73b4aa833e72818ec5e9e492319bd1ee9 GIT binary patch literal 228 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP)lZ>D;!$PwK20)=gPZ!4!i_^&o5*Y_Px*mCF?*4c9 zM%Cs!9+yrRXy#u3zkmO~fB%2Ke*a%T{oWsUv!0Bz@#psZ{9p8T?f?4vzpc^-Tzb;p zYM$e{ufI3_$FC2v%-i<}yksl|X`P;(|M!2E}Udrz|`+!1)o-U3d7N?UFBr* itemDirectory = new HashMap(); + + /** Adds an item to the directory + * + * @param name Associates the name with the stack + * @param itemstack The stack to add to the directory + */ + + public static void addItemToDirectory(String name, Item itemstack) + { + Item add = itemDirectory.get(name); + if (add == null) + System.out.println("[TCon API] "+name+" is already present in the Item directory"); + + itemDirectory.put(name, itemstack); + } + + /** Retrieves an itemstack from the directory + * + * @param name The name of the item to get + * @return Item associated with the name, or null if not present. + */ + + public static Item getItem(String name) + { + Item ret = itemDirectory.get(name); + if (ret == null) + System.out.println("[TCon API] Could not find "+name+" in the Item directory"); + + return ret; + } + + /** A directory of ItemStacks. Contains mostly crafting items + * + * Materials: + * paperStack, greenSlimeCrystal, blueSlimeCrystal, searedBrick, mossBall, lavaCrystal, necroticBone, silkyCloth, silkyJewel + * ingotCobalt, ingotArdite, ingotManyullyn, ingotCopper, ingotTin, ingotAluminum, rawAluminum, + * ingotBronze, ingotAluminumBrass, ingotAlumite, ingotSteel, ingotObsidian + * nuggetIron, nuggetCopper, nuggetTin, nuggetAluminum, nuggetSilver, nuggetAluminumBrass + * oreberryIron, oreberryGold, oreberryCopper, oreberryTin, oreberryTin, oreberrySilver, + * diamondApple, blueSlimeFood, canisterEmpty, miniRedHeart, canisterRedHeart + * + * Patterns - These have a suffix of Pattern or Cast. ex: hatchetHeadPattern + * ingot, toolRod, pickaxeHead, shovelHead, hatchetHead, swordBlade, wideGuard, handGuard, crossbar, binding, frypanHead, signHead, + * knifeBlade, chiselHead, toughRod, toughBinding, largePlate, broadAxeHead, scytheHead, excavatorHead, largeBlade, hammerHead, fullGuard + */ + static HashMap itemstackDirectory = new HashMap(); + + /** Adds an itemstack to the directory + * + * @param name Associates the name with the stack + * @param itemstack The stack to add to the directory + */ + + public static void addItemStackToDirectory(String name, ItemStack itemstack) + { + ItemStack add = itemstackDirectory.get(name); + if (add == null) + System.out.println("[TCon API] "+name+" is already present in the ItemStack directory"); + + itemstackDirectory.put(name, itemstack); + } + + /** Retrieves an itemstack from the directory + * + * @param name The name of the item to get + * @return Item associated with the name, or null if not present. + */ + + public static ItemStack getItemStack(String name) + { + ItemStack ret = itemstackDirectory.get(name); + if (ret == null) + System.out.println("[TCon API] Could not find "+name+" in the ItemStack directory"); + + return ret; + } + public static ArrayList tools = new ArrayList(20); + + //Parts + + /** List: Item ID, metadata, material ID + * ItemStack: Output. Ex: Cactus Binding + */ + public static HashMap patternPartMapping = new HashMap(); + + /** Maps an item and a material ID to an output part + * + * @param patternID ID to check against + * @param patternMeta Metadata to check against + * @param materialID Material that goes with the item + * @param output The resulting part + */ + public static void addPartMapping(int patternID, int patternMeta, int materialID, ItemStack output) + { + patternPartMapping.put(Arrays.asList(patternID, patternMeta, materialID), output); + } + + public static ItemStack getPartMapping(int itemID, int metadata, int materialID) + { + return patternPartMapping.get(Arrays.asList(itemID, metadata, materialID)).copy(); + } + + //Tools + + /** Internal tool mapping, used for adding textures + * + * @param tool + */ + + public static void addToolMapping (ToolCore tool) + { + tools.add(tool); + } + + /** Internal tool mapping, used for adding textures + * + * @return List of tools + */ + + public static ArrayList getToolMapping () + { + return tools; + } + + /** Registers a tool to its crafting parts. + * If an output is registered multiple times the parts are added to the recipe's input list + * Valid part amounts are 1, 2, and 4. Part counts of 1 and 2 assume a Tool Rod as a handle. + * Null items are valid as placeholders. ex: Hatchet + * + * @see ToolBuidler + * @param output The ToolCore to craft + * @param parts Pieces to make the tool with + */ + public static void addToolRecipe(ToolCore output, Item... parts) + { + ToolBuilder tb = ToolBuilder.instance; + if (parts.length < 1 || parts.length > 4 || parts.length == 3) + System.out.println("[TCon API] Wrong amount of items to craft into a tool"); + + tb.addToolRecipe(output, parts); + } + + //Materials + public static HashMap toolMaterials = new HashMap(40); + public static HashMap toolMaterialStrings = new HashMap(40); + + /** Adds a tool material to the registry + * + * @param materialID Unique ID, stored for each part + * @exception materialID must be unique + * @param materialName Unique name for data lookup purposes + * @param harvestLevel The materials which the tool can harvest. Pickaxe levels - 0: Wood, 1: Stone, 2: Redstone/Diamond, 3: Obsidian, 4: Cobalt/Ardite, 5: Manyullyn + * @param durability Base durability of the tool, affects tool heads. + * @param miningspeed Base mining speed, divided by 100 in use + * @param attack Base attack + * @param handleModifier Durability multiplier on the tool + * @param reinforced Reinforced level + * @param unbreaking Amount of Stonebound to put on the tool. Negative numbers are Spiny. + */ + + public static void addToolMaterial (int materialID, String materialName, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced, + float unbreaking, String style, String ability) + { + ToolMaterial mat = toolMaterials.get(materialID); + if (mat == null) + { + mat = new ToolMaterial(materialName, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, unbreaking, style, ability); + toolMaterials.put(materialID, mat); + toolMaterialStrings.put(materialName, mat); + } + else + throw new IllegalArgumentException("[TCon API] Material ID " + materialID + " is already occupied by " + mat.materialName); + } + + /** Adds a tool material to the registry + * + * @param materialID Unique ID, stored for each part + * @exception materialID must be unique + * @param material Complete tool material to add. Uses the name in the material for lookup purposes. + */ + + public static void addtoolMaterial(int materialID, ToolMaterial material) + { + ToolMaterial mat = toolMaterials.get(materialID); + if (mat == null) + { + toolMaterials.put(materialID, mat); + toolMaterialStrings.put(material.name(), mat); + } + else + throw new IllegalArgumentException("[TCon API] Material ID " + materialID + " is already occupied by " + mat.materialName); + } + + /** Looks up a tool material by ID + * + * @param key The ID to look up + * @return Tool Material + */ + + public static ToolMaterial getMaterial (int key) + { + return (toolMaterials.get(key)); + } + + /** Looks up a tool material by name + * + * @param key the name to look up + * @return Tool Material + */ + + public static ToolMaterial getMaterial (String key) + { + return (toolMaterialStrings.get(key)); + } + + public static LiquidCasting getTableCasting () + { + return instance.tableCasting(); + } + + LiquidCasting tableCasting () + { + try + { + Class clazz = Class.forName("mods.tinker.tconstruct.TConstruct"); + Method method = clazz.getMethod("getTableCasting"); + LiquidCasting lc = (LiquidCasting) method.invoke(this); + return lc; + } + catch (Exception e) + { + System.out.println("[TCon API] Could not find casting table recipes."); + return null; + } + } + + public static LiquidCasting getBasinCasting () + { + return instance.basinCasting(); + } + + LiquidCasting basinCasting () + { + try + { + Class clazz = Class.forName("mods.tinker.tconstruct.TConstruct"); + Method method = clazz.getMethod("getBasinCasting"); + LiquidCasting lc = (LiquidCasting) method.invoke(this); + return lc; + } + catch (Exception e) + { + System.out.println("[TCon API] Could not find casting basin recipes."); + return null; + } + } + + public static Detailing getChiselDetailing () + { + return instance.chiselDetailing(); + } + + Detailing chiselDetailing () + { + try + { + Class clazz = Class.forName("mods.tinker.tconstruct.TConstruct"); + Method method = clazz.getMethod("getChiselDetailing"); + Detailing lc = (Detailing) method.invoke(this); + return lc; + } + catch (Exception e) + { + System.out.println("[TCon API] Could not find chisel detailing recipes."); + return null; + } + } + + public static ArrayList activeModifiers = new ArrayList(); + public static void registerActiveToolMod(ActiveToolMod mod) + { + activeModifiers.add(mod); + } + + /** Default Material Index + * 0: Wood + * 1: Stone + * 2: Iron + * 3: Flint + * 4: Cactus + * 5: Bone + * 6: Obsidian + * 7: Netherrack + * 8: Green Slime + * 9: Paper + * 10: Cobalt + * 11: Ardite + * 12: Manyullyn + * 13: Copper + * 14: Bronze + * 15: Alumite + * 16: Steel + * 17: Blue Slime + */ +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/blocks/InventoryBlock.java b/src/minecraft/mods/tinker/tconstruct/library/blocks/InventoryBlock.java new file mode 100755 index 000000000..ab67cfc11 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/blocks/InventoryBlock.java @@ -0,0 +1,157 @@ +package mods.tinker.tconstruct.library.blocks; + +import java.util.Random; + +import mods.tinker.tconstruct.library.util.IActiveLogic; +import mods.tinker.tconstruct.library.util.IFacingLogic; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.entity.EntityLiving; +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.Icon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +public abstract class InventoryBlock extends BlockContainer +{ + protected Random rand = new Random(); + + protected InventoryBlock(int id, Material material) + { + super(id, material); + } + + /* Logic backend */ + public TileEntity createNewTileEntity (World var1) + { return null; } + public abstract TileEntity createTileEntity(World world, int metadata); + public abstract Integer getGui(World world, int x, int y, int z, EntityPlayer entityplayer); + public abstract Object getModInstance(); + + @Override + public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int side, float clickX, float clickY, float clickZ) + { + if (player.isSneaking()) + return false; + + Integer integer = getGui(world, x, y, z, player); + if (integer == null || integer == -1) + { + return false; + } + else + { + if (!world.isRemote) + player.openGui(getModInstance(), integer, world, x, y, z); + return true; + } + } + + /* Inventory */ + + @Override + public void breakBlock (World par1World, int x, int y, int z, int par5, int par6) + { + TileEntity te = par1World.getBlockTileEntity(x, y, z); + + if (te != null && te instanceof InventoryLogic) + { + InventoryLogic logic = (InventoryLogic) te; + for (int iter = 0; iter < logic.getSizeInventory(); ++iter) + { + ItemStack stack = logic.getStackInSlot(iter); + + if (stack != null && logic.canDropInventorySlot(iter)) + { + float jumpX = rand.nextFloat() * 0.8F + 0.1F; + float jumpY = rand.nextFloat() * 0.8F + 0.1F; + float jumpZ = rand.nextFloat() * 0.8F + 0.1F; + + while (stack.stackSize > 0) + { + int itemSize = rand.nextInt(21) + 10; + + if (itemSize > stack.stackSize) + { + itemSize = stack.stackSize; + } + + stack.stackSize -= itemSize; + EntityItem entityitem = new EntityItem(par1World, (double) ((float) x + jumpX), (double) ((float) y + jumpY), (double) ((float) z + jumpZ), new ItemStack(stack.itemID, + itemSize, stack.getItemDamage())); + + if (stack.hasTagCompound()) + { + entityitem.getEntityItem().setTagCompound((NBTTagCompound) stack.getTagCompound().copy()); + } + + float offset = 0.05F; + entityitem.motionX = (double) ((float) rand.nextGaussian() * offset); + entityitem.motionY = (double) ((float) rand.nextGaussian() * offset + 0.2F); + entityitem.motionZ = (double) ((float) rand.nextGaussian() * offset); + par1World.spawnEntityInWorld(entityitem); + } + } + } + } + + super.breakBlock(par1World, x, y, z, par5, par6); + } + + /* Placement */ + + @Override + public void onBlockPlacedBy (World world, int x, int y, int z, EntityLiving entityliving, ItemStack stack) + { + TileEntity logic = world.getBlockTileEntity(x, y, z); + if (logic instanceof IFacingLogic) + { + IFacingLogic direction = (IFacingLogic) logic; + if (entityliving == null) + { + direction.setDirection(0F, 0F, null); + } + else + { + direction.setDirection(entityliving.rotationYaw * 4F, entityliving.rotationPitch, entityliving); + } + } + } + + public static boolean isActive (IBlockAccess world, int x, int y, int z) + { + TileEntity logic = world.getBlockTileEntity(x, y, z); + if (logic instanceof IActiveLogic) + { + return ((IActiveLogic) logic).getActive(); + } + return false; + } + + public int damageDropped (int meta) + { + return meta; + } + + /* Textures */ + public Icon[] icons; + + public abstract String[] getTextureNames (); + + @Override + public void registerIcons (IconRegister iconRegister) + { + String[] textureNames = getTextureNames(); + this.icons = new Icon[textureNames.length]; + + for (int i = 0; i < this.icons.length; ++i) + { + this.icons[i] = iconRegister.registerIcon("tinker:" + textureNames[i]); + } + } +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/blocks/InventoryLogic.java b/src/minecraft/mods/tinker/tconstruct/library/blocks/InventoryLogic.java new file mode 100755 index 000000000..3f345680c --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/blocks/InventoryLogic.java @@ -0,0 +1,174 @@ +package mods.tinker.tconstruct.library.blocks; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +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.minecraft.world.World; + +/* + * A simple logic class for storing items + * Abstract to avoid instantiation + */ + +public abstract class InventoryLogic extends TileEntity + implements IInventory +{ + protected ItemStack[] inventory; + protected String invName; + + public InventoryLogic(int invSize) + { + inventory = new ItemStack[invSize]; + } + + /* Inventory management */ + + @Override + public ItemStack getStackInSlot(int slot) + { + return inventory[slot]; + } + + public boolean isStackInSlot(int slot) + { + return inventory[slot] != null; + } + + @Override + public int getSizeInventory() + { + return inventory.length; + } + + @Override + public int getInventoryStackLimit () + { + return 64; + } + + public boolean canDropInventorySlot(int slot) + { + return true; + } + + @Override + public void setInventorySlotContents(int slot, ItemStack itemstack) + { + inventory[slot] = itemstack; + if (itemstack != null && itemstack.stackSize > getInventoryStackLimit()) + { + itemstack.stackSize = getInventoryStackLimit(); + } + } + + @Override + public ItemStack decrStackSize(int slot, int quantity) + { + if (inventory[slot] != null) + { + if (inventory[slot].stackSize <= quantity) + { + ItemStack stack = inventory[slot]; + inventory[slot] = null; + return stack; + } + ItemStack split = inventory[slot].splitStack(quantity); + if (inventory[slot].stackSize == 0) + { + inventory[slot] = null; + } + return split; + } + else + { + return null; + } + } + + /* Supporting methods */ + @Override + public boolean isUseableByPlayer(EntityPlayer entityplayer) + { + if (worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) != this) + return false; + + else + return entityplayer.getDistance((double)xCoord + 0.5D, (double)yCoord + 0.5D, (double)zCoord + 0.5D) <= 64D; + + } + + public abstract Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z); + + /* NBT */ + @Override + public void readFromNBT(NBTTagCompound tags) + { + super.readFromNBT(tags); + this.invName = tags.getString("InvName"); + NBTTagList nbttaglist = tags.getTagList("Items"); + inventory = new ItemStack[getSizeInventory()]; + for (int iter = 0; iter < nbttaglist.tagCount(); iter++) + { + NBTTagCompound tagList = (NBTTagCompound)nbttaglist.tagAt(iter); + byte slotID = tagList.getByte("Slot"); + if (slotID >= 0 && slotID < inventory.length) + { + inventory[slotID] = ItemStack.loadItemStackFromNBT(tagList); + } + } + } + + @Override + public void writeToNBT(NBTTagCompound tags) + { + super.writeToNBT(tags); + if (invName != null) + tags.setString("InvName", invName); + NBTTagList nbttaglist = new NBTTagList(); + for (int iter = 0; iter < inventory.length; iter++) + { + if (inventory[iter] != null) + { + NBTTagCompound tagList = new NBTTagCompound(); + tagList.setByte("Slot", (byte)iter); + inventory[iter].writeToNBT(tagList); + nbttaglist.appendTag(tagList); + } + } + + tags.setTag("Items", nbttaglist); + } + + /* Default implementations of hardly used methods */ + public ItemStack getStackInSlotOnClosing (int slot) { return null; } + public void openChest () {} + public void closeChest () {} + + protected abstract String getDefaultName(); + + public String getInvName() + { + return this.isInvNameLocalized() ? this.invName : getDefaultName(); + } + + public boolean isInvNameLocalized() + { + return this.invName != null && this.invName.length() > 0; + } + + @Override + public boolean isStackValidForSlot (int slot, ItemStack itemstack) + { + if (slot < getSizeInventory()) + { + if (inventory[slot] == null || itemstack.stackSize + inventory[slot].stackSize <= getInventoryStackLimit()) + return true; + } + return false; + } +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/client/TConstructClientRegistry.java b/src/minecraft/mods/tinker/tconstruct/library/client/TConstructClientRegistry.java new file mode 100755 index 000000000..0b143eb3b --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/client/TConstructClientRegistry.java @@ -0,0 +1,148 @@ +package mods.tinker.tconstruct.library.client; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import mods.tinker.tconstruct.library.TConstructRegistry; +import mods.tinker.tconstruct.library.crafting.ToolBuilder; +import mods.tinker.tconstruct.library.tools.ToolCore; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class TConstructClientRegistry +{ + public static ArrayList toolButtons = new ArrayList(20); + public static ArrayList tierTwoButtons = new ArrayList(); + public static Map manualIcons = new HashMap(); + public static Map recipeIcons = new HashMap(); + public static ItemStack defaultStack = new ItemStack(Item.ingotIron); + + public static void addMaterialRenderMapping (int materialID, String domain, String renderName, boolean useDefaultFolder) + { + for (ToolCore tool : TConstructRegistry.getToolMapping()) + { + String[] toolIcons = new String[tool.getPartAmount() + 1]; + for (int i = 0; i < tool.getPartAmount() + 1; i++) + { + String icon = domain + ":"; + if (useDefaultFolder) + icon += tool.getDefaultFolder() + "/"; + icon += renderName + tool.getIconSuffix(i); + toolIcons[i] = icon; + } + tool.registerPartPaths(materialID, toolIcons); + } + } + public static void addEffectRenderMapping (ToolCore tool, int materialID, String domain, String renderName, boolean useDefaultFolder) + { + String icon = domain + ":"; + if (useDefaultFolder) + icon += tool.getDefaultFolder() + "/"; + icon += renderName + tool.getEffectSuffix(); + tool.registerEffectPath(materialID, icon); + } + + public static void addEffectRenderMapping (int materialID, String domain, String renderName, boolean useDefaultFolder) + { + for (ToolCore tool : TConstructRegistry.getToolMapping()) + { + String icon = domain + ":"; + if (useDefaultFolder) + icon += tool.getDefaultFolder() + "/"; + icon += renderName + tool.getEffectSuffix(); + tool.registerEffectPath(materialID, icon); + } + } + + public static void addSingleEffectRenderMapping (ToolCore tool, int materialID, String domain, String renderName, boolean useDefaultFolder) + { + String icon = domain + ":"; + if (useDefaultFolder) + icon += tool.getDefaultFolder() + "/"; + icon += renderName + tool.getEffectSuffix(); + tool.registerEffectPath(materialID, icon); + } + + public static void registerManualIcon (String name, ItemStack stack) + { + manualIcons.put(name, stack); + } + + public static ItemStack getManualIcon (String textContent) + { + ItemStack stack = manualIcons.get(textContent); + if (stack != null) + return stack; + return defaultStack; + } + + public static void registerManualSmallRecipe (String name, ItemStack output, ItemStack... stacks) + { + ItemStack[] recipe = new ItemStack[5]; + recipe[0] = output; + System.arraycopy(stacks, 0, recipe, 1, 4); + recipeIcons.put(name, recipe); + } + + public static void registerManualLargeRecipe (String name, ItemStack output, ItemStack... stacks) + { + ItemStack[] recipe = new ItemStack[10]; + recipe[0] = output; + System.arraycopy(stacks, 0, recipe, 1, 9); + recipeIcons.put(name, recipe); + } + + public static void registerManualFurnaceRecipe (String name, ItemStack output, ItemStack input) + { + ItemStack[] recipe = new ItemStack[2]; + recipe[0] = output; + recipe[1] = input; + recipeIcons.put(name, recipe); + } + + public static void registerManualModifier (String name, ItemStack output, ItemStack topinput) + { + registerManualModifier(name, output, topinput, null); + } + + public static void registerManualModifier (String name, ItemStack output, ItemStack topinput, ItemStack bottominput) + { + ItemStack[] recipe = new ItemStack[3]; + recipe[0] = ToolBuilder.instance.buildTool(output, topinput, bottominput, ""); + recipe[1] = topinput; + recipe[2] = bottominput; + recipeIcons.put(name, recipe); + } + + public static ItemStack[] getRecipeIcons (String recipeName) + { + return recipeIcons.get(recipeName); + } + + //Gui + public static void addToolButton (ToolGuiElement element) + { + toolButtons.add(element); + } + + public static void addToolButton (int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body, String texture) + { + toolButtons.add(new ToolGuiElement(slotType, xButton, yButton, xIcons, yIcons, title, body, texture)); + } + + public static void addTierTwoButton (ToolGuiElement element) + { + tierTwoButtons.add(element); + } + + public static void addTierTwoButton (int slotType, int xButton, int yButton, int[] xIcons, int[] yIcons, String title, String body, String texture) + { + tierTwoButtons.add(new ToolGuiElement(slotType, xButton, yButton, xIcons, yIcons, title, body, texture)); + } + + public static ArrayList getToolButtons () + { + return toolButtons; + } +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/client/ToolGuiElement.java b/src/minecraft/mods/tinker/tconstruct/library/client/ToolGuiElement.java new file mode 100755 index 000000000..9066842c2 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/client/ToolGuiElement.java @@ -0,0 +1,25 @@ +package mods.tinker.tconstruct.library.client; + +public class ToolGuiElement +{ + public final int slotType; + public final int buttonIconX; + public final int buttonIconY; + public final int[] iconsX; + public final int[] iconsY; + public final String title; + public final String body; + public final String texture; + + public ToolGuiElement(int st, int bx, int by, int[] xi, int[] yi, String t, String b, String tex) + { + slotType = st; + buttonIconX = bx; + buttonIconY = by; + iconsX = xi; + iconsY = yi; + title = t; + body = b; + texture = tex; + } +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/crafting/AlloyMix.java b/src/minecraft/mods/tinker/tconstruct/library/crafting/AlloyMix.java new file mode 100755 index 000000000..3aa6da696 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/crafting/AlloyMix.java @@ -0,0 +1,93 @@ +package mods.tinker.tconstruct.library.crafting; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.minecraftforge.liquids.LiquidStack; + +public class AlloyMix +{ + public final LiquidStack result; + public final List mixers; + + public AlloyMix(LiquidStack output, List inputs) + { + result = output; + mixers = inputs; + } + + /*public boolean matches(List liquids) + { + ArrayList list = new ArrayList(mixers); + return false; + }*/ + + public LiquidStack mix (ArrayList liquids) + { + ArrayList copyMix = new ArrayList(mixers); + ArrayList effectiveAmount = new ArrayList(); + + for (int i = 0; i < liquids.size(); i++) + { + LiquidStack liquid = liquids.get(i); + Iterator iter = copyMix.iterator(); + while (iter.hasNext()) + { + LiquidStack mixer = (LiquidStack) iter.next(); + if (mixer.itemID == liquid.itemID && mixer.itemMeta == liquid.itemMeta) + { + int eAmt = liquid.amount / mixer.amount; + effectiveAmount.add(eAmt); + copyMix.remove(mixer); + //inputs.add(liquid); + break; + } + } + } + //} + + if (copyMix.size() > 0) + return null; + + //Remove old liquids + int low = getLowestAmount(effectiveAmount); + ArrayList copyMix2 = new ArrayList(mixers); + + for (int i = 0; i < liquids.size(); i++) + { + LiquidStack liquid = liquids.get(i); + Iterator iter = copyMix2.iterator(); + while (iter.hasNext()) + { + LiquidStack mixer = (LiquidStack) iter.next(); + if (mixer.itemID == liquid.itemID && mixer.itemMeta == liquid.itemMeta) + { + int eAmt = low * mixer.amount; + liquid.amount -= eAmt; + if (liquid.amount <= 0) + { + liquids.remove(liquid); + i--; + } + copyMix2.remove(mixer); + break; + } + } + } + + return new LiquidStack(result.itemID, result.amount * low, result.itemMeta); + } + + int getLowestAmount (ArrayList list) + { + int frist = (Integer) list.get(0); //FRIST!!! + for (int i = 1; i < list.size(); i++) + { + int compare = (Integer) list.get(i); + if (frist > compare) + frist = compare; + } + return frist; + } +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/crafting/CastingRecipe.java b/src/minecraft/mods/tinker/tconstruct/library/crafting/CastingRecipe.java new file mode 100755 index 000000000..62203d2a6 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/crafting/CastingRecipe.java @@ -0,0 +1,35 @@ +package mods.tinker.tconstruct.library.crafting; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.liquids.LiquidStack; + +public class CastingRecipe +{ + public ItemStack output; + public LiquidStack castingMetal; + public ItemStack cast; + public boolean consumeCast; + public int coolTime; + + public CastingRecipe(ItemStack replacement, LiquidStack metal, ItemStack cast, boolean consume, int delay) + { + castingMetal = metal; + this.cast = cast; + output = replacement; + consumeCast = consume; + coolTime = delay; + } + + public boolean matches(LiquidStack metal, ItemStack cast) + { + if (castingMetal.isLiquidEqual(metal) && ItemStack.areItemStacksEqual(this.cast, cast)) + return true; + else + return false; + } + + public ItemStack getResult() + { + return output.copy(); + } +} \ No newline at end of file diff --git a/src/minecraft/mods/tinker/tconstruct/library/crafting/Detailing.java b/src/minecraft/mods/tinker/tconstruct/library/crafting/Detailing.java new file mode 100755 index 000000000..aa3b426a0 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/crafting/Detailing.java @@ -0,0 +1,126 @@ +package mods.tinker.tconstruct.library.crafting; + +import java.util.ArrayList; +import java.util.List; + +import mods.tinker.tconstruct.library.tools.ToolCore; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.ShapelessRecipes; +import net.minecraft.nbt.NBTTagCompound; +import cpw.mods.fml.common.registry.GameRegistry; + +public class Detailing +{ + public List detailing = new ArrayList(); + + public void addDetailing (Object input, int inputMeta, Object output, int outputMeta, ToolCore tool) + { + int iID, iMeta = inputMeta, oID, oMeta = outputMeta; + + if (input instanceof Block) + iID = ((Block) input).blockID; + + else if (input instanceof Item) + iID = ((Item) input).itemID; + + else if (input instanceof Integer) + iID = (Integer) input; + + else + throw new RuntimeException("Invalid detail input!"); + + if (output instanceof Block) + oID = ((Block) output).blockID; + + else if (output instanceof Item) + oID = ((Item) output).itemID; + + else if (output instanceof Integer) + oID = (Integer) output; + + else + throw new RuntimeException("Invalid detail output!"); + + this.addDetailing(new DetailInput(iID, iMeta, oID, oMeta), tool); + } + + public void addDetailing (DetailInput details, ToolCore tool) + { + detailing.add(details); + ItemStack toolstack = new ItemStack(tool, 1, Short.MAX_VALUE); + + NBTTagCompound compound = new NBTTagCompound(); + NBTTagCompound toolTag = new NBTTagCompound(); + toolTag.setInteger("RenderHandle", 0); + toolTag.setInteger("RenderHead", 2); + toolTag.setInteger("RenderAccessory", 2); + toolTag.setInteger("Damage", 0); + toolTag.setInteger("TotalDurability", 100); + compound.setCompoundTag("InfiTool", toolTag); + toolstack.setTagCompound(compound); + addShapelessToolRecipe(new ItemStack(details.outputID, 1, details.outputMeta), toolstack, new ItemStack(details.inputID, 1, details.inputMeta)); + } + + public void addShapelessToolRecipe (ItemStack par1ItemStack, Object... par2ArrayOfObj) + { + ArrayList arraylist = new ArrayList(); + Object[] aobject = par2ArrayOfObj; + int i = par2ArrayOfObj.length; + + for (int j = 0; j < i; ++j) + { + Object object1 = aobject[j]; + + if (object1 instanceof ItemStack) + { + arraylist.add(((ItemStack) object1).copy()); + } + else if (object1 instanceof Item) + { + arraylist.add(new ItemStack((Item) object1)); + } + else + { + if (!(object1 instanceof Block)) + { + throw new RuntimeException("Invalid shapeless tool recipe!"); + } + + arraylist.add(new ItemStack((Block) object1)); + } + } + + GameRegistry.addRecipe(new ShapelessToolRecipe(par1ItemStack, arraylist)); + } + + public DetailInput getDetailing (int inputID, int inputMeta) + { + for (int i = 0; i < detailing.size(); i++) + { + DetailInput detail = (DetailInput) detailing.get(i); + if (inputID == detail.inputID && inputMeta == detail.inputMeta) + { + return detail; + } + } + return null; + } + + public class DetailInput + { + public int inputID; + public int inputMeta; + public int outputID; + public int outputMeta; + + public DetailInput(int inputID, int inputMeta, int outputID, int outputMeta) + { + this.inputID = inputID; + this.inputMeta = inputMeta; + this.outputID = outputID; + this.outputMeta = outputMeta; + } + } +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/crafting/LiquidCasting.java b/src/minecraft/mods/tinker/tconstruct/library/crafting/LiquidCasting.java new file mode 100755 index 000000000..57441dd77 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/crafting/LiquidCasting.java @@ -0,0 +1,84 @@ +package mods.tinker.tconstruct.library.crafting; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.liquids.LiquidStack; + +/* Melting becomes hardened */ +public class LiquidCasting +{ + //public static LiquidCasting instance = new LiquidCasting(); + private ArrayList casts = new ArrayList(); + + /** Adds a casting recipe + * + * @param output Result of the cast + * @param metal Liquid to be used in casting. This also decides how much metal is consumed + * @param cast The empty item to cast with. ex Ingot Cast + * @param consume Whether the item should be consumed while casting + * @param delay Time to cast in ticks + */ + public void addCastingRecipe (ItemStack output, LiquidStack metal, ItemStack cast, boolean consume, int delay) + { + casts.add(new CastingRecipe(output, metal, cast, consume, delay)); + } + + /** Adds a casting recipe. Does not consume the cast + * + * @param output Result of the cast + * @param metal Liquid to be used in casting. This also decides how much metal is consumed + * @param cast The empty item to cast with. ex Ingot Cast + * @param delay Time to cast in ticks + */ + public void addCastingRecipe (ItemStack output, LiquidStack metal, ItemStack cast, int delay) + { + addCastingRecipe(output, metal, cast, false, delay); + } + + /** Adds a casting recipe. Does not consume the cast or have an item to cast against + * + * @param output Result of the cast + * @param metal Liquid to be used in casting. This also decides how much metal is consumed + * @param delay Time to cast in ticks + */ + public void addCastingRecipe (ItemStack output, LiquidStack metal, int delay) + { + addCastingRecipe(output, metal, null, false, delay); + } + + public int getCastingDelay (LiquidStack metal, ItemStack cast) + { + CastingRecipe recipe = getCastingRecipe(metal, cast); + if (recipe != null) + return recipe.coolTime; + return -1; + } + + public int getCastingAmount (LiquidStack metal, ItemStack cast) + { + CastingRecipe recipe = getCastingRecipe(metal, cast); + if (recipe != null) + return recipe.castingMetal.amount; + return 0; + } + + public CastingRecipe getCastingRecipe (LiquidStack metal, ItemStack cast) + { + for (CastingRecipe recipe : casts) + { + if (recipe.matches(metal, cast)) + return recipe; + } + return null; + } + + //Getter for public viewing + public ArrayList getCastingRecipes() + { + return casts; + } +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/crafting/PatternBuilder.java b/src/minecraft/mods/tinker/tconstruct/library/crafting/PatternBuilder.java new file mode 100755 index 000000000..3abd2e576 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/crafting/PatternBuilder.java @@ -0,0 +1,227 @@ +package mods.tinker.tconstruct.library.crafting; + +/** How to build tool parts? With patterns! */ +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import mods.tinker.tconstruct.library.util.IPattern; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class PatternBuilder +{ + public static PatternBuilder instance = new PatternBuilder(); + //Map items to their parts with a hashmap + public List materials = new ArrayList(); + public HashMap materialSets = new HashMap(); + + //We could use IRecipe if it wasn't tied to InventoryCrafting + public List toolPatterns = new ArrayList(); + + /* Register methods */ + public void registerMaterial (ItemStack material, int value, String key) + { + materials.add(new ItemKey(material.getItem(), material.getItemDamage(), value, key)); + } + + public void registerMaterialSet (String key, ItemStack shard, ItemStack rod, int materialID) + { + materialSets.put(key, new MaterialSet(shard, rod, materialID)); + materials.add(new ItemKey(shard.getItem(), shard.getItemDamage(), 1, key)); + } + + public void registerFullMaterial (ItemStack material, int value, String key, ItemStack shard, ItemStack rod, int materialID) + { + materials.add(new ItemKey(material.getItem(), material.getItemDamage(), value, key)); + materials.add(new ItemKey(shard.getItem(), shard.getItemDamage(), 1, key)); + materialSets.put(key, new MaterialSet(shard, rod, materialID)); + } + + public void addToolPattern (IPattern item) + { + toolPatterns.add(item); + } + + /* Build tool parts from patterns */ + public ItemStack[] getToolPart (ItemStack material, ItemStack pattern, ItemStack otherPattern) + { + if (material != null && pattern != null) + { + ItemKey key = getItemKey(material); + if (key != null) + { + MaterialSet mat = (MaterialSet) materialSets.get(key.key); + ItemStack toolPart = getMatchingPattern(pattern, material, mat); + + if (toolPart != null) + { + int patternValue = ((IPattern) pattern.getItem()).getPatternCost(pattern); + int totalMaterial = key.value * material.stackSize; + + if (totalMaterial < patternValue) // Not enough material + return null; + + else if (patternValue == key.value) //Material only + return new ItemStack[] { toolPart, null }; + + else + { + if (patternValue % 2 == 1) + { + return new ItemStack[] { toolPart, mat.shard.copy() }; //Material + shard + } + else + return new ItemStack[] { toolPart, null }; + } + /*if ( patternValue < totalMaterial ) + { + if (otherPattern != null) + { + int otherValue = ((IPattern)otherPattern.getItem()).getPatternCost(otherPattern.getItemDamage()); + if (patternValue + otherValue <= key.value) + { + ItemStack otherPart = getMatchingPattern(otherPattern, mat); + return new ItemStack[] { toolPart, otherPart }; //Material + Material + } + } + } + + else if ( patternValue == key.value ) + return new ItemStack[] { new ItemStack(toolPart, 1, mat.materialID), null }; //Material only + + else + return null; //Not a valid match*/ + } + } + } + return null; + } + + public int getPartID (ItemStack material) + { + if (material != null) + { + ItemKey key = getItemKey(material); + if (key != null) + { + MaterialSet set = (MaterialSet) materialSets.get(key.key); + return set.materialID; + } + } + return Short.MAX_VALUE; + } + + public int getPartValue (ItemStack material) + { + if (material != null) + { + ItemKey key = getItemKey(material); + if (key != null) + return key.value; + } + return 0; + } + + public ItemKey getItemKey (ItemStack material) + { + Item mat = material.getItem(); + int damage = material.getItemDamage(); + for (ItemKey ik : materials) + { + if (mat == ik.item && (ik.damage == Short.MAX_VALUE || damage == ik.damage)) + return ik; + } + return null; + } + + public ItemStack getMatchingPattern (ItemStack stack, ItemStack input, MaterialSet set) + { + Item item = stack.getItem(); + for (IPattern pattern : toolPatterns) + { + if (pattern == item) + return pattern.getPatternOutput(stack, input, set); + } + return null; + } + + public ItemStack getShardFromSet(String materialset) + { + MaterialSet set = (MaterialSet) materialSets.get(materialset); + if (set != null) + return set.shard.copy(); + return null; + } + + public ItemStack getRodFromSet(String materialset) + { + MaterialSet set = (MaterialSet) materialSets.get(materialset); + if (set != null) + return set.rod.copy(); + return null; + } + + //Small data classes. I would prefer the struct from C#, but we do what we can. + public class ItemKey + { + public final Item item; + public final int damage; + public final int value; + public final String key; + + public ItemKey(Item i, int d, int v, String s) + { + item = i; + damage = d; + value = v; + key = s; + } + } + + public class MaterialSet + { + public final ItemStack shard; + public final ItemStack rod; + public final int materialID; + + public MaterialSet(ItemStack s, ItemStack r, int id) + { + shard = s; + rod = r; + materialID = id; + } + } + + //Helper Methods + public void registerMaterial (Block material, int value, String key) + { + registerMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key); + } + + public void registerMaterial (Item material, int value, String key) + { + registerMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key); + } + + public void registerFullMaterial (Block material, int value, String key, ItemStack shard, ItemStack rod, int materialID) + { + registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, shard, rod, materialID); + } + + public void registerFullMaterial (Item material, int value, String key, ItemStack shard, ItemStack rod, int materialID) + { + registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, shard, rod, materialID); + } + + /*public void registerFullMaterial (Block material, int value, String key, int materialID) + { + registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, new ItemStack(TContent.toolShard, 1, materialID), new ItemStack(TContent.toolRod, 1, materialID), materialID); + } + + public void registerFullMaterial (Item material, int value, String key, int materialID) + { + registerFullMaterial(new ItemStack(material, 1, Short.MAX_VALUE), value, key, new ItemStack(TContent.toolShard, 1, materialID), new ItemStack(TContent.toolRod, 1, materialID), materialID); + }*/ +} \ No newline at end of file diff --git a/src/minecraft/mods/tinker/tconstruct/library/crafting/ShapelessToolRecipe.java b/src/minecraft/mods/tinker/tconstruct/library/crafting/ShapelessToolRecipe.java new file mode 100755 index 000000000..ab45ab302 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/crafting/ShapelessToolRecipe.java @@ -0,0 +1,68 @@ +package mods.tinker.tconstruct.library.crafting; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import mods.tinker.tconstruct.library.tools.ToolCore; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.ShapelessRecipes; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public class ShapelessToolRecipe extends ShapelessRecipes +{ + + public ShapelessToolRecipe(ItemStack par1ItemStack, List par2List) + { + super(par1ItemStack, par2List); + } + + @Override + public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World) + { + ArrayList arraylist = new ArrayList(this.recipeItems); + + for (int i = 0; i < 3; ++i) + { + for (int j = 0; j < 3; ++j) + { + ItemStack itemstack = par1InventoryCrafting.getStackInRowAndColumn(j, i); + + if (itemstack != null) + { + boolean flag = false; + Iterator iterator = arraylist.iterator(); + + while (iterator.hasNext()) + { + ItemStack itemstack1 = (ItemStack)iterator.next(); + + //System.out.println("Rawr! "+itemstack1.getItemDamage()); + if (itemstack.itemID == itemstack1.itemID && (itemstack1.getItemDamage() == Short.MAX_VALUE || itemstack.getItemDamage() == itemstack1.getItemDamage())) + { + if (itemstack.getItem() instanceof ToolCore) + { + NBTTagCompound tags = itemstack.getTagCompound().getCompoundTag("InfiTool"); + if (tags.getBoolean("Broken")) + return false; + } + flag = true; + arraylist.remove(itemstack1); + break; + } + } + + if (!flag) + { + return false; + } + } + } + } + + return arraylist.isEmpty(); + } + +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/crafting/Smeltery.java b/src/minecraft/mods/tinker/tconstruct/library/crafting/Smeltery.java new file mode 100755 index 000000000..508338fba --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/crafting/Smeltery.java @@ -0,0 +1,172 @@ +package mods.tinker.tconstruct.library.crafting; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraftforge.liquids.LiquidStack; + +/** Melting and hacking, churn and burn */ +public class Smeltery +{ + public static Smeltery instance = new Smeltery(); + + private HashMap, LiquidStack> smeltingList = new HashMap, LiquidStack>(); + private HashMap, Integer> temperatureList = new HashMap, Integer>(); + private HashMap, ItemStack> renderIndex = new HashMap, ItemStack>(); + private ArrayList alloys = new ArrayList(); + + /** Adds mappings between an itemstack and an output liquid + * Example: Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0)); + * + * @param stack The itemstack to liquify + * @param temperature How hot the block should be before liquifying. Max temp in the Smeltery is 800, other structures may vary + * @param output The result of the process in liquid form + */ + public static void addMelting(ItemStack stack, int temperature, LiquidStack output) + { + addMelting(stack, stack.itemID, stack.getItemDamage(), temperature, output); + } + + /** Adds mappings between a block and its liquid + * Example: Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0)); + * + * @param blockID The ID of the block to liquify and render + * @param metadata The metadata of the block to liquify and render + * @param temperature How hot the block should be before liquifying. Max temp in the Smeltery is 800, other structures may vary + * @param output The result of the process in liquid form + */ + public static void addMelting(Block block, int metadata, int temperature, LiquidStack output) + { + addMelting(new ItemStack(block, 1, metadata), block.blockID, metadata, temperature, output); + } + + /** Adds mappings between an input and its liquid. + * Renders with the given input's block ID and metadata + * Example: Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0)); + * + * @param input The item to liquify + * @param blockID The ID of the block to render + * @param metadata The metadata of the block to render + * @param temperature How hot the block should be before liquifying + * @param liquid The result of the process + */ + public static void addMelting(ItemStack input, int blockID, int metadata, int temperature, LiquidStack liquid) + { + instance.smeltingList.put(Arrays.asList(input.itemID, input.getItemDamage()), liquid); + instance.temperatureList.put(Arrays.asList(input.itemID, input.getItemDamage()), temperature); + instance.renderIndex.put(Arrays.asList(input.itemID, input.getItemDamage()), new ItemStack(blockID, input.stackSize, metadata)); + } + + /** Adds an alloy mixing recipe. + * Example: Smeltery.addAlloyMixing(new LiquidStack(bronzeID, 2, 0), new LiquidStack(copperID, 3, 0), new LiquidStack(tinID, 1, 0)); + * The example mixes 3 copper with 1 tin to make 2 bronze + * + * @param result The output of the combination of mixers. The quantity is used for amount of a successful mix + * @param mixers the liquids to be mixed. Quantities are used as ratios + */ + public static void addAlloyMixing(LiquidStack result, LiquidStack... mixers) + { + ArrayList inputs = new ArrayList(); + for (LiquidStack liquid : mixers) + inputs.add(liquid); + + instance.alloys.add(new AlloyMix(result, inputs)); + } + + /** + * Used to get the resulting temperature from a source ItemStack + * @param item The Source ItemStack + * @return The result temperature + */ + public static Integer getLiquifyTemperature(ItemStack item) + { + if (item == null) + return 20; + + Integer temp = instance.temperatureList.get(Arrays.asList(item.itemID, item.getItemDamage())); + if (temp == null) + return 20; + else + return temp; + } + + /** + * Used to get the resulting temperature from a source Block + * @param item The Source ItemStack + * @return The result ItemStack + */ + public static Integer getLiquifyTemperature(int blockID, int metadata) + { + return instance.temperatureList.get(Arrays.asList(blockID, metadata)); + } + + /** + * Used to get the resulting ItemStack from a source ItemStack + * @param item The Source ItemStack + * @return The result ItemStack + */ + public static LiquidStack getSmelteryResult(ItemStack item) + { + if (item == null) + return null; + + LiquidStack stack = (LiquidStack) instance.smeltingList.get(Arrays.asList(item.itemID, item.getItemDamage())); + if (stack == null) + return null; + return stack.copy(); + } + + /** + * Used to get the resulting ItemStack from a source Block + * @param item The Source ItemStack + * @return The result ItemStack + */ + public static LiquidStack getSmelteryResult(int blockID, int metadata) + { + LiquidStack stack = (LiquidStack) instance.smeltingList.get(Arrays.asList(blockID, metadata)); + if (stack == null) + return null; + return stack.copy(); + } + + public static ItemStack getRenderIndex(ItemStack input) + { + return instance.renderIndex.get(Arrays.asList(input.itemID, input.getItemDamage())); + } + + public static ArrayList mixMetals(ArrayList moltenMetal) + { + ArrayList liquids = new ArrayList(); + for (AlloyMix alloy : instance.alloys) + { + LiquidStack liquid = alloy.mix(moltenMetal); + if (liquid != null) + liquids.add(liquid); + } + return liquids; + } + + public static HashMap, LiquidStack> getSmeltingList() + { + return instance.smeltingList; + } + + public static HashMap, Integer> getTemperatureList() + { + return instance.temperatureList; + } + + public static HashMap, ItemStack> getRenderIndex() + { + return instance.renderIndex; + } + + public static ArrayList getAlloyList() + { + return instance.alloys; + } +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/crafting/ToolBuilder.java b/src/minecraft/mods/tinker/tconstruct/library/crafting/ToolBuilder.java new file mode 100755 index 000000000..1878daf06 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/crafting/ToolBuilder.java @@ -0,0 +1,397 @@ +package mods.tinker.tconstruct.library.crafting; + +/** Once upon a time, too many tools to count. Let's put them together automatically */ +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +import mods.tinker.tconstruct.library.TConstructRegistry; +import mods.tinker.tconstruct.library.event.ToolCraftEvent; +import mods.tinker.tconstruct.library.tools.ToolCore; +import mods.tinker.tconstruct.library.tools.ToolMaterial; +import mods.tinker.tconstruct.library.tools.ToolMod; +import mods.tinker.tconstruct.library.util.IToolPart; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.MinecraftForge; + +public class ToolBuilder +{ + public static ToolBuilder instance = new ToolBuilder(); + + public HashMap recipeList = new HashMap(); + public List combos = new ArrayList(); + public HashMap modifiers = new HashMap(); + public List toolMods = new ArrayList(); + + /* Build tools */ + public static void addNormalToolRecipe (ToolCore output, Item head, Item handle) + { + ToolRecipe recipe = instance.recipeList.get(output.getToolName()); + if (recipe != null) + { + recipe.addHeadItem(head); + recipe.addHandleItem(handle); + } + else + { + recipe = new ToolRecipe(head, handle, output); + instance.combos.add(recipe); + instance.recipeList.put(output.getToolName(), recipe); + } + } + + public static void addNormalToolRecipe (ToolCore output, Item head, Item handle, Item accessory) + { + //instance.combos.add(new ToolRecipe(head, accessory, output)); + ToolRecipe recipe = instance.recipeList.get(output.getToolName()); + if (recipe != null) + { + recipe.addHeadItem(head); + recipe.addHandleItem(handle); + recipe.addAccessoryItem(accessory); + } + else + { + recipe = new ToolRecipe(head, handle, accessory, output); + instance.combos.add(recipe); + instance.recipeList.put(output.getToolName(), recipe); + } + } + + public static void addNormalToolRecipe (ToolCore output, Item head, Item handle, Item accessory, Item extra) + { + ToolRecipe recipe = instance.recipeList.get(output.getToolName()); + if (recipe != null) + { + recipe.addHeadItem(head); + recipe.addHandleItem(handle); + recipe.addAccessoryItem(accessory); + recipe.addExtraItem(accessory); + } + else + { + recipe = new ToolRecipe(head, handle, accessory, extra, output); + instance.combos.add(recipe); + instance.recipeList.put(output.getToolName(), recipe); + } + } + + public static void addCustomToolRecipe(ToolRecipe recipe) + { + instance.combos.add(recipe); + } + + public static void addToolRecipe (ToolCore output, Item... items) + { + if (items.length == 2) + addNormalToolRecipe(output, items[0], items[1]); + if (items.length == 3) + addNormalToolRecipe(output, items[0], items[1], items[2]); + if (items.length == 4) + addNormalToolRecipe(output, items[0], items[1], items[2], items[3]); + } + + public ToolCore getMatchingRecipe (Item head, Item handle, Item accessory, Item extra) + { + for (ToolRecipe recipe : combos) + { + if (recipe.validHead(head) && recipe.validHandle(handle) && recipe.validAccessory(accessory) && recipe.validExtra(extra)) + return recipe.getType(); + } + return null; + } + + //Builds a tool from the parts given + public ItemStack buildTool (ItemStack headStack, ItemStack handleStack, ItemStack accessoryStack, String name) + { + return buildTool(headStack, handleStack, accessoryStack, null, name); + } + + public ItemStack buildTool (ItemStack headStack, ItemStack handleStack, ItemStack accessoryStack, ItemStack extraStack, String name) + { + if (headStack != null && headStack.getItem() instanceof ToolCore) + return modifyTool(headStack, handleStack, accessoryStack); + + if (headStack == null || handleStack == null) //Nothing to build without these. All tools need at least two parts! + return null; + + ToolCore item; + boolean validMaterials = true; + int head = -1, handle = -1, accessory = -1, extra = -1; + if (headStack.getItem() instanceof IToolPart) + { + head = ((IToolPart) headStack.getItem()).getMaterialID(headStack); + } + else + validMaterials = false; + + Item handleItem = handleStack.getItem(); + + if (handleItem == Item.stick) + handle = 0; + else if (handleItem == Item.bone) + handle = 5; + else if (handleItem instanceof IToolPart) + handle = ((IToolPart) handleItem).getMaterialID(handleStack); + else + validMaterials = false; + + if (!validMaterials) + return null; + + if (accessoryStack == null) + { + item = getMatchingRecipe(headStack.getItem(), handleStack.getItem(), null, null); + } + else + { + if (accessoryStack.getItem() instanceof IToolPart) + accessory = ((IToolPart) accessoryStack.getItem()).getMaterialID(accessoryStack); + else + return null; + + if (extraStack != null) + { + if (extraStack.getItem() instanceof IToolPart) + extra = ((IToolPart) extraStack.getItem()).getMaterialID(extraStack); + else + return null; + + item = getMatchingRecipe(headStack.getItem(), handleStack.getItem(), accessoryStack.getItem(), extraStack.getItem()); + } + else + { + item = getMatchingRecipe(headStack.getItem(), handleStack.getItem(), accessoryStack.getItem(), null); + } + } + + //System.out.println("Valid: "+item); + + if (item == null) + return null; + + ToolMaterial headMat = null, handleMat = null, accessoryMat = null, extraMat = null; + headMat = TConstructRegistry.getMaterial(head); + handleMat = TConstructRegistry.getMaterial(handle); + + if (accessory != -1) + accessoryMat = TConstructRegistry.getMaterial(accessory); + + if (extra != -1) + extraMat = TConstructRegistry.getMaterial(extra); + + int durability = headMat.durability(); + int heads = 1; + int handles = 0; + float modifier = 1f; + int attack = headMat.attack(); + + if (item.durabilityTypeHandle() == 2) + { + heads++; + durability += handleMat.durability(); + attack += handleMat.attack(); + } + else if (item.durabilityTypeHandle() == 1) + { + handles++; + modifier = handleMat.handleDurability(); + } + + if (accessory != -1) + { + if (item.durabilityTypeAccessory() == 2) + { + heads++; + durability += accessoryMat.durability(); + attack += accessoryMat.attack(); + } + else if (item.durabilityTypeAccessory() == 1) + { + handles++; + modifier += accessoryMat.handleDurability(); + } + } + + if (extra != -1) + { + if (item.durabilityTypeExtra() == 2) + { + heads++; + durability += extraMat.durability(); + attack += extraMat.attack(); + } + else if (item.durabilityTypeExtra() == 1) + { + handles++; + modifier += extraMat.handleDurability(); + } + } + + if (handles > 0) + { + modifier *= (0.5+handles*0.5); + modifier /= handles; + } + + durability = (int) (durability / heads * (0.5 + heads * 0.5) * modifier * item.getDurabilityModifier()); + attack = attack / heads + item.getDamageVsEntity(null); + if (attack % heads != 0) + attack++; + + ItemStack tool = new ItemStack(item); + NBTTagCompound compound = new NBTTagCompound(); + + compound.setCompoundTag("InfiTool", new NBTTagCompound()); + compound.getCompoundTag("InfiTool").setInteger("Head", head); + compound.getCompoundTag("InfiTool").setInteger("RenderHead", head); + + compound.getCompoundTag("InfiTool").setInteger("Handle", handle); + compound.getCompoundTag("InfiTool").setInteger("RenderHandle", handle); + + if (accessory != -1) + { + compound.getCompoundTag("InfiTool").setInteger("Accessory", accessory); + compound.getCompoundTag("InfiTool").setInteger("RenderAccessory", accessory); + } + if (extra != -1) + { + compound.getCompoundTag("InfiTool").setInteger("Extra", extra); + compound.getCompoundTag("InfiTool").setInteger("RenderExtra", extra); + } + + compound.getCompoundTag("InfiTool").setInteger("Damage", 0); //Damage is damage to the tool + compound.getCompoundTag("InfiTool").setInteger("TotalDurability", durability); + compound.getCompoundTag("InfiTool").setInteger("BaseDurability", durability); + compound.getCompoundTag("InfiTool").setInteger("BonusDurability", 0); //Modifier + compound.getCompoundTag("InfiTool").setFloat("ModDurability", 0f); //Modifier + compound.getCompoundTag("InfiTool").setBoolean("Broken", false); + compound.getCompoundTag("InfiTool").setInteger("Attack", attack); + + compound.getCompoundTag("InfiTool").setInteger("MiningSpeed", headMat.toolSpeed()); + compound.getCompoundTag("InfiTool").setInteger("HarvestLevel", headMat.harvestLevel()); + if (item.durabilityTypeHandle() == 2) + { + compound.getCompoundTag("InfiTool").setInteger("MiningSpeedHandle", handleMat.toolSpeed()); + compound.getCompoundTag("InfiTool").setInteger("HarvestLevelHandle", handleMat.harvestLevel()); + } + if (accessory != -1 && item.durabilityTypeAccessory() == 2) + { + compound.getCompoundTag("InfiTool").setInteger("MiningSpeed2", accessoryMat.toolSpeed()); + compound.getCompoundTag("InfiTool").setInteger("HarvestLevel2", accessoryMat.harvestLevel()); + } + + if (extra != -1 && item.durabilityTypeExtra() == 2) + { + compound.getCompoundTag("InfiTool").setInteger("MiningSpeedExtra", extraMat.toolSpeed()); + compound.getCompoundTag("InfiTool").setInteger("HarvestLevelExtra", extraMat.harvestLevel()); + } + + compound.getCompoundTag("InfiTool").setInteger("Unbreaking", buildReinforced(headMat, handleMat, accessoryMat, extraMat)); + compound.getCompoundTag("InfiTool").setFloat("Shoddy", buildShoddy(headMat, handleMat, accessoryMat, extraMat)); + + int modifiers = item.getModifierAmount(); + if (accessory == -1) + modifiers += (head == 9 ? 2 : 0); + else + modifiers += (head == 9 ? 1 : 0) + (accessory == 9 ? 1 : 0); + modifiers += +(handle == 9 ? 1 : 0); + modifiers += +(extra == 9 ? 1 : 0); + + compound.getCompoundTag("InfiTool").setInteger("Modifiers", modifiers); + + if (name != null && !name.equals("")) + { + compound.setCompoundTag("display", new NBTTagCompound()); + compound.getCompoundTag("display").setString("Name", "\u00A7f" + name); + } + + ToolCraftEvent event = new ToolCraftEvent(item, compound, new ToolMaterial[] {headMat, handleMat, accessoryMat, extraMat}); + MinecraftForge.EVENT_BUS.post(event); + + tool.setTagCompound(compound); + + return tool; + } + + public ItemStack modifyTool (ItemStack input, ItemStack topSlot, ItemStack bottomSlot) + { + //if (topSlot == null && bottomSlot == null) + //return input; + + ItemStack tool = input.copy(); + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + tags.removeTag("Built"); + + if (topSlot == null && bottomSlot == null) + return tool; + + boolean built = false; + for (ToolMod mod : toolMods) + { + ItemStack[] slots = new ItemStack[] { topSlot, bottomSlot }; + if (mod.matches(slots, tool)) + { + built = true; + mod.addMatchingEffect(tool); + mod.modify(slots, tool); + } + } + + if (built) + return tool; + else + return null; + } + + int buildReinforced (ToolMaterial headMat, ToolMaterial handleMat, ToolMaterial accessoryMat, ToolMaterial extraMat) + { + int reinforced = 0; + + int dHead = headMat.reinforced(); + int dHandle = handleMat.reinforced(); + int dAccessory = 0; + if (accessoryMat != null) + dAccessory = accessoryMat.reinforced(); + int dExtra = 0; + if (extraMat != null) + dExtra = extraMat.reinforced(); + + if (dHead > reinforced) + reinforced = dHead; + if (dHandle > reinforced) + reinforced = dHandle; + if (dAccessory > reinforced) + reinforced = dAccessory; + if (dExtra > reinforced) + reinforced = dExtra; + + return reinforced; + } + + float buildShoddy (ToolMaterial headMat, ToolMaterial handleMat, ToolMaterial accessoryMat, ToolMaterial extraMat) + { + float sHead = headMat.shoddy(); + float sHandle = handleMat.shoddy(); + if (extraMat != null) + { + float sAccessory = accessoryMat.shoddy(); + float sExtra = extraMat.shoddy(); + return (sHead + sHandle + sAccessory + sExtra) / 4f; + } + + if (accessoryMat != null) + { + float sAccessory = accessoryMat.shoddy(); + return (sHead + sHandle + sAccessory) / 3f; + } + return (sHead + sHandle) / 2f; + } + + public static void registerToolMod (ToolMod mod) + { + instance.toolMods.add(mod); + } +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/crafting/ToolRecipe.java b/src/minecraft/mods/tinker/tconstruct/library/crafting/ToolRecipe.java new file mode 100755 index 000000000..649a05660 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/crafting/ToolRecipe.java @@ -0,0 +1,130 @@ +package mods.tinker.tconstruct.library.crafting; + +import java.util.LinkedList; + +import mods.tinker.tconstruct.library.TConstructRegistry; +import mods.tinker.tconstruct.library.tools.ToolCore; +import net.minecraft.item.Item; + +/* + * Small class for checking if a particular tool combination is this one + */ + +public class ToolRecipe +{ + LinkedList headList = new LinkedList(); + LinkedList handleList = new LinkedList(); + LinkedList accessoryList = new LinkedList(); + LinkedList extraList = new LinkedList(); + ToolCore result; + Item toolRod = TConstructRegistry.getItem("toolRod"); + + /*public ToolRecipe(Item head, ToolCore tool) + { + this(head, TContent.toolRod, null, null, tool); + }*/ + + public ToolRecipe(Item head, Item handle, ToolCore tool) + { + this(head, handle, null, null, tool); + } + + public ToolRecipe(Item head, Item handle, Item accessory, ToolCore tool) + { + this(head, handle, accessory, null, tool); + } + + public ToolRecipe(Item head, Item handle, Item accessory, Item extra, ToolCore tool) + { + this.headList.add(head); + this.handleList.add(handle); + if (accessory != null) + this.accessoryList.add(accessory); + if (extra != null) + this.extraList.add(extra); + result = tool; + } + + public void addHeadItem(Item head) + { + this.headList.add(head); + } + + public void addHandleItem(Item head) + { + this.handleList.add(head); + } + + public void addAccessoryItem(Item head) + { + this.accessoryList.add(head); + } + + public void addExtraItem(Item head) + { + this.extraList.add(head); + } + + public boolean validHead (Item input) + { + for (Item part : headList) + { + if (part == input) + return true; + } + return false; + } + + public boolean validHandle (Item input) + { + for (Item part : handleList) + { + if (part == input) + return true; + if (toolRod != null && part == toolRod && (input == Item.stick || input == Item.bone)) + return true; + } + return false; + } + + public boolean validAccessory (Item input) + { + if (input == null) + { + if (accessoryList.size() < 1) + return true; + return false; + } + for (Item part : accessoryList) + { + if (part == input) + return true; + if (toolRod != null && part == toolRod && (input == Item.stick || input == Item.bone)) + return true; + } + return false; + } + + public boolean validExtra (Item input) + { + if (input == null) + { + if (extraList.size() < 1) + return true; + return false; + } + for (Item part : extraList) + { + if (part == input) + return true; + if (toolRod != null && part == toolRod && (input == Item.stick || input == Item.bone)) + return true; + } + return false; + } + + public ToolCore getType () + { + return result; + } +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/event/ToolCraftEvent.java b/src/minecraft/mods/tinker/tconstruct/library/event/ToolCraftEvent.java new file mode 100755 index 000000000..fd3e01a6c --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/event/ToolCraftEvent.java @@ -0,0 +1,24 @@ +package mods.tinker.tconstruct.library.event; + +import mods.tinker.tconstruct.library.tools.ToolCore; +import mods.tinker.tconstruct.library.tools.ToolMaterial; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.event.Event; + +/* This event fires after all of the other construction. The resulting nbttag is added to the tool + * Note: The tag is the base tag. toolTag.getCompoundTag("InfiTool") will have all of the tool's data. + */ + +public class ToolCraftEvent extends Event +{ + public final ToolCore tool; + public final NBTTagCompound toolTag; + public final ToolMaterial[] materials; + + public ToolCraftEvent(ToolCore tool, NBTTagCompound toolTag, ToolMaterial[] materials) + { + this.tool = tool; + this.toolTag = toolTag; + this.materials = materials; + } +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/tools/AbilityHelper.java b/src/minecraft/mods/tinker/tconstruct/library/tools/AbilityHelper.java new file mode 100755 index 000000000..13512e1b6 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/tools/AbilityHelper.java @@ -0,0 +1,522 @@ +package mods.tinker.tconstruct.library.tools; + +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import mods.tinker.tconstruct.library.ActiveToolMod; +import mods.tinker.tconstruct.library.TConstructRegistry; +import mods.tinker.tconstruct.library.util.PiercingEntityDamage; +import net.minecraft.block.Block; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.enchantment.EnchantmentThorns; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.monster.EntityCreeper; +import net.minecraft.entity.monster.EntityGhast; +import net.minecraft.entity.passive.EntityWolf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +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.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.common.FakePlayer; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.Event.Result; +import net.minecraftforge.event.entity.player.UseHoeEvent; + +public class AbilityHelper +{ + static Random random = new Random(); + + /* Normal interactions */ + public static boolean onBlockChanged (ItemStack stack, World world, int bID, int x, int y, int z, EntityLiving player, Random random) + { + if (!stack.hasTagCompound()) + return false; + + int reinforced = 0; + NBTTagCompound tags = stack.getTagCompound(); + + if (tags.getCompoundTag("InfiTool").hasKey("Unbreaking")) + reinforced = tags.getCompoundTag("InfiTool").getInteger("Unbreaking"); + + if (random.nextInt(10) < 10 - reinforced) + { + damageTool(stack, 1, tags, player, false); + } + + return true; + } + + public static boolean onLeftClickEntity (ItemStack stack, EntityPlayer player, Entity entity, ToolCore tool) + { + if (entity.canAttackWithItem() && stack.hasTagCompound()) + { + if (!entity.func_85031_j(player)) // can't attack this entity + { + NBTTagCompound tags = stack.getTagCompound(); + NBTTagCompound toolTags = stack.getTagCompound().getCompoundTag("InfiTool"); + int damage = toolTags.getInteger("Attack"); + boolean broken = toolTags.getBoolean("Broken"); + + int durability = tags.getCompoundTag("InfiTool").getInteger("Damage"); + float stonebound = tags.getCompoundTag("InfiTool").getFloat("Shoddy"); + + float stoneboundDamage = (float) Math.log(durability / 72f + 1) * -2 * stonebound; + + int earlyModDamage = 0; + for (ActiveToolMod mod : TConstructRegistry.activeModifiers) + { + earlyModDamage = mod.baseAttackDamage(earlyModDamage, damage, tool, tags, toolTags, stack, player, entity); + } + damage += earlyModDamage; + + if (player.isPotionActive(Potion.damageBoost)) + { + damage += 3 << player.getActivePotionEffect(Potion.damageBoost).getAmplifier(); + } + + if (player.isPotionActive(Potion.weakness)) + { + damage -= 2 << player.getActivePotionEffect(Potion.weakness).getAmplifier(); + } + + float knockback = 0; + int enchantDamage = 0; + + if (entity instanceof EntityLiving) + { + enchantDamage = EnchantmentHelper.getEnchantmentModifierLiving(player, (EntityLiving) entity); + knockback += EnchantmentHelper.getKnockbackModifier(player, (EntityLiving) entity); + } + + damage += stoneboundDamage; + if (damage < 1) + damage = 1; + + if (player.isSprinting()) + { + knockback++; + float lunge = tool.chargeAttack(); + if (lunge > 1f) + { + knockback += lunge - 1.0f; + damage *= lunge; + } + } + + float modKnockback = 0f; + for (ActiveToolMod mod : TConstructRegistry.activeModifiers) + { + modKnockback = mod.knockback(modKnockback, knockback, tool, tags, toolTags, stack, player, entity); + } + knockback += modKnockback; + + int modDamage = 0; + for (ActiveToolMod mod : TConstructRegistry.activeModifiers) + { + modDamage = mod.attackDamage(modDamage, damage, tool, tags, toolTags, stack, player, entity); + } + damage += modDamage; + + if (damage > 0 || enchantDamage > 0) + { + boolean criticalHit = player.fallDistance > 0.0F && !player.onGround && !player.isOnLadder() && !player.isInWater() && !player.isPotionActive(Potion.blindness) + && player.ridingEntity == null && entity instanceof EntityLiving; + + if (criticalHit) + { + damage += random.nextInt(damage / 2 + 2); + } + + damage += enchantDamage; + + if (tool.getDamageModifier() != 1f) + { + damage *= tool.getDamageModifier(); + } + boolean var6 = false; + int fireAspect = EnchantmentHelper.getFireAspectModifier(player); + + if (entity instanceof EntityLiving && fireAspect > 0 && !entity.isBurning()) + { + var6 = true; + entity.setFire(1); + } + + if (broken) + damage = 1; + boolean causedDamage = false; + if (tool.pierceArmor() && !broken) + causedDamage = entity.attackEntityFrom(causePlayerPiercingDamage(player), damage); + else + causedDamage = entity.attackEntityFrom(DamageSource.causePlayerDamage(player), damage); + + if (causedDamage) + { + damageTool(stack, 1, player, false); + tool.onEntityDamaged(player.worldObj, player, entity); + int drain = toolTags.getInteger("Necrotic") * 2; + if (drain > 0) + player.heal(random.nextInt(drain+1)); + + if (knockback > 0) + { + entity.addVelocity((double) (-MathHelper.sin(player.rotationYaw * (float) Math.PI / 180.0F) * (float) knockback * 0.5F), 0.1D, + (double) (MathHelper.cos(player.rotationYaw * (float) Math.PI / 180.0F) * (float) knockback * 0.5F)); + player.motionX *= 0.6D; + player.motionZ *= 0.6D; + player.setSprinting(false); + } + + if (criticalHit) + { + player.onCriticalHit(entity); + } + + if (enchantDamage > 0) + { + player.onEnchantmentCritical(entity); + } + + if (damage >= 18) + { + player.triggerAchievement(AchievementList.overkill); + } + + player.setLastAttackingEntity(entity); + + if (entity instanceof EntityLiving) + { + EnchantmentThorns.func_92096_a(player, (EntityLiving) entity, random); + } + } + + if (entity instanceof EntityLiving) + { + stack.hitEntity((EntityLiving) entity, player); + if (entity.isEntityAlive()) + { + alertPlayerWolves(player, (EntityLiving) entity, true); + } + + player.addStat(StatList.damageDealtStat, damage); + + if ((fireAspect > 0 || toolTags.hasKey("Fiery") || toolTags.hasKey("Lava")) && causedDamage) + { + fireAspect *= 4; + if (toolTags.hasKey("Fiery")) + { + fireAspect += toolTags.getInteger("Fiery") / 5 + 1; + } + if (toolTags.getBoolean("Lava")) + { + fireAspect += 3; + } + entity.setFire(fireAspect); + } + else if (var6) + { + entity.extinguish(); + } + } + + player.addExhaustion(0.3F); + if (causedDamage) + return true; + } + } + } + return false; + } + + static void alertPlayerWolves (EntityPlayer player, EntityLiving living, boolean par2) + { + if (!(living instanceof EntityCreeper) && !(living instanceof EntityGhast)) + { + if (living instanceof EntityWolf) + { + EntityWolf var3 = (EntityWolf) living; + + if (var3.isTamed() && player.username.equals(var3.getOwnerName())) + { + return; + } + } + + if (!(living instanceof EntityPlayer) || player.func_96122_a((EntityPlayer) living)) + { + List var6 = player.worldObj.getEntitiesWithinAABB(EntityWolf.class, + AxisAlignedBB.getAABBPool().getAABB(player.posX, player.posY, player.posZ, player.posX + 1.0D, player.posY + 1.0D, player.posZ + 1.0D).expand(16.0D, 4.0D, 16.0D)); + Iterator var4 = var6.iterator(); + + while (var4.hasNext()) + { + EntityWolf var5 = (EntityWolf) var4.next(); + + if (var5.isTamed() && var5.getEntityToAttack() == null && player.username.equals(var5.getOwnerName()) && (!par2 || !var5.isSitting())) + { + var5.setSitting(false); + var5.setTarget(living); + } + } + } + } + } + + /* Tool specific */ + public static void damageTool (ItemStack stack, int dam, EntityLiving entity, boolean ignoreCharge) + { + NBTTagCompound tags = stack.getTagCompound(); + damageTool(stack, dam, tags, entity, ignoreCharge); + } + + public static void healTool (ItemStack stack, int dam, EntityLiving entity, boolean ignoreCharge) + { + NBTTagCompound tags = stack.getTagCompound(); + damageTool(stack, -dam, tags, entity, ignoreCharge); + } + + public static void damageTool (ItemStack stack, int dam, NBTTagCompound tags, EntityLiving entity, boolean ignoreCharge) + { + if (entity instanceof EntityPlayer && ((EntityPlayer) entity).capabilities.isCreativeMode || tags == null) + return; + + if (ignoreCharge) + { + boolean damagedTool = false; + for (ActiveToolMod mod : TConstructRegistry.activeModifiers) + { + if (mod.damageTool(stack, dam, entity)) + damagedTool = true; + } + + if (damagedTool) + return; + + int damage = tags.getCompoundTag("InfiTool").getInteger("Damage"); + int damageTrue = damage + dam; + int maxDamage = tags.getCompoundTag("InfiTool").getInteger("TotalDurability"); + if (damageTrue <= 0) + { + tags.getCompoundTag("InfiTool").setInteger("Damage", 0); + stack.setItemDamage(0); + } + + else if (damageTrue > maxDamage) + { + breakTool(stack, tags, entity); + stack.setItemDamage(0); + } + + else + { + tags.getCompoundTag("InfiTool").setInteger("Damage", damage + dam); + int toolDamage = (damage * 100 / maxDamage) + 1; + int stackDamage = stack.getItemDamage(); + if (toolDamage != stackDamage) + { + stack.setItemDamage((damage * 100 / maxDamage) + 1); + } + } + } + } + + public static void breakTool (ItemStack stack, NBTTagCompound tags, Entity entity) + { + tags.getCompoundTag("InfiTool").setBoolean("Broken", true); + if (entity != null) + entity.worldObj.playSound(entity.posX, entity.posY, entity.posZ, "random.break", 1f, 1f, true); + } + + public static void repairTool (ItemStack stack, NBTTagCompound tags) + { + tags.getCompoundTag("InfiTool").setBoolean("Broken", false); + tags.getCompoundTag("InfiTool").setInteger("Damage", 0); + } + + public static DamageSource causePiercingDamage (EntityLiving mob) + { + return new PiercingEntityDamage("mob", mob); + } + + public static DamageSource causePlayerPiercingDamage (EntityPlayer player) + { + return new PiercingEntityDamage("player", player); + } + + public static void knockbackEntity (EntityLiving living, double boost) + { + living.motionX *= boost; + //living.motionY *= boost/2; + living.motionZ *= boost; + } + + public static boolean hoeGround (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, Random random) + { + if (!player.canPlayerEdit(x, y, z, side, stack)) + { + return false; + } + else + { + UseHoeEvent event = new UseHoeEvent(player, stack, world, x, y, z); + if (MinecraftForge.EVENT_BUS.post(event)) + { + return false; + } + + if (event.getResult() == Result.ALLOW) + { + onBlockChanged(stack, world, 0, x, y, z, player, random); + return true; + } + + int bID = world.getBlockId(x, y, z); + int bIDabove = world.getBlockId(x, y + 1, z); + + if ((side == 0 || bIDabove != 0 || bID != Block.grass.blockID) && bID != Block.dirt.blockID) + { + return false; + } + else + { + Block block = Block.tilledField; + world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), block.stepSound.getStepSound(), + (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F); + + if (world.isRemote) + { + return true; + } + else + { + world.setBlock(x, y, z, block.blockID); + onBlockChanged(stack, world, 0, x, y, z, player, random); + return true; + } + } + } + } + + public static void spawnItemAtPlayer (EntityPlayer player, ItemStack stack) + { + EntityItem entityitem = new EntityItem(player.worldObj, player.posX + 0.5D, player.posY + 0.5D, player.posZ + 0.5D, stack); + player.worldObj.spawnEntityInWorld(entityitem); + if (!(player instanceof FakePlayer)) + entityitem.onCollideWithPlayer(player); + /*if (!player.inventory.addItemStackToInventory(stack)) + { + if (!player.worldObj.isRemote) + { + EntityItem entityitem = new EntityItem(player.worldObj, player.posX + 0.5D, player.posY + 0.5D, player.posZ + 0.5D, stack); + player.worldObj.spawnEntityInWorld(entityitem); + entityitem.onCollideWithPlayer(player); + } + } + else + { + player.worldObj.playSoundAtEntity(player, "random.pop", 0.2F, ((random.nextFloat() - random.nextFloat()) * 0.7F + 1.0F) * 2.0F); + }*/ + } + + /* Ranged weapons */ + + public static void forceAddToInv (EntityPlayer entityplayer, ItemStack itemstack, int i, boolean flag) + { + ItemStack itemstack1 = entityplayer.inventory.getStackInSlot(i); + entityplayer.inventory.setInventorySlotContents(i, itemstack); + if (itemstack1 != null) + { + addToInv(entityplayer, itemstack1, flag); + } + } + + public static boolean addToInv (EntityPlayer entityplayer, ItemStack itemstack, boolean flag) + { + return addToInv(entityplayer, itemstack, entityplayer.inventory.currentItem, flag); + } + + public static boolean addToInv (EntityPlayer entityplayer, ItemStack itemstack, int i, boolean flag) + { + ItemStack itemstack1 = entityplayer.inventory.getStackInSlot(i); + boolean flag1; + if (itemstack1 == null) + { + entityplayer.inventory.setInventorySlotContents(i, itemstack); + flag1 = true; + } + else + { + flag1 = entityplayer.inventory.addItemStackToInventory(itemstack); + } + if (flag && !flag1) + { + addItemStackToWorld(entityplayer.worldObj, (float) Math.floor(entityplayer.posX), (float) Math.floor(entityplayer.posY), (float) Math.floor(entityplayer.posZ), itemstack); + return true; + } + else + { + return flag1; + } + } + + public static EntityItem addItemStackToWorld (World world, float f, float f1, float f2, ItemStack itemstack) + { + return addItemStackToWorld(world, f, f1, f2, itemstack, false); + } + + public static EntityItem addItemStackToWorld (World world, float f, float f1, float f2, ItemStack itemstack, boolean flag) + { + EntityItem entityitem; + if (flag) + { + entityitem = new EntityItem(world, f, f1, f2, itemstack); + } + else + { + float f3 = 0.7F; + float f4 = random.nextFloat() * f3 + (1.0F - f3) * 0.5F; + float f5 = 1.2F; + float f6 = random.nextFloat() * f3 + (1.0F - f3) * 0.5F; + entityitem = new EntityItem(world, f + f4, f1 + f5, f2 + f6, itemstack); + } + entityitem.delayBeforeCanPickup = 10; + world.spawnEntityInWorld(entityitem); + return entityitem; + } + + public static MovingObjectPosition raytraceFromEntity (World world, Entity player, boolean par3, double range) + { + float f = 1.0F; + float f1 = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * f; + float f2 = player.prevRotationYaw + (player.rotationYaw - player.prevRotationYaw) * f; + double d0 = player.prevPosX + (player.posX - player.prevPosX) * (double) f; + double d1 = player.prevPosY + (player.posY - player.prevPosY) * (double) f + 1.62D - (double) player.yOffset; + double d2 = player.prevPosZ + (player.posZ - player.prevPosZ) * (double) f; + Vec3 vec3 = world.getWorldVec3Pool().getVecFromPool(d0, d1, d2); + float f3 = MathHelper.cos(-f2 * 0.017453292F - (float) Math.PI); + float f4 = MathHelper.sin(-f2 * 0.017453292F - (float) Math.PI); + float f5 = -MathHelper.cos(-f1 * 0.017453292F); + float f6 = MathHelper.sin(-f1 * 0.017453292F); + float f7 = f4 * f5; + float f8 = f3 * f5; + double d3 = range; + if (player instanceof EntityPlayerMP) + { + d3 = ((EntityPlayerMP) player).theItemInWorldManager.getBlockReachDistance(); + } + Vec3 vec31 = vec3.addVector((double) f7 * d3, (double) f6 * d3, (double) f8 * d3); + return world.rayTraceBlocks_do_do(vec3, vec31, par3, !par3); + } +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/tools/DualHarvestTool.java b/src/minecraft/mods/tinker/tconstruct/library/tools/DualHarvestTool.java new file mode 100755 index 000000000..ae708fbae --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/tools/DualHarvestTool.java @@ -0,0 +1,138 @@ +package mods.tinker.tconstruct.library.tools; + +import mods.tinker.tconstruct.library.ActiveToolMod; +import mods.tinker.tconstruct.library.TConstructRegistry; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; + +/* Base class for harvest tools with each head having a different purpose */ + +public abstract class DualHarvestTool extends HarvestTool +{ + public DualHarvestTool(int itemID, int baseDamage) + { + super(itemID, baseDamage); + } + + @Override + public int getHeadType () + { + return 3; + } + + @Override + public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player) + { + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + World world = player.worldObj; + int bID = player.worldObj.getBlockId(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + Block block = Block.blocksList[bID]; + if (block == null || bID < 1) + return false; + int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); + int shlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getSecondHarvestType()); + + if (hlvl <= tags.getInteger("HarvestLevel") && shlvl <= tags.getInteger("HarvestLevel2")) + { + boolean cancelHarvest = false; + for (ActiveToolMod mod : TConstructRegistry.activeModifiers) + { + if (mod.beforeBlockBreak(this, stack, x, y, z, player)) + cancelHarvest = true; + } + + return cancelHarvest; + } + else + { + if (!player.capabilities.isCreativeMode) + onBlockDestroyed(stack, world, bID, x, y, z, player); + world.setBlockToAir(x, y, z); + if (!world.isRemote) + world.playAuxSFX(2001, x, y, z, bID + (meta << 12)); + return true; + } + } + + @Override + public float getStrVsBlock (ItemStack stack, Block block, int meta) + { + + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + if (tags.getBoolean("Broken")) + return 0.1f; + + Material[] materials = getEffectiveMaterials(); + for (int i = 0; i < materials.length; i++) + { + if (materials[i] == block.blockMaterial) + { + float speed = tags.getInteger("MiningSpeed"); + speed /= 100f; + int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); + int durability = tags.getInteger("Damage"); + + float shoddy = tags.getFloat("Shoddy"); + speed += shoddy * durability / 100f; + + if (hlvl <= tags.getInteger("HarvestLevel")) + return speed; + return 0.1f; + } + } + materials = getEffectiveSecondaryMaterials(); + for (int i = 0; i < materials.length; i++) + { + if (materials[i] == block.blockMaterial) + { + float speed = tags.getInteger("MiningSpeed2"); + speed /= 100f; + int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); + int durability = tags.getInteger("Damage"); + + float shoddy = tags.getFloat("Shoddy"); + speed += shoddy * durability / 100f; + + if (hlvl <= tags.getInteger("HarvestLevel2")) + return speed; + return 0.1f; + } + } + return super.getStrVsBlock(stack, block, meta); + } + + public boolean canHarvestBlock (Block block) + { + if (block.blockMaterial.isToolNotRequired()) + { + return true; + } + for (Material m : getEffectiveMaterials()) + { + if (m == block.blockMaterial) + return true; + } + for (Material m : getEffectiveSecondaryMaterials()) + { + if (m == block.blockMaterial) + return true; + } + return false; + } + + @Override + public String[] toolCategories () + { + return new String[] { "harvest", "dualharvest" }; + } + + protected abstract Material[] getEffectiveSecondaryMaterials (); + + protected abstract String getSecondHarvestType (); +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/tools/HarvestTool.java b/src/minecraft/mods/tinker/tconstruct/library/tools/HarvestTool.java new file mode 100755 index 000000000..9379d6e82 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/tools/HarvestTool.java @@ -0,0 +1,128 @@ +package mods.tinker.tconstruct.library.tools; + +import mods.tinker.tconstruct.library.ActiveToolMod; +import mods.tinker.tconstruct.library.TConstructRegistry; +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; + +/* Base class for tools that should be harvesting blocks */ + +public abstract class HarvestTool extends ToolCore +{ + public HarvestTool(int itemID, int baseDamage) + { + super(itemID, baseDamage); + } + + @Override + public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player) + { + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + World world = player.worldObj; + int bID = player.worldObj.getBlockId(x, y, z); + int meta = world.getBlockMetadata(x, y, z); + Block block = Block.blocksList[bID]; + if (block == null || bID < 1) + return false; + int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); + + if (hlvl <= tags.getInteger("HarvestLevel")) + { + boolean cancelHarvest = false; + for (ActiveToolMod mod : TConstructRegistry.activeModifiers) + { + if (mod.beforeBlockBreak(this, stack, x, y, z, player)) + cancelHarvest = true; + } + return cancelHarvest; + } + else + { + world.setBlockToAir(x, y, z); + if (!player.capabilities.isCreativeMode) + onBlockDestroyed(stack, world, bID, x, y, z, player); + if (!world.isRemote) + world.playAuxSFX(2001, x, y, z, bID + (meta << 12)); + return true; + } + } + + @Override + public float getStrVsBlock (ItemStack stack, Block block, int meta) + { + if (!stack.hasTagCompound()) + return 1.0f; + + NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); + if (tags.getBoolean("Broken")) + return 0.1f; + + Material[] materials = getEffectiveMaterials(); + for (int i = 0; i < materials.length; i++) + { + if (materials[i] == block.blockMaterial) + { + float mineSpeed = tags.getInteger("MiningSpeed"); + int heads = 1; + if (tags.hasKey("MiningSpeed2")) + { + mineSpeed += tags.getInteger("MiningSpeed2"); + heads++; + } + + if (tags.hasKey("MiningSpeedHandle")) + { + mineSpeed += tags.getInteger("MiningSpeedHandle"); + heads++; + } + + if (tags.hasKey("MiningSpeedExtra")) + { + mineSpeed += tags.getInteger("MiningSpeedExtra"); + heads++; + } + float trueSpeed = mineSpeed / (heads * 100f); + int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); + int durability = tags.getInteger("Damage"); + + float stonebound = tags.getFloat("Shoddy"); + float bonusLog = (float) Math.log(durability / 72f + 1) * 2 * stonebound; + trueSpeed += bonusLog; + + if (hlvl <= tags.getInteger("HarvestLevel")) + return trueSpeed; + return 0.1f; + } + } + return super.getStrVsBlock(stack, block, meta); + } + + public boolean canHarvestBlock (Block block) + { + if (block.blockMaterial.isToolNotRequired()) + { + return true; + } + for (Material m : getEffectiveMaterials()) + { + if (m == block.blockMaterial) + return true; + } + return false; + } + + @Override + public String[] toolCategories () + { + return new String[] { "harvest" }; + } + + protected abstract Material[] getEffectiveMaterials (); + + protected abstract String getHarvestType (); +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/tools/ToolCore.java b/src/minecraft/mods/tinker/tconstruct/library/tools/ToolCore.java new file mode 100755 index 000000000..53c6c5df6 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/tools/ToolCore.java @@ -0,0 +1,758 @@ +package mods.tinker.tconstruct.library.tools; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Random; + +import mods.tinker.tconstruct.library.ActiveToolMod; +import mods.tinker.tconstruct.library.TConstructRegistry; +import mods.tinker.tconstruct.library.crafting.ToolBuilder; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +/** NBTTags + * Main tag - InfiTool + * @see ToolBuilder + * + * Required: + * Head: Base and render tag, above the handle + * Handle: Base and render tag, bottom layer + * + * Damage: Replacement for metadata + * MaxDamage: ItemStacks only read setMaxDamage() + * Broken: Represents whether the tool is broken (boolean) + * Attack: How much damage a mob will take + * MiningSpeed: The speed at which a tool mines + * + * Others: + * Accessory: Base and tag, above head. Sword guards, binding, etc + * Effects: Render tag, top layer. Fancy effects like moss or diamond edge. + * Render order: Handle > Head > Accessory > Effect1 > Effect2 > Effect3 > etc + * Unbreaking: Reinforced in-game, 10% chance to not use durability per level + * Stonebound: Mines faster as the tool takes damage, but has less attack + * Spiny: Opposite of stonebound + * + * Modifiers have their own tags. + * @see ToolMod + */ + +public abstract class ToolCore extends Item +{ + protected Random random = new Random(); + protected int damageVsEntity; + public static Icon blankSprite; + public static Icon emptyIcon; + + public ToolCore(int id, int baseDamage) + { + super(id); + this.maxStackSize = 1; + this.setMaxDamage(100); + this.setUnlocalizedName("InfiTool"); + this.setCreativeTab(TConstructRegistry.toolTab); + damageVsEntity = baseDamage; + TConstructRegistry.addToolMapping(this); + setNoRepair(); + canRepair = false; + } + + @Deprecated + public int getHeadType () + { + return 0; + } + + /** Determines crafting behavior with regards to durability + * 0: None + * 1: Adds handle modifier + * 2: Averages part with the rest of the tool + * @return type + */ + + public int durabilityTypeHandle () + { + return 1; + } + + public int durabilityTypeAccessory () + { + return 0; + } + + public int durabilityTypeExtra () + { + return 0; + } + + public int getModifierAmount () + { + return 3; + } + + public String getToolName () + { + return this.getClass().getSimpleName(); + } + + /* Rendering */ + + public HashMap headIcons = new HashMap(); + public HashMap brokenIcons = new HashMap(); + public HashMap handleIcons = new HashMap(); + public HashMap accessoryIcons = new HashMap(); + public HashMap effectIcons = new HashMap(); + public HashMap extraIcons = new HashMap(); + + //Not liking this + public HashMap headStrings = new HashMap(); + public HashMap brokenHeadStrings = new HashMap(); + public HashMap handleStrings = new HashMap(); + public HashMap accessoryStrings = new HashMap(); + public HashMap effectStrings = new HashMap(); + public HashMap extraStrings = new HashMap(); + + @SideOnly(Side.CLIENT) + @Override + public boolean requiresMultipleRenderPasses () + { + return true; + } + + @SideOnly(Side.CLIENT) + @Override + public int getRenderPasses (int metadata) + { + return 9; + } + + //Override me please! + public int getPartAmount () + { + return 3; + } + + public abstract String getIconSuffix (int partType); + + public abstract String getEffectSuffix (); + + public abstract String getDefaultFolder (); + + public void registerPartPaths (int index, String[] location) + { + headStrings.put(index, location[0]); + brokenHeadStrings.put(index, location[1]); + handleStrings.put(index, location[2]); + if (location.length > 3) + accessoryStrings.put(index, location[3]); + if (location.length > 4) + extraStrings.put(index, location[4]); + } + + public void registerEffectPath (int index, String location) + { + effectStrings.put(index, location); + } + + @Override + public void registerIcons (IconRegister iconRegister) + { + headIcons.clear(); + brokenIcons.clear(); + handleIcons.clear(); + accessoryIcons.clear(); + effectIcons.clear(); + Iterator iter = headStrings.entrySet().iterator(); + while (iter.hasNext()) + { + Map.Entry pairs = (Map.Entry) iter.next(); + headIcons.put((Integer) pairs.getKey(), iconRegister.registerIcon((String) pairs.getValue())); + } + + iter = brokenHeadStrings.entrySet().iterator(); + while (iter.hasNext()) + { + Map.Entry pairs = (Map.Entry) iter.next(); + brokenIcons.put((Integer) pairs.getKey(), iconRegister.registerIcon((String) pairs.getValue())); + } + + iter = handleStrings.entrySet().iterator(); + while (iter.hasNext()) + { + Map.Entry pairs = (Map.Entry) iter.next(); + handleIcons.put((Integer) pairs.getKey(), iconRegister.registerIcon((String) pairs.getValue())); + } + + if (getPartAmount() > 2) + { + iter = accessoryStrings.entrySet().iterator(); + while (iter.hasNext()) + { + Map.Entry pairs = (Map.Entry) iter.next(); + accessoryIcons.put((Integer) pairs.getKey(), iconRegister.registerIcon((String) pairs.getValue())); + } + } + + if (getPartAmount() > 3) + { + iter = extraStrings.entrySet().iterator(); + while (iter.hasNext()) + { + Map.Entry pairs = (Map.Entry) iter.next(); + extraIcons.put((Integer) pairs.getKey(), iconRegister.registerIcon((String) pairs.getValue())); + } + } + + iter = effectStrings.entrySet().iterator(); + while (iter.hasNext()) + { + Map.Entry pairs = (Map.Entry) iter.next(); + effectIcons.put((Integer) pairs.getKey(), iconRegister.registerIcon((String) pairs.getValue())); + } + + emptyIcon = iconRegister.registerIcon("tinker:blankface"); + } + + @Override + @SideOnly(Side.CLIENT) + public Icon getIconFromDamage(int meta) + { + return blankSprite; + } + + @Override + @SideOnly(Side.CLIENT) + public Icon getIcon (ItemStack stack, int renderPass) + { + NBTTagCompound tags = stack.getTagCompound(); + + if (tags != null) + { + tags = stack.getTagCompound().getCompoundTag("InfiTool"); + if (renderPass < getPartAmount()) + { + if (renderPass == 0) // Handle + { + return handleIcons.get(tags.getInteger("RenderHandle")); + } + + else if (renderPass == 1) // Head + { + if (tags.getBoolean("Broken")) + return (brokenIcons.get(tags.getInteger("RenderHead"))); + else + return (headIcons.get(tags.getInteger("RenderHead"))); + } + + else if (renderPass == 2) // Accessory + { + return (accessoryIcons.get(tags.getInteger("RenderAccessory"))); + } + + else if (renderPass == 3) // Extra + { + return (extraIcons.get(tags.getInteger("RenderExtra"))); + } + } + + else + { + if (renderPass == getPartAmount()) + { + if (tags.hasKey("Effect1")) + return (effectIcons.get(tags.getInteger("Effect1"))); + } + + else if (renderPass == getPartAmount() + 1) + { + if (tags.hasKey("Effect2")) + return (effectIcons.get(tags.getInteger("Effect2"))); + } + + else if (renderPass == getPartAmount() + 2) + { + if (tags.hasKey("Effect3")) + return (effectIcons.get(tags.getInteger("Effect3"))); + } + + else if (renderPass == getPartAmount() + 3) + { + if (tags.hasKey("Effect4")) + return (effectIcons.get(tags.getInteger("Effect4"))); + } + + else if (renderPass == getPartAmount() + 4) + { + if (tags.hasKey("Effect5")) + return (effectIcons.get(tags.getInteger("Effect5"))); + } + + else if (renderPass == getPartAmount() + 5) + { + if (tags.hasKey("Effect6")) + return (effectIcons.get(tags.getInteger("Effect6"))); + } + } + return blankSprite; + } + return emptyIcon; + } + + /* Tags and information about the tool */ + @Override + @SideOnly(Side.CLIENT) + public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) + { + if (!stack.hasTagCompound()) + return; + + NBTTagCompound tags = stack.getTagCompound(); + if (tags.hasKey("InfiTool")) + { + boolean broken = tags.getCompoundTag("InfiTool").getBoolean("Broken"); + if (broken) + list.add("\u00A7oBroken"); + else + { + int head = tags.getCompoundTag("InfiTool").getInteger("Head"); + int handle = tags.getCompoundTag("InfiTool").getInteger("Handle"); + int binding = tags.getCompoundTag("InfiTool").getInteger("Accessory"); + int extra = tags.getCompoundTag("InfiTool").getInteger("Extra"); + + String headName = getAbilityNameForType(head); + if (!headName.equals("")) + list.add(getStyleForType(head) + headName); + + String handleName = getAbilityNameForType(handle); + if (!handleName.equals("") && handle != head) + list.add(getStyleForType(handle) + handleName); + + if (getPartAmount() >= 3) + { + String bindingName = getAbilityNameForType(binding); + if (!bindingName.equals("") && binding != head && binding != handle) + list.add(getStyleForType(binding) + bindingName); + } + + if (getPartAmount() >= 4) + { + String extraName = getAbilityNameForType(extra); + if (!extraName.equals("") && extra != head && extra != handle && extra != binding) + list.add(getStyleForType(extra) + extraName); + } + + int unbreaking = tags.getCompoundTag("InfiTool").getInteger("Unbreaking"); + String reinforced = getReinforcedName(head, handle, binding, extra, unbreaking); + if (!reinforced.equals("")) + list.add(reinforced); + + boolean displayToolTips = true; + int tipNum = 0; + while (displayToolTips) + { + tipNum++; + String tooltip = "Tooltip" + tipNum; + if (tags.getCompoundTag("InfiTool").hasKey(tooltip)) + { + String tipName = tags.getCompoundTag("InfiTool").getString(tooltip); + if (!tipName.equals("")) + list.add(tipName); + } + else + displayToolTips = false; + } + } + } + } + + public static String getStyleForType (int type) + { + return TConstructRegistry.getMaterial(type).style(); + } + + public String getAbilityNameForType (int type) + { + return TConstructRegistry.getMaterial(type).ability(); + } + + public String getReinforcedName (int head, int handle, int accessory, int extra, int unbreaking) + { + ToolMaterial headMat = TConstructRegistry.getMaterial(head); + ToolMaterial handleMat = TConstructRegistry.getMaterial(handle); + ToolMaterial accessoryMat = TConstructRegistry.getMaterial(accessory); + ToolMaterial extraMat = TConstructRegistry.getMaterial(extra); + + int reinforced = 0; + String style = ""; + int current = headMat.reinforced(); + if (current > 0) + { + style = headMat.style(); + reinforced = current; + } + current = handleMat.reinforced(); + if (current > 0 && current > reinforced) + { + style = handleMat.style(); + reinforced = current; + } + if (getPartAmount() >= 3) + { + current = accessoryMat.reinforced(); + if (current > 0 && current > reinforced) + { + style = accessoryMat.style(); + reinforced = current; + } + } + if (getPartAmount() >= 4) + { + current = extraMat.reinforced(); + if (current > 0 && current > reinforced) + { + style = extraMat.style(); + reinforced = current; + } + } + + reinforced += unbreaking - reinforced; + + if (reinforced > 0) + { + return style + getReinforcedString(reinforced); + } + return ""; + } + + String getReinforcedString (int reinforced) + { + if (reinforced > 9) + return "Unbreakable"; + String ret = "Reinforced "; + switch (reinforced) + { + case 1: + ret += "I"; + break; + case 2: + ret += "II"; + break; + case 3: + ret += "III"; + break; + case 4: + ret += "IV"; + break; + case 5: + ret += "V"; + break; + case 6: + ret += "VI"; + break; + case 7: + ret += "VII"; + break; + case 8: + ret += "VIII"; + break; + case 9: + ret += "IX"; + break; + default: + ret += "X"; + break; + } + return ret; + } + + //Used for sounds and the like + public void onEntityDamaged (World world, EntityPlayer player, Entity entity) + { + + } + + /* Creative mode tools */ + static String[] toolMaterialNames = { "Wooden ", "Stone ", "Iron ", "Flint ", "Cactus ", "Bone ", "Obsidian ", "Netherrack ", "Slime ", "Paper ", "Cobalt ", "Ardite ", "Manyullyn ", "Copper ", + "Bronze ", "Alumite ", "Steel ", "Slime " }; + + public void getSubItems (int id, CreativeTabs tab, List list) + { + for (int i = 0; i < 18; i++) + { + Item accessory = getAccessoryItem(); + ItemStack accessoryStack = accessory != null ? new ItemStack(getAccessoryItem(), 1, i) : null; + Item extra = getExtraItem(); + ItemStack extraStack = extra != null ? new ItemStack(getExtraItem(), 1, i) : null; + ItemStack tool = ToolBuilder.instance.buildTool(new ItemStack(getHeadItem(), 1, i), new ItemStack(getHandleItem(), 1, i), accessoryStack, extraStack, toolMaterialNames[i] + getToolName()); + if (tool == null) + { + System.out.println("Creative builder failed tool for "+toolMaterialNames[i] + this.getToolName()); + System.out.println("Make sure you do not have item ID conflicts"); + } + else + { + tool.getTagCompound().getCompoundTag("InfiTool").setBoolean("Built", true); + list.add(tool); + } + } + } + + public abstract Item getHeadItem (); + + public abstract Item getAccessoryItem (); + + public Item getExtraItem () + { + return null; + } + + public Item getHandleItem () + { + return TConstructRegistry.getItem("toolRod");//TContent.toolRod; + } + + /* Updating */ + + public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boolean par5) + { + for (ActiveToolMod mod : TConstructRegistry.activeModifiers) + { + mod.updateTool(this, stack, world, entity); + } + } + + /* Tool uses */ + + //Types + public abstract String[] toolCategories (); + + //Mining + @Override + public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPlayer player) + { + boolean cancelHarvest = false; + for (ActiveToolMod mod : TConstructRegistry.activeModifiers) + { + if (mod.beforeBlockBreak(this, stack, x, y, z, player)) + cancelHarvest = true; + } + + return cancelHarvest; + } + + @Override + public boolean onBlockDestroyed (ItemStack itemstack, World world, int blockID, int x, int y, int z, EntityLiving player) + { + return AbilityHelper.onBlockChanged(itemstack, world, blockID, x, y, z, player, random); + } + + @Override + public float getStrVsBlock (ItemStack stack, Block block, int meta) + { + NBTTagCompound tags = stack.getTagCompound(); + if (tags.getCompoundTag("InfiTool").getBoolean("Broken")) + return 0.1f; + return 1f; + } + + // Attacking + @Override + public boolean onLeftClickEntity (ItemStack stack, EntityPlayer player, Entity entity) + { + AbilityHelper.onLeftClickEntity(stack, player, entity, this); + return true; + } + + @Override + public boolean hitEntity (ItemStack stack, EntityLiving mob, EntityLiving player) + { + return true; + } + + public boolean pierceArmor () + { + return false; + } + + public float chargeAttack () + { + return 1f; + } + + public int getDamageVsEntity (Entity par1Entity) + { + return this.damageVsEntity; + } + + //Changes how much durability the base tool has + public float getDurabilityModifier () + { + return 1f; + } + + public float getRepairCost () + { + return getDurabilityModifier(); + } + + public float getDamageModifier () + { + return 1.0f; + } + + //Right-click + public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) + { + /*if (world.isRemote) + return true;*/ + + int posX = x; + int posY = y; + int posZ = z; + int playerPosX = (int) Math.floor(player.posX); + int playerPosY = (int) Math.floor(player.posY); + int playerPosZ = (int) Math.floor(player.posZ); + if (side == 0) + { + --posY; + } + + if (side == 1) + { + ++posY; + } + + if (side == 2) + { + --posZ; + } + + if (side == 3) + { + ++posZ; + } + + if (side == 4) + { + --posX; + } + + if (side == 5) + { + ++posX; + } + if (posX == playerPosX && (posY == playerPosY || posY == playerPosY + 1 || posY == playerPosY - 1) && posZ == playerPosZ) + { + return false; + } + + boolean used = false; + int hotbarSlot = player.inventory.currentItem; + int itemSlot = hotbarSlot == 0 ? 8 : hotbarSlot + 1; + ItemStack nearbyStack = null; + + if (hotbarSlot < 8) + { + nearbyStack = player.inventory.getStackInSlot(itemSlot); + if (nearbyStack != null && nearbyStack.getItem() instanceof ItemBlock) + { + used = nearbyStack.getItem().onItemUse(nearbyStack, player, world, x, y, z, side, clickX, clickY, clickZ); + if (nearbyStack.stackSize < 1) + { + nearbyStack = null; + player.inventory.setInventorySlotContents(itemSlot, null); + } + } + } + + /*if (used) //Update client + { + Packet103SetSlot packet = new Packet103SetSlot(player.openContainer.windowId, itemSlot, nearbyStack); + ((EntityPlayerMP)player).playerNetServerHandler.sendPacketToPlayer(packet); + }*/ + return used; + } + + //Vanilla overrides + public boolean isItemTool (ItemStack par1ItemStack) + { + return false; + } + + @Override + public boolean getIsRepairable (ItemStack par1ItemStack, ItemStack par2ItemStack) + { + return false; + } + + public boolean isRepairable () + { + return false; + } + + public int getItemEnchantability () + { + return 0; + } + + public boolean isFull3D () + { + return true; + } + + /* Proper stack damage */ + public int getItemDamageFromStack (ItemStack stack) + { + NBTTagCompound tags = stack.getTagCompound(); + if (tags == null) + { + //System.out.println("Tool item is uninitalized! This method should never be called with a default item"); + //Exception e = new NullPointerException(); + //e.printStackTrace(); + return 0; + } + + return tags.getCompoundTag("InfiTool").getInteger("Damage"); + } + + public int getItemDamageFromStackForDisplay (ItemStack stack) + { + NBTTagCompound tags = stack.getTagCompound(); + if (tags == null) + { + //System.out.println("Tool item is uninitalized! This method should never be called with a default item"); + //Exception e = new NullPointerException(); + //e.printStackTrace(); + return 0; + } + + return tags.getCompoundTag("InfiTool").getInteger("Damage"); + } + + public int getItemMaxDamageFromStack (ItemStack stack) + { + NBTTagCompound tags = stack.getTagCompound(); + if (tags == null) + { + //System.out.println("Tool item is uninitalized! This method should never be called with a default item"); + //Exception e = new NullPointerException(); + //e.printStackTrace(); + return 0; + } + return tags.getCompoundTag("InfiTool").getInteger("TotalDurability"); + } + +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/tools/ToolMaterial.java b/src/minecraft/mods/tinker/tconstruct/library/tools/ToolMaterial.java new file mode 100755 index 000000000..5e213879b --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/tools/ToolMaterial.java @@ -0,0 +1,83 @@ +package mods.tinker.tconstruct.library.tools; +/* + * Dynamic substitute for an enum. It carries a lot of information + */ +public class ToolMaterial +{ + //mining level, durability, mining speed, baseDamage, handle modifier, Reinforced level, shoddy/spiny level, color/style on name + + public final String materialName; + public final int harvestLevel; + public final int durability; + public final int miningspeed; // <-- divided by 100 + public final int attack; + public final float handleModifier; + public final int reinforced; + public final float stonebound; + public final String tipStyle; + public final String ability; + + public ToolMaterial(String name, int level, int durability, int speed, int damage, float handle, int reinforced, float stonebound, String style, String ability) + { + this.materialName = name; + this.harvestLevel = level; + this.durability = durability; + this.miningspeed = speed; + this.attack = damage; + this.handleModifier = handle; + this.reinforced = reinforced; + this.stonebound = stonebound; + this.tipStyle = style; + this.ability = ability; + } + + public String name() + { + return materialName; + } + + public int durability() + { + return this.durability; + } + + public int toolSpeed() + { + return this.miningspeed; + } + + public int attack() + { + return this.attack; + } + + public int harvestLevel() + { + return this.harvestLevel; + } + + public float handleDurability() + { + return this.handleModifier; + } + + public int reinforced() + { + return this.reinforced; + } + + public float shoddy() + { + return this.stonebound; + } + + public String style() + { + return this.tipStyle; + } + + public String ability() + { + return this.ability; + } +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/tools/ToolMod.java b/src/minecraft/mods/tinker/tconstruct/library/tools/ToolMod.java new file mode 100755 index 000000000..0053dacf2 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/tools/ToolMod.java @@ -0,0 +1,210 @@ +package mods.tinker.tconstruct.library.tools; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Random; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public abstract class ToolMod +{ + public final String key; + public final List stacks; + public final int effectIndex; + public static Random random = new Random(); + + public ToolMod(ItemStack[] items, int effect, String dataKey) + { + //recipeItems = items; + List itemstacks = new ArrayList(); + for (int iter = 0; iter < items.length; iter++) + itemstacks.add(items[iter]); + stacks = itemstacks; + effectIndex = effect; + key = dataKey; + } + + /** Checks to see if the inputs match the stored items + * Note: Works like ShapelessRecipes + * + * @param input The ItemStacks to compare against + * @param tool Item to modify, used for restrictions + * @return Whether the recipe matches the input + */ + public boolean matches (ItemStack[] input, ItemStack tool) + { + if (!canModify(tool, input)) + return false; + + ArrayList list = new ArrayList(this.stacks); + + for (int iter = 0; iter < input.length; ++iter) + { + ItemStack craftingStack = input[iter]; + + if (craftingStack != null) + { + boolean canCraft = false; + Iterator iterate = list.iterator(); + + while (iterate.hasNext()) + { + ItemStack removeStack = (ItemStack) iterate.next(); + + if (craftingStack.itemID == removeStack.itemID && (removeStack.getItemDamage() == Short.MAX_VALUE || craftingStack.getItemDamage() == removeStack.getItemDamage())) + { + canCraft = true; + list.remove(removeStack); + break; + } + } + + if (!canCraft) + { + return false; + } + } + } + + return list.isEmpty(); + } + + /** + * + * @param tool Tool to compare against + * @return Whether the tool can be modified + */ + + protected boolean canModify (ItemStack tool, ItemStack[] input) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + return tags.getInteger("Modifiers") > 0; + } + + /** Modifies the tool. Adds nbttags, changes existing ones, ticks down modification counter, etc + * + * @param input ItemStacks to pull info from + * @param tool The tool to modify + */ + public abstract void modify (ItemStack[] input, ItemStack tool); + + public void addMatchingEffect (ItemStack tool) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + if (tags.hasKey("Effect6") || tags.hasKey(key)) + return; + + else if (tags.hasKey("Effect5")) + { + tags.setInteger("Effect6", effectIndex); + } + else if (tags.hasKey("Effect4")) + { + tags.setInteger("Effect5", effectIndex); + } + else if (tags.hasKey("Effect3")) + { + tags.setInteger("Effect4", effectIndex); + } + else if (tags.hasKey("Effect2")) + { + tags.setInteger("Effect3", effectIndex); + } + else if (tags.hasKey("Effect1")) + { + tags.setInteger("Effect2", effectIndex); + } + else + { + tags.setInteger("Effect1", effectIndex); + } + } + + protected int addModifierTip (ItemStack tool, String modifierTip) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + int tipNum = 0; + while (true) + { + tipNum++; + String tip = "Tooltip" + tipNum; + if (!tags.hasKey(tip)) + { + tags.setString(tip, ""); + String modTip = "ModifierTip" + tipNum; + tags.setString(modTip, modifierTip); + return tipNum; + } + } + } + + protected int addToolTip (ItemStack tool, String tooltip, String modifierTip) + { + NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool"); + int tipNum = 0; + while (true) + { + tipNum++; + String tip = "Tooltip" + tipNum; + if (!tags.hasKey(tip)) + { + tags.setString(tip, tooltip); + String modTip = "ModifierTip" + tipNum; + tags.setString(modTip, modifierTip); + return tipNum; + } + else + { + String tag = tags.getString(tip); + if (tag.contains(tooltip)) + { + tags.setString(tip, getProperName(tooltip, tag)); + String modTip = "ModifierTip" + tipNum; + tag = tags.getString(modTip); + tags.setString(modTip, getProperName(modifierTip, tag)); + return tipNum; + } + } + } + } + + protected String getProperName(String tooltip, String tag) + { + if (tag.equals(tooltip)) + return tooltip + " II"; + + if (tag.equals(tooltip + " II")) + return tooltip + " III"; + + if (tag.equals(tooltip + " III")) + return tooltip + " IV"; + + if (tag.equals(tooltip + " IV")) + return tooltip + " V"; + + if (tag.equals(tooltip + " V")) + return tooltip + " VI"; + + if (tag.equals(tooltip + " VI")) + return tooltip + " VII"; + + if (tag.equals(tooltip + " VII")) + return tooltip + " VIII"; + + if (tag.equals(tooltip + " VIII")) + return tooltip + " IX"; + + if (tag.equals(tooltip + " IX")) + return tooltip + " X"; + + return tooltip + " X+"; + } + + public boolean validType(ToolCore tool) + { + return true; + } +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/tools/Weapon.java b/src/minecraft/mods/tinker/tconstruct/library/tools/Weapon.java new file mode 100755 index 000000000..613b8d92d --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/tools/Weapon.java @@ -0,0 +1,113 @@ +package mods.tinker.tconstruct.library.tools; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumAction; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + +public abstract class Weapon extends ToolCore +{ + + public Weapon(int itemID, int baseDamage) + { + super(itemID, baseDamage); + } + + protected float baseSpeed() + { + return 1.5f; + } + + protected float effectiveSpeed() + { + return 15f; + } + + @Override + public float getStrVsBlock(ItemStack stack, Block block, int meta) + { + if (stack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Broken")) + return 0.1f; + + for (int i = 0; i < web.length; i++) + { + if (web[i] == block.blockMaterial ) + { + return effectiveSpeed(); + } + } + return baseSpeed(); + } + + /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack par1ItemStack) + { + return EnumAction.block; + } + + /** + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack par1ItemStack) + { + return 72000; + } + + /** + * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer + */ + public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) + { + player.setItemInUse(stack, this.getMaxItemUseDuration(stack)); + return stack; + } + + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float clickX, float clickY, float clickZ) + { + return false; + } + + /** + * Returns if the item (tool) can harvest results from the block type. + */ + public boolean canHarvestBlock(Block block) + { + for (int i = 0; i < web.length; i++) + { + if (block.blockMaterial == web[i]) + return true; + } + return super.canHarvestBlock(block); + } + + protected Material[] getEffectiveMaterials() + { + return web; + } + + @Override + public int getHeadType () + { + return 1; + } + + /*@Override + public boolean onLeftClickEntity (ItemStack stack, EntityPlayer player, Entity entity) + { + TContent.modL.midStreamModify(stack); + return super.onLeftClickEntity(stack, player, entity); + }*/ + + @Override + public String[] toolCategories() + { + return new String[] { "weapon", "melee" }; + } + + public static Material[] web = new Material[] { Material.web }; + public static Material[] none = new Material[0]; +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/util/CoordTuple.java b/src/minecraft/mods/tinker/tconstruct/library/util/CoordTuple.java new file mode 100755 index 000000000..5996e6b01 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/util/CoordTuple.java @@ -0,0 +1,54 @@ +package mods.tinker.tconstruct.library.util; + +public class CoordTuple +{ + public final int x; + public final int y; + public final int z; + + public CoordTuple(int posX, int posY, int posZ) + { + x = posX; + y = posY; + z = posZ; + } + + public boolean equalCoords (int posX, int posY, int posZ) + { + if (this.x == posX && this.y == posY && this.z == posZ) + return true; + else + return false; + } + + @Override + public boolean equals(Object obj) + { + if (obj == null) + return false; + + if(getClass() == obj.getClass()) + { + CoordTuple coord = (CoordTuple)obj; + if(this.x == coord.x && this.y == coord.y && this.z == coord.z) + return true; + } + return false; + } + + @Override + public int hashCode () + { + final int prime = 31; + int result = 1; + result = prime * result + x; + result = prime * result + y; + result = prime * result + z; + return result; + } + + public String toString () + { + return "X: " + x + ", Y: " + y + ", Z: " + z; + } +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/util/IActiveLogic.java b/src/minecraft/mods/tinker/tconstruct/library/util/IActiveLogic.java new file mode 100755 index 000000000..29b190527 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/util/IActiveLogic.java @@ -0,0 +1,7 @@ +package mods.tinker.tconstruct.library.util; + +public interface IActiveLogic +{ + public boolean getActive(); + public void setActive(boolean flag); +} \ No newline at end of file diff --git a/src/minecraft/mods/tinker/tconstruct/library/util/IFacingLogic.java b/src/minecraft/mods/tinker/tconstruct/library/util/IFacingLogic.java new file mode 100755 index 000000000..62d921fc5 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/util/IFacingLogic.java @@ -0,0 +1,11 @@ +package mods.tinker.tconstruct.library.util; + +import net.minecraft.entity.EntityLiving; +import net.minecraftforge.common.ForgeDirection; + +public interface IFacingLogic +{ + public byte getRenderDirection(); + public ForgeDirection getForgeDirection(); + public void setDirection(float yaw, float pitch, EntityLiving player); +} \ No newline at end of file diff --git a/src/minecraft/mods/tinker/tconstruct/library/util/IMasterLogic.java b/src/minecraft/mods/tinker/tconstruct/library/util/IMasterLogic.java new file mode 100755 index 000000000..e6a553c8a --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/util/IMasterLogic.java @@ -0,0 +1,6 @@ +package mods.tinker.tconstruct.library.util; + +public interface IMasterLogic +{ + public void notifyChange(int x, int y, int z); +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/util/IPattern.java b/src/minecraft/mods/tinker/tconstruct/library/util/IPattern.java new file mode 100755 index 000000000..5540984f4 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/util/IPattern.java @@ -0,0 +1,10 @@ +package mods.tinker.tconstruct.library.util; + +import mods.tinker.tconstruct.library.crafting.PatternBuilder.MaterialSet; +import net.minecraft.item.ItemStack; + +public interface IPattern +{ + public int getPatternCost (ItemStack pattern); + public ItemStack getPatternOutput(ItemStack pattern, ItemStack input, MaterialSet set); +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/util/IServantLogic.java b/src/minecraft/mods/tinker/tconstruct/library/util/IServantLogic.java new file mode 100755 index 000000000..2d353c1ec --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/util/IServantLogic.java @@ -0,0 +1,9 @@ +package mods.tinker.tconstruct.library.util; + +public interface IServantLogic +{ + public CoordTuple getMasterPosition (); + public void notifyMasterOfChange(); + public boolean verifyMaster(int x, int y, int z); + public boolean setMaster(int x, int y, int z); +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/util/IToolPart.java b/src/minecraft/mods/tinker/tconstruct/library/util/IToolPart.java new file mode 100755 index 000000000..1c13f93d6 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/util/IToolPart.java @@ -0,0 +1,13 @@ +package mods.tinker.tconstruct.library.util; + +import net.minecraft.item.ItemStack; + +public interface IToolPart +{ + /** Parts to build tools from. ex: Pickaxe Head + * + * @param stack This item + * @return Proper material ID. -1 for invalid + */ + public int getMaterialID(ItemStack stack); +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/util/PiercingEntityDamage.java b/src/minecraft/mods/tinker/tconstruct/library/util/PiercingEntityDamage.java new file mode 100755 index 000000000..5c03e7696 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/util/PiercingEntityDamage.java @@ -0,0 +1,13 @@ +package mods.tinker.tconstruct.library.util; + +import net.minecraft.entity.Entity; +import net.minecraft.util.EntityDamageSource; + +public class PiercingEntityDamage extends EntityDamageSource +{ + public PiercingEntityDamage(String str, Entity entity) + { + super(str, entity); + this.setDamageBypassesArmor(); + } +} diff --git a/src/minecraft/mods/tinker/tconstruct/library/util/TabTools.java b/src/minecraft/mods/tinker/tconstruct/library/util/TabTools.java new file mode 100755 index 000000000..e78f2b810 --- /dev/null +++ b/src/minecraft/mods/tinker/tconstruct/library/util/TabTools.java @@ -0,0 +1,24 @@ +package mods.tinker.tconstruct.library.util; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; + +public class TabTools extends CreativeTabs +{ + ItemStack display; + + public TabTools(String label) + { + super(label); + } + + public void init(ItemStack stack) + { + display = stack; + } + + public ItemStack getIconItemStack() + { + return display; + } +} \ No newline at end of file