From e7666e031b069a1b8ca8a4b3c51350e4f2591ac9 Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Sun, 5 Oct 2014 22:19:04 +0200 Subject: [PATCH] Take all the shortbow and arrow stuff out of the Tools module, and try to keep backwards compatibility >_> --- src/main/java/tconstruct/TConstruct.java | 1 + .../java/tconstruct/items/tools/Arrow.java | 7 +- .../java/tconstruct/items/tools/Shortbow.java | 3 +- .../library/TConstructRegistry.java | 16 ++- .../library/tools/ArrowMaterial.java | 10 +- .../tconstruct/library/tools/BowMaterial.java | 10 +- .../tconstruct/tools/TinkerToolEvents.java | 51 ------- .../java/tconstruct/tools/TinkerTools.java | 94 +++---------- .../tconstruct/tools/ToolProxyClient.java | 26 +--- .../tconstruct/weaponry/TinkerWeaponry.java | 132 ++++++++++-------- .../weaponry/WeaponryClientProxy.java | 15 +- .../tconstruct/weaponry/ammo/ArrowAmmo.java | 5 +- .../tconstruct/weaponry/ammo/BoltAmmo.java | 3 +- .../tconstruct/weaponry/weapons/Crossbow.java | 2 +- .../tconstruct/weaponry/weapons/Javelin.java | 3 +- .../tconstruct/weaponry/weapons/LongBow.java | 2 +- .../tconstruct/weaponry/weapons/ShortBow.java | 3 +- 17 files changed, 143 insertions(+), 240 deletions(-) diff --git a/src/main/java/tconstruct/TConstruct.java b/src/main/java/tconstruct/TConstruct.java index fc704cef363..1a36d343e7b 100644 --- a/src/main/java/tconstruct/TConstruct.java +++ b/src/main/java/tconstruct/TConstruct.java @@ -145,6 +145,7 @@ public void preInit (FMLPreInitializationEvent event) TConstructRegistry.partTab = new TConstructCreativeTab("TConstructParts"); TConstructRegistry.blockTab = new TConstructCreativeTab("TConstructBlocks"); TConstructRegistry.equipableTab = new TConstructCreativeTab("TConstructEquipables"); + TConstructRegistry.weaponryTab = new TConstructCreativeTab("TConstructWeaponry"); tableCasting = new LiquidCasting(); basinCasting = new LiquidCasting(); diff --git a/src/main/java/tconstruct/items/tools/Arrow.java b/src/main/java/tconstruct/items/tools/Arrow.java index 35e610291bf..a9b1cce301f 100644 --- a/src/main/java/tconstruct/items/tools/Arrow.java +++ b/src/main/java/tconstruct/items/tools/Arrow.java @@ -10,10 +10,9 @@ import net.minecraft.world.World; import tconstruct.library.TConstructRegistry; import tconstruct.library.crafting.ToolBuilder; -import tconstruct.library.tools.BowstringMaterial; import tconstruct.library.tools.FletchingMaterial; import tconstruct.library.tools.ToolCore; -import tconstruct.tools.TinkerTools; +import tconstruct.weaponry.TinkerWeaponry; public class Arrow extends ToolCore { @@ -81,13 +80,13 @@ public void registerAlternatePartPaths (int index, String[] location) @Override public Item getHeadItem () { - return TinkerTools.arrowhead; + return TinkerWeaponry.arrowhead; } @Override public Item getAccessoryItem () { - return TinkerTools.fletching; + return TinkerWeaponry.fletching; } @Override diff --git a/src/main/java/tconstruct/items/tools/Shortbow.java b/src/main/java/tconstruct/items/tools/Shortbow.java index 9acb9f6ec9b..6086e27831e 100644 --- a/src/main/java/tconstruct/items/tools/Shortbow.java +++ b/src/main/java/tconstruct/items/tools/Shortbow.java @@ -12,6 +12,7 @@ import tconstruct.library.TConstructRegistry; import tconstruct.library.tools.BowstringMaterial; import tconstruct.tools.TinkerTools; +import tconstruct.weaponry.TinkerWeaponry; public class Shortbow extends BowBase { @@ -71,7 +72,7 @@ public Item getHeadItem () @Override public Item getHandleItem () { - return TinkerTools.bowstring; + return TinkerWeaponry.bowstring; } @Override diff --git a/src/main/java/tconstruct/library/TConstructRegistry.java b/src/main/java/tconstruct/library/TConstructRegistry.java index df402c1c38b..e6a310d24a9 100644 --- a/src/main/java/tconstruct/library/TConstructRegistry.java +++ b/src/main/java/tconstruct/library/TConstructRegistry.java @@ -372,12 +372,18 @@ public static ToolMaterial getMaterial (String key) // Bow materials public static HashMap bowMaterials = new HashMap(40); + @Deprecated public static void addBowMaterial (int materialID, int durability, int drawSpeed, float speedMax) + { + addBowMaterial(materialID, drawSpeed, speedMax); + } + + public static void addBowMaterial (int materialID, int drawSpeed, float speedMax) { BowMaterial mat = bowMaterials.get(materialID); if (mat == null) { - mat = new BowMaterial(durability, drawSpeed, speedMax); + mat = new BowMaterial(drawSpeed, speedMax); bowMaterials.put(materialID, mat); } else @@ -396,12 +402,18 @@ public static BowMaterial getBowMaterial (int materialID) public static HashMap arrowMaterials = new HashMap(40); + @Deprecated public static void addArrowMaterial (int materialID, float mass, float breakChance, float accuracy) + { + addArrowMaterial(materialID, mass, breakChance, 0); + } + + public static void addArrowMaterial (int materialID, float mass, float breakChance) { ArrowMaterial mat = arrowMaterials.get(materialID); if (mat == null) { - mat = new ArrowMaterial(mass, breakChance, accuracy); + mat = new ArrowMaterial(mass, breakChance); arrowMaterials.put(materialID, mat); } else diff --git a/src/main/java/tconstruct/library/tools/ArrowMaterial.java b/src/main/java/tconstruct/library/tools/ArrowMaterial.java index 884e3edc49a..3f361f8ab20 100644 --- a/src/main/java/tconstruct/library/tools/ArrowMaterial.java +++ b/src/main/java/tconstruct/library/tools/ArrowMaterial.java @@ -4,12 +4,16 @@ public class ArrowMaterial { public final float mass; public final float breakChance; - public final float accuracy; - public ArrowMaterial(float weight, float breakChance, float accuracy) + public ArrowMaterial(float weight, float breakChance) { this.mass = weight; this.breakChance = breakChance; - this.accuracy = accuracy; + } + + @Deprecated + public ArrowMaterial(float weight, float breakChance, float accuraccy) + { + this(weight, breakChance); } } diff --git a/src/main/java/tconstruct/library/tools/BowMaterial.java b/src/main/java/tconstruct/library/tools/BowMaterial.java index 89d0c80ef26..8769fabfb00 100644 --- a/src/main/java/tconstruct/library/tools/BowMaterial.java +++ b/src/main/java/tconstruct/library/tools/BowMaterial.java @@ -2,14 +2,18 @@ public class BowMaterial { - public final int durability; public final int drawspeed; public final float flightSpeedMax; - public BowMaterial(int durability, int drawspeed, float attack) + public BowMaterial(int drawspeed, float attack) { - this.durability = durability; this.drawspeed = drawspeed; this.flightSpeedMax = attack; } + + @Deprecated + public BowMaterial(int durability, int drawspeed, float attack) + { + this(drawspeed, attack); + } } diff --git a/src/main/java/tconstruct/tools/TinkerToolEvents.java b/src/main/java/tconstruct/tools/TinkerToolEvents.java index ecb5d4e7634..f7c7ca6089f 100644 --- a/src/main/java/tconstruct/tools/TinkerToolEvents.java +++ b/src/main/java/tconstruct/tools/TinkerToolEvents.java @@ -84,57 +84,6 @@ public void craftTool (ToolCraftEvent.NormalTool event) handlePaper(toolTag, event.tool); handleThaumium(toolTag, event.tool); - if (event.tool == TinkerTools.shortbow) - { - BowMaterial top = TConstructRegistry.getBowMaterial(toolTag.getInteger("Head")); - BowMaterial bottom = TConstructRegistry.getBowMaterial(toolTag.getInteger("Accessory")); - BowstringMaterial string = (BowstringMaterial) TConstructRegistry.getCustomMaterial(toolTag.getInteger("Handle"), BowstringMaterial.class); - - if (top != null && bottom != null && string != null) - { - if (toolTag.getInteger("Handle") == 1) - { - int modifiers = toolTag.getInteger("Modifiers"); - modifiers += 1; - toolTag.setInteger("Modifiers", modifiers); - } - - int durability = (int) ((top.durability + bottom.durability) / 2 * string.durabilityModifier); - toolTag.setInteger("TotalDurability", durability); - toolTag.setInteger("BaseDurability", durability); - - int drawSpeed = (int) ((top.drawspeed + bottom.drawspeed) / 2 * string.drawspeedModifier); - toolTag.setInteger("DrawSpeed", drawSpeed); - toolTag.setInteger("BaseDrawSpeed", drawSpeed); - - float flightSpeed = (top.flightSpeedMax + bottom.flightSpeedMax) / 2f * string.flightSpeedModifier; - toolTag.setFloat("FlightSpeed", flightSpeed); - } - } - - if (event.tool == TinkerTools.arrow) - { - ArrowMaterial head = TConstructRegistry.getArrowMaterial(toolTag.getInteger("Head")); - ArrowMaterial shaft = TConstructRegistry.getArrowMaterial(toolTag.getInteger("Handle")); - FletchingMaterial fletching = (FletchingMaterial) TConstructRegistry.getCustomMaterial(toolTag.getInteger("Accessory"), FletchingMaterial.class); - - if (head != null && shaft != null && fletching != null) - { - float mass = head.mass / 5f + shaft.mass + fletching.mass; - float shatter = (head.breakChance + shaft.breakChance + fletching.breakChance) / 4f; - float accuracy = (head.accuracy + shaft.accuracy + fletching.accuracy) / 3; - - ItemStack arrow = new ItemStack(event.tool, 4); - toolTag.setInteger("TotalDurability", 0); - toolTag.setFloat("Mass", mass); - toolTag.setFloat("BreakChance", shatter); - toolTag.setFloat("Accuracy", accuracy); - toolTag.setInteger("Unbreaking", 10); - arrow.setTagCompound(event.toolTag); - event.overrideResult(arrow); - } - } - if (event.tool == TinkerTools.battlesign) { int modifiers = toolTag.getInteger("Modifiers"); diff --git a/src/main/java/tconstruct/tools/TinkerTools.java b/src/main/java/tconstruct/tools/TinkerTools.java index 490c8480f81..0bf2cd920ef 100644 --- a/src/main/java/tconstruct/tools/TinkerTools.java +++ b/src/main/java/tconstruct/tools/TinkerTools.java @@ -31,6 +31,7 @@ import tconstruct.tools.logic.*; import tconstruct.util.ItemHelper; import tconstruct.util.config.PHConstruct; +import tconstruct.weaponry.TinkerWeaponry; import tconstruct.world.TinkerWorld; import tconstruct.world.blocks.SoilBlock; import tconstruct.world.itemblocks.CraftedSoilItemBlock; @@ -45,6 +46,13 @@ public class TinkerTools @SidedProxy(clientSide = "tconstruct.tools.ToolProxyClient", serverSide = "tconstruct.tools.ToolProxyCommon") public static ToolProxyCommon proxy; + // backwards compatibility + public static Item bowstring; + public static DynamicToolPart arrowhead; + public static Item fletching; + public static ToolCore shortbow; + public static ToolCore arrow; + // Crafting blocks public static Block toolStationWood; public static Block toolStationStone; @@ -100,15 +108,10 @@ public class TinkerTools public static ToolCore cleaver; public static ToolCore hammer; public static ToolCore battleaxe; - public static ToolCore shortbow; - public static ToolCore arrow; public static Item potionLauncher; public static Item handGuard; public static Item crossbar; public static Item fullGuard; - public static Item bowstring; - public static Item arrowhead; - public static Item fletching; public static Block craftedSoil; //TODO: Untwine this public static Block multiBrick; public static Block multiBrickFancy; @@ -209,11 +212,8 @@ public void preInit (FMLPreInitializationEvent event) TinkerTools.hammer = new Hammer(); TinkerTools.battleaxe = new Battleaxe(); - TinkerTools.shortbow = new Shortbow(); - TinkerTools.arrow = new Arrow(); - - Item[] tools = { TinkerTools.pickaxe, TinkerTools.shovel, TinkerTools.hatchet, TinkerTools.broadsword, TinkerTools.longsword, TinkerTools.rapier, TinkerTools.dagger, TinkerTools.cutlass, TinkerTools.frypan, TinkerTools.battlesign, TinkerTools.mattock, TinkerTools.chisel, TinkerTools.lumberaxe, TinkerTools.cleaver, TinkerTools.scythe, TinkerTools.excavator, TinkerTools.hammer, TinkerTools.battleaxe, TinkerTools.shortbow, TinkerTools.arrow }; - String[] toolStrings = { "pickaxe", "shovel", "hatchet", "broadsword", "longsword", "rapier", "dagger", "cutlass", "frypan", "battlesign", "mattock", "chisel", "lumberaxe", "cleaver", "scythe", "excavator", "hammer", "battleaxe", "shortbow", "arrow" }; + Item[] tools = { TinkerTools.pickaxe, TinkerTools.shovel, TinkerTools.hatchet, TinkerTools.broadsword, TinkerTools.longsword, TinkerTools.rapier, TinkerTools.dagger, TinkerTools.cutlass, TinkerTools.frypan, TinkerTools.battlesign, TinkerTools.mattock, TinkerTools.chisel, TinkerTools.lumberaxe, TinkerTools.cleaver, TinkerTools.scythe, TinkerTools.excavator, TinkerTools.hammer, TinkerTools.battleaxe}; + String[] toolStrings = { "pickaxe", "shovel", "hatchet", "broadsword", "longsword", "rapier", "dagger", "cutlass", "frypan", "battlesign", "mattock", "chisel", "lumberaxe", "cleaver", "scythe", "excavator", "hammer", "battleaxe"}; for (int i = 0; i < tools.length; i++) { @@ -250,12 +250,10 @@ public void preInit (FMLPreInitializationEvent event) TinkerTools.largeSwordBlade = new DynamicToolPart("_large_sword_blade", "LargeSwordBlade"); TinkerTools.hammerHead = new DynamicToolPart("_hammer_head", "HammerHead"); - TinkerTools.bowstring = new Bowstring().setUnlocalizedName("tconstruct.Bowstring"); - TinkerTools.arrowhead = new ToolPart("_arrowhead", "ArrowHead").setUnlocalizedName("tconstruct.Arrowhead"); - TinkerTools.fletching = new Fletching().setUnlocalizedName("tconstruct.Fletching"); - Item[] toolParts = { TinkerTools.toolRod, TinkerTools.toolShard, TinkerTools.pickaxeHead, TinkerTools.shovelHead, TinkerTools.hatchetHead, TinkerTools.binding, TinkerTools.toughBinding, TinkerTools.toughRod, TinkerTools.largePlate, TinkerTools.swordBlade, TinkerTools.wideGuard, TinkerTools.handGuard, TinkerTools.crossbar, TinkerTools.knifeBlade, TinkerTools.fullGuard, TinkerTools.frypanHead, TinkerTools.signHead, TinkerTools.chiselHead, TinkerTools.scytheBlade, TinkerTools.broadAxeHead, TinkerTools.excavatorHead, TinkerTools.largeSwordBlade, TinkerTools.hammerHead, TinkerTools.bowstring, TinkerTools.fletching, TinkerTools.arrowhead }; - String[] toolPartStrings = { "toolRod", "toolShard", "pickaxeHead", "shovelHead", "hatchetHead", "binding", "toughBinding", "toughRod", "heavyPlate", "swordBlade", "wideGuard", "handGuard", "crossbar", "knifeBlade", "fullGuard", "frypanHead", "signHead", "chiselHead", "scytheBlade", "broadAxeHead", "excavatorHead", "largeSwordBlade", "hammerHead", "bowstring", "fletching", "arrowhead" }; + + Item[] toolParts = { TinkerTools.toolRod, TinkerTools.toolShard, TinkerTools.pickaxeHead, TinkerTools.shovelHead, TinkerTools.hatchetHead, TinkerTools.binding, TinkerTools.toughBinding, TinkerTools.toughRod, TinkerTools.largePlate, TinkerTools.swordBlade, TinkerTools.wideGuard, TinkerTools.handGuard, TinkerTools.crossbar, TinkerTools.knifeBlade, TinkerTools.fullGuard, TinkerTools.frypanHead, TinkerTools.signHead, TinkerTools.chiselHead, TinkerTools.scytheBlade, TinkerTools.broadAxeHead, TinkerTools.excavatorHead, TinkerTools.largeSwordBlade, TinkerTools.hammerHead}; + String[] toolPartStrings = { "toolRod", "toolShard", "pickaxeHead", "shovelHead", "hatchetHead", "binding", "toughBinding", "toughRod", "heavyPlate", "swordBlade", "wideGuard", "handGuard", "crossbar", "knifeBlade", "fullGuard", "frypanHead", "signHead", "chiselHead", "scytheBlade", "broadAxeHead", "excavatorHead", "largeSwordBlade", "hammerHead" }; for (int i = 0; i < toolParts.length; i++) { @@ -279,7 +277,7 @@ public void preInit (FMLPreInitializationEvent event) registerStencils(); // this array is only used to register the remaining pattern-part-interactions - TinkerTools.patternOutputs = new Item[] { TinkerTools.toolRod, TinkerTools.pickaxeHead, TinkerTools.shovelHead, TinkerTools.hatchetHead, TinkerTools.swordBlade, TinkerTools.wideGuard, TinkerTools.handGuard, TinkerTools.crossbar, TinkerTools.binding, TinkerTools.frypanHead, TinkerTools.signHead, TinkerTools.knifeBlade, TinkerTools.chiselHead, TinkerTools.toughRod, TinkerTools.toughBinding, TinkerTools.largePlate, TinkerTools.broadAxeHead, TinkerTools.scytheBlade, TinkerTools.excavatorHead, TinkerTools.largeSwordBlade, TinkerTools.hammerHead, TinkerTools.fullGuard, null, null, TinkerTools.arrowhead, null }; + TinkerTools.patternOutputs = new Item[] { TinkerTools.toolRod, TinkerTools.pickaxeHead, TinkerTools.shovelHead, TinkerTools.hatchetHead, TinkerTools.swordBlade, TinkerTools.wideGuard, TinkerTools.handGuard, TinkerTools.crossbar, TinkerTools.binding, TinkerTools.frypanHead, TinkerTools.signHead, TinkerTools.knifeBlade, TinkerTools.chiselHead, TinkerTools.toughRod, TinkerTools.toughBinding, TinkerTools.largePlate, TinkerTools.broadAxeHead, TinkerTools.scytheBlade, TinkerTools.excavatorHead, TinkerTools.largeSwordBlade, TinkerTools.hammerHead, TinkerTools.fullGuard, null, null, TinkerWeaponry.arrowhead, null }; //Moved temporarily to deal with AE2 Quartz TinkerTools.modFlux = new ModFlux(); @@ -395,10 +393,6 @@ private void addRecipesForToolBuilder () tb.addNormalToolRecipe(TinkerTools.hammer, TinkerTools.hammerHead, TinkerTools.toughRod, TinkerTools.largePlate, TinkerTools.largePlate); tb.addNormalToolRecipe(TinkerTools.battleaxe, TinkerTools.broadAxeHead, TinkerTools.toughRod, TinkerTools.broadAxeHead, TinkerTools.toughBinding); - BowRecipe recipe = new BowRecipe(TinkerTools.toolRod, TinkerTools.bowstring, TinkerTools.toolRod, TinkerTools.shortbow); - tb.addCustomToolRecipe(recipe); - tb.addNormalToolRecipe(TinkerTools.arrow, TinkerTools.arrowhead, TinkerTools.toolRod, TinkerTools.fletching); - ItemStack diamond = new ItemStack(Items.diamond); ModifyBuilder.registerModifier(new ModToolRepair()); ModifyBuilder.registerModifier(new ModDurability(new ItemStack[] { diamond }, 0, 500, 0f, 3, "Diamond", "\u00a7b" + StatCollector.translateToLocal("modifier.tool.diamond"), "\u00a7b")); @@ -695,9 +689,9 @@ private void modIntegration () TConstructRegistry.addPartMapping(TinkerTools.woodPattern, meta + 1, 31, new ItemStack(TinkerTools.patternOutputs[meta], 1, 31)); } - TConstructRegistry.addBowstringMaterial(1, 2, new ItemStack((Item) obj, 1, 7), new ItemStack(TinkerTools.bowstring, 1, 1), 1F, 1F, 0.9f, 0x63bcd9); - TConstructRegistry.addBowMaterial(31, 576, 40, 1.2f); - TConstructRegistry.addArrowMaterial(31, 1.8F, 0.5F, 100F); + TConstructRegistry.addBowstringMaterial(1, 2, new ItemStack((Item) obj, 1, 7), new ItemStack(TinkerWeaponry.bowstring, 1, 1), 1F, 1F, 0.9f, 0x63bcd9); + TConstructRegistry.addBowMaterial(31, 40, 1.2f); + TConstructRegistry.addArrowMaterial(31, 1.8F, 0.5F); } else { @@ -709,7 +703,7 @@ private void modIntegration () try { Object plantItem = ItemHelper.getStaticItem("plantItem", "mods.natura.common.NContent"); - TConstructRegistry.addBowstringMaterial(2, 2, new ItemStack((Item) plantItem, 1, 7), new ItemStack(TinkerTools.bowstring, 1, 2), 1.2F, 0.8F, 1.3f, 0xd3414f); + TConstructRegistry.addBowstringMaterial(2, 2, new ItemStack((Item) plantItem, 1, 7), new ItemStack(TinkerWeaponry.bowstring, 1, 2), 1.2F, 0.8F, 1.3f, 0xd3414f); } catch (Exception e) { @@ -740,54 +734,6 @@ void registerMaterials () TConstructRegistry.addToolMaterial(MaterialID.BlueSlime, "BlueSlime", 0, 1200, 150, 0, 2.0F, 0, 0f, AQUA.toString(), 0x66AEB0); TConstructRegistry.addToolMaterial(MaterialID.PigIron, "PigIron", 3, 250, 600, 2, 1.3F, 1, 0f, RED.toString(), 0xF0A8A4); - // Bow Materials: Material ID, durability, drawspeed, arrow speed - TConstructRegistry.addBowMaterial(MaterialID.Wood, 384, 20, 1.0f); // Wood - TConstructRegistry.addBowMaterial(MaterialID.Stone, 10, 80, 0.2f); // Stone - TConstructRegistry.addBowMaterial(MaterialID.Iron, 576, 30, 1.2f); // Iron - TConstructRegistry.addBowMaterial(MaterialID.Flint, 10, 80, 0.2f); // Flint - TConstructRegistry.addBowMaterial(MaterialID.Cactus, 384, 20, 1.0f); // Cactus - TConstructRegistry.addBowMaterial(MaterialID.Bone, 192, 30, 1.0f); // Bone - TConstructRegistry.addBowMaterial(MaterialID.Obsidian, 10, 80, 0.2f); // Obsidian - TConstructRegistry.addBowMaterial(MaterialID.Netherrack, 10, 80, 0.2f); // Netherrack - TConstructRegistry.addBowMaterial(MaterialID.Slime, 1536, 30, 1.2f); // Slime - TConstructRegistry.addBowMaterial(MaterialID.Paper, 48, 25, 0.5f); // Paper - TConstructRegistry.addBowMaterial(MaterialID.Cobalt, 1152, 30, 1.2f); // Cobalt - TConstructRegistry.addBowMaterial(MaterialID.Ardite, 960, 30, 1.2f); // Ardite - TConstructRegistry.addBowMaterial(MaterialID.Manyullyn, 1536, 30, 1.2f); // Manyullyn - TConstructRegistry.addBowMaterial(MaterialID.Copper, 384, 30, 1.2f); // Copper - TConstructRegistry.addBowMaterial(MaterialID.Bronze, 576, 30, 1.2f); // Bronze - TConstructRegistry.addBowMaterial(MaterialID.Alumite, 768, 30, 1.2f); // Alumite - TConstructRegistry.addBowMaterial(MaterialID.Steel, 768, 30, 1.2f); // Steel - TConstructRegistry.addBowMaterial(MaterialID.BlueSlime, 576, 20, 1.2f); // Blue Slime - TConstructRegistry.addBowMaterial(MaterialID.PigIron, 384, 20, 1.2f); // Pig Iron - - // Fletchling Materials: Material ID, mass, fragility - TConstructRegistry.addArrowMaterial(MaterialID.Wood, 0.69F, 1.0F, 100F); //Wood - TConstructRegistry.addArrowMaterial(MaterialID.Stone, 2.05F, 5.0F, 100F); //Stone - TConstructRegistry.addArrowMaterial(MaterialID.Iron, 3.6F, 0.5F, 100F); //Iron - TConstructRegistry.addArrowMaterial(MaterialID.Flint, 1.325F, 1.0F, 100F); //Flint - TConstructRegistry.addArrowMaterial(MaterialID.Cactus, 0.76F, 1.0F, 100F); //Cactus - TConstructRegistry.addArrowMaterial(MaterialID.Bone, 0.69F, 1.0F, 100); //Bone - TConstructRegistry.addArrowMaterial(MaterialID.Obsidian, 2.4F, 1.0F, 100F); //Obsidian - TConstructRegistry.addArrowMaterial(MaterialID.Netherrack, 1.5F, 1.0F, 100F); //Netherrack - TConstructRegistry.addArrowMaterial(MaterialID.Slime, 0.22F, 0.0F, 100F); //Slime - TConstructRegistry.addArrowMaterial(MaterialID.Paper, 0.69F, 3.0F, 90F); //Paper - TConstructRegistry.addArrowMaterial(MaterialID.Cobalt, 3.0F, 0.25F, 100F); //Cobalt - TConstructRegistry.addArrowMaterial(MaterialID.Ardite, 1.25F, 0.25F, 100F); //Ardite - TConstructRegistry.addArrowMaterial(MaterialID.Manyullyn, 2.25F, 0.1F, 100F); //Manyullyn - TConstructRegistry.addArrowMaterial(MaterialID.Copper, 2.7F, 0.5F, 100F); //Copper - TConstructRegistry.addArrowMaterial(MaterialID.Bronze, 3.6F, 0.25F, 100F); //Bronze - TConstructRegistry.addArrowMaterial(MaterialID.Alumite, 1.1F, 0.25F, 100F); //Alumite - TConstructRegistry.addArrowMaterial(MaterialID.Steel, 3.6F, 0.25F, 100F); //Steel - TConstructRegistry.addArrowMaterial(MaterialID.BlueSlime, 0.22F, 0.0F, 100F); //Blue Slime - TConstructRegistry.addArrowMaterial(MaterialID.PigIron, 3.6F, 0.5F, 100F); //Pigiron - - TConstructRegistry.addBowstringMaterial(0, 2, new ItemStack(Items.string), new ItemStack(TinkerTools.bowstring, 1, 0), 1F, 1F, 1f, 0xeeeeee); // String - TConstructRegistry.addFletchingMaterial(0, 2, new ItemStack(Items.feather), new ItemStack(TinkerTools.fletching, 1, 0), 100F, 0F, 0.05F, 0xffffff); // Feather - TConstructRegistry.addCustomMaterial(new FletchlingLeafMaterial(1, 2, "treeLeaves", new ItemStack(TinkerTools.fletching, 1, 1), 75F, 0F, 0.2F)); // all vanilla and oredicted leaves. and all leaves in general. - TConstructRegistry.addFletchingMaterial(2, 2, new ItemStack(TinkerTools.materials, 1, 1), new ItemStack(TinkerTools.fletching, 1, 2), 100F, 0F, 0.12F, 0x82c873); // Slime - TConstructRegistry.addFletchingMaterial(3, 2, new ItemStack(TinkerTools.materials, 1, 17), new ItemStack(TinkerTools.fletching, 1, 3), 100F, 0F, 0.12F, 0x74c8c7); // BlueSlime - PatternBuilder pb = PatternBuilder.instance; if (PHConstruct.enableTWood) pb.registerFullMaterial(Blocks.planks, 2, "Wood", new ItemStack(Items.stick), new ItemStack(Items.stick), 0); @@ -874,10 +820,6 @@ private void registerStencils () StencilBuilder.registerStencil(TinkerTools.woodPattern, 8); // crossbar StencilBuilder.registerStencil(TinkerTools.woodPattern, 7); // small guard StencilBuilder.registerStencil(TinkerTools.woodPattern, 6); // wide guard - - StencilBuilder.registerStencil(TinkerTools.woodPattern, 25); // arrow head - StencilBuilder.registerStencil(TinkerTools.woodPattern, 24); // fletchling - StencilBuilder.registerStencil(TinkerTools.woodPattern, 23); // bowstring } public static final class MaterialID diff --git a/src/main/java/tconstruct/tools/ToolProxyClient.java b/src/main/java/tconstruct/tools/ToolProxyClient.java index c31f5db1cea..561d0047138 100644 --- a/src/main/java/tconstruct/tools/ToolProxyClient.java +++ b/src/main/java/tconstruct/tools/ToolProxyClient.java @@ -26,6 +26,7 @@ import tconstruct.tools.gui.*; import tconstruct.tools.logic.*; import tconstruct.tools.model.*; +import tconstruct.weaponry.TinkerWeaponry; public class ToolProxyClient extends ToolProxyCommon { @@ -72,10 +73,8 @@ public void registerRenderer () MinecraftForgeClient.registerItemRenderer(TinkerTools.mattock, renderer); MinecraftForgeClient.registerItemRenderer(TinkerTools.rapier, renderer); MinecraftForgeClient.registerItemRenderer(TinkerTools.scythe, renderer); - MinecraftForgeClient.registerItemRenderer(TinkerTools.shortbow, renderer); renderer = new ToolCoreRenderer(true); - MinecraftForgeClient.registerItemRenderer(TinkerTools.arrow, renderer); - MinecraftForgeClient.registerItemRenderer(TinkerTools.dagger, renderer); + MinecraftForgeClient.registerItemRenderer(TinkerTools.dagger, renderer); // todo proper renderer TileEntityRendererDispatcher.instance.mapSpecialRenderers.put(BattlesignLogic.class, new BattlesignTesr()); } @@ -95,8 +94,8 @@ public void registerManualIcons () MantleClientRegistry.registerManualIcon("frypanicon", ToolBuilder.instance.buildTool(new ItemStack(TinkerTools.frypanHead, 1, 10), new ItemStack(TinkerTools.toolRod, 1, 11), null, "")); MantleClientRegistry.registerManualIcon("battlesignicon", ToolBuilder.instance.buildTool(new ItemStack(TinkerTools.signHead, 1, 10), new ItemStack(TinkerTools.toolRod, 1, 11), null, "")); MantleClientRegistry.registerManualIcon("chiselicon", ToolBuilder.instance.buildTool(new ItemStack(TinkerTools.chiselHead, 1, 10), new ItemStack(TinkerTools.toolRod, 1, 11), null, "")); - MantleClientRegistry.registerManualIcon("shortbowIcon", ToolBuilder.instance.buildTool(new ItemStack(TinkerTools.toolRod, 1, 10), new ItemStack(TinkerTools.bowstring, 1, 0), new ItemStack(TinkerTools.toolRod, 1, 12), "")); - MantleClientRegistry.registerManualIcon("arrowIcon", ToolBuilder.instance.buildTool(new ItemStack(TinkerTools.arrowhead, 1, 10), new ItemStack(TinkerTools.toolRod, 1, 11), new ItemStack(TinkerTools.fletching, 1, 0), "")); + MantleClientRegistry.registerManualIcon("shortbowIcon", ToolBuilder.instance.buildTool(new ItemStack(TinkerTools.toolRod, 1, 10), new ItemStack(TinkerWeaponry.bowstring, 1, 0), new ItemStack(TinkerTools.toolRod, 1, 12), "")); + MantleClientRegistry.registerManualIcon("arrowIcon", ToolBuilder.instance.buildTool(new ItemStack(TinkerWeaponry.arrowhead, 1, 10), new ItemStack(TinkerTools.toolRod, 1, 11), new ItemStack(TinkerWeaponry.fletching, 1, 0), "")); MantleClientRegistry.registerManualIcon("hammericon", ToolBuilder.instance.buildTool(new ItemStack(TinkerTools.hammerHead, 1, 10), new ItemStack(TinkerTools.toughRod, 1, 11), new ItemStack(TinkerTools.largePlate, 1, 12), new ItemStack(TinkerTools.largePlate, 8), "")); MantleClientRegistry.registerManualIcon("lumbericon", ToolBuilder.instance.buildTool(new ItemStack(TinkerTools.broadAxeHead, 1, 10), new ItemStack(TinkerTools.toughRod, 1, 11), new ItemStack(TinkerTools.largePlate, 1, 12), new ItemStack(TinkerTools.toughBinding, 8), "")); @@ -132,9 +131,9 @@ public void registerManualIcons () MantleClientRegistry.registerManualIcon("toughbinding", new ItemStack(TinkerTools.toughBinding, 1, 17)); MantleClientRegistry.registerManualIcon("largeplate", new ItemStack(TinkerTools.largePlate, 1, 17)); - MantleClientRegistry.registerManualIcon("bowstring", new ItemStack(TinkerTools.bowstring, 1, 0)); - MantleClientRegistry.registerManualIcon("arrowhead", new ItemStack(TinkerTools.arrowhead, 1, 2)); - MantleClientRegistry.registerManualIcon("fletching", new ItemStack(TinkerTools.fletching, 1, 0)); + MantleClientRegistry.registerManualIcon("bowstring", new ItemStack(TinkerWeaponry.bowstring, 1, 0)); + MantleClientRegistry.registerManualIcon("arrowhead", new ItemStack(TinkerWeaponry.arrowhead, 1, 2)); + MantleClientRegistry.registerManualIcon("fletching", new ItemStack(TinkerWeaponry.fletching, 1, 0)); //Tables MantleClientRegistry.registerManualIcon("blankpattern", new ItemStack(TinkerTools.blankPattern, 1, 0)); @@ -456,16 +455,5 @@ void addToolRenderMappings () } } - String[] bowstringTypes = { "string", "magicfabric", "flamestring" }; - for (int bowIter = 0; bowIter < bowstringTypes.length; bowIter++) - { - TConstructClientRegistry.addAlternateMaterialRenderMapping(TinkerTools.shortbow, bowIter, "tinker", bowstringTypes[bowIter], true); - } - - String[] fletching = { "feather", "leaf", "slime", "blueslime" }; - for (int arrowIter = 0; arrowIter < fletching.length; arrowIter++) - { - TConstructClientRegistry.addAlternateMaterialRenderMapping(TinkerTools.arrow, arrowIter, "tinker", fletching[arrowIter], true); - } } } diff --git a/src/main/java/tconstruct/weaponry/TinkerWeaponry.java b/src/main/java/tconstruct/weaponry/TinkerWeaponry.java index 2e9096f8ec4..aa4876f18e4 100644 --- a/src/main/java/tconstruct/weaponry/TinkerWeaponry.java +++ b/src/main/java/tconstruct/weaponry/TinkerWeaponry.java @@ -20,11 +20,13 @@ import tconstruct.library.TConstructRegistry; import tconstruct.library.crafting.*; import tconstruct.library.tools.DynamicToolPart; -import tconstruct.library.tools.ToolCore; +import tconstruct.library.tools.FletchlingLeafMaterial; import tconstruct.library.util.IPattern; import tconstruct.library.util.IToolPart; import tconstruct.smeltery.TinkerSmeltery; import tconstruct.tools.TinkerTools; +import tconstruct.tools.items.Bowstring; +import tconstruct.tools.items.Fletching; import tconstruct.tools.items.Pattern; import tconstruct.weaponry.ammo.ArrowAmmo; import tconstruct.weaponry.ammo.BoltAmmo; @@ -61,6 +63,9 @@ public class TinkerWeaponry { public static AmmoItem boltAmmo; // Tool Parts + public static Item bowstring; + public static DynamicToolPart arrowhead; + public static Item fletching; public static DynamicToolPart partShuriken; public static DynamicToolPart partArrowShaft; // not craftable, used internally public static DynamicToolPart partBowLimb; @@ -69,12 +74,10 @@ public class TinkerWeaponry { public static DualMaterialToolPart partBolt; // patterns/casts - public static Pattern woodPattern; public static Pattern metalPattern; // other stuff - public static TConstructCreativeTab creativeTab = new TConstructCreativeTab("TConstructWeaponry"); public static Random random = new Random(); @@ -91,6 +94,7 @@ public void init(FMLInitializationEvent event) addPartRecipies(); addWeaponRecipies(); registerBoltCasting(); + setupCreativeTab(); } @Handler @@ -105,6 +109,9 @@ public void postInit(FMLPostInitializationEvent event) private void registerItems() { // create tool part + TinkerTools.bowstring = bowstring = new Bowstring().setUnlocalizedName("tconstruct.Bowstring"); + TinkerTools.arrowhead = arrowhead = new DynamicToolPart("_arrowhead", "ArrowHead"); + TinkerTools.fletching = fletching = new Fletching().setUnlocalizedName("tconstruct.Fletching"); partShuriken = new DynamicToolPart("_shuriken", "Shuriken"); partArrowShaft = new DynamicToolPart("_arrow_shaft", "Shaft"); partBowLimb = new DynamicToolPart("_bow_limb", "BowLimb"); @@ -128,6 +135,9 @@ private void registerItems() metalPattern = new WeaponryPattern("cast_", "Cast"); // register tool parts + GameRegistry.registerItem(bowstring, "bowstring"); // 1.8 todo: rename properly + GameRegistry.registerItem(arrowhead, "arrowhead"); + GameRegistry.registerItem(fletching, "fletching"); GameRegistry.registerItem(partShuriken, "ShurikenPart"); GameRegistry.registerItem(partBowLimb, "BowLimbPart"); GameRegistry.registerItem(partCrossbowLimb, "CrossbowLimbPart"); @@ -151,6 +161,11 @@ private void registerItems() private void addPartRecipies() { + + StencilBuilder.registerStencil(TinkerTools.woodPattern, 25); // arrow head + StencilBuilder.registerStencil(TinkerTools.woodPattern, 24); // fletchling + StencilBuilder.registerStencil(TinkerTools.woodPattern, 23); // bowstring + StencilBuilder.registerStencil(woodPattern, 0); StencilBuilder.registerStencil(woodPattern, 1); StencilBuilder.registerStencil(woodPattern, 2); @@ -191,57 +206,52 @@ private void addPartRecipies() private void registerMaterials() { - // todo: un-hax - TConstructRegistry.arrowMaterials.clear(); - TConstructRegistry.bowMaterials.clear(); - - // todo: remove durability from this // Bow Materials: Material ID, durability, drawspeed, arrow speed // speed 3.0 == exactly the vanilla bow if 2 parts of speed 3 are used - // Wooden stuff is flexible, therefore good - TConstructRegistry.addBowMaterial(TinkerTools.MaterialID.Wood, 0, 18, 3.0f); // Wood + // Wooden stuff is flexible, therefore good. Reference. + TConstructRegistry.addBowMaterial(TinkerTools.MaterialID.Wood, 18, 3.0f); // Wood // other organic materials also are good - TConstructRegistry.addBowMaterial(MaterialID.Cactus, 0, 20, 2.4f); // Cactus - TConstructRegistry.addBowMaterial(MaterialID.Bone, 0, 38, 2.0f); // Bone - TConstructRegistry.addBowMaterial(MaterialID.Slime, 0, 28, 4.0f); // Slime - TConstructRegistry.addBowMaterial(MaterialID.BlueSlime, 0, 21, 4.0f); // Blue Slime - TConstructRegistry.addBowMaterial(MaterialID.Paper, 0, 25, 2.3f); // Paper + TConstructRegistry.addBowMaterial(MaterialID.Cactus, 20, 2.4f); // Cactus + TConstructRegistry.addBowMaterial(MaterialID.Bone, 38, 2.0f); // Bone + TConstructRegistry.addBowMaterial(MaterialID.Slime, 28, 4.0f); // Slime + TConstructRegistry.addBowMaterial(MaterialID.BlueSlime, 21, 4.0f); // Blue Slime + TConstructRegistry.addBowMaterial(MaterialID.Paper, 25, 2.3f); // Paper // Metal stuff has a lot of POW, but takes LONG to wind up since it's so hard - TConstructRegistry.addBowMaterial(MaterialID.Iron, 0, 40, 5.2f); // Iron - TConstructRegistry.addBowMaterial(MaterialID.Steel, 0, 50, 5.5f); // Steel - TConstructRegistry.addBowMaterial(MaterialID.PigIron, 0, 30, 5.2f); // Pig Iron - it's meat! - TConstructRegistry.addBowMaterial(MaterialID.Ardite, 0, 50, 4.5f); // Ardite - TConstructRegistry.addBowMaterial(MaterialID.Cobalt, 0, 35, 5.2f); // Cobalt - TConstructRegistry.addBowMaterial(MaterialID.Manyullyn, 0, 45, 4.5f); // Manyullyn - TConstructRegistry.addBowMaterial(MaterialID.Copper, 0, 30, 5.1f); // Copper - TConstructRegistry.addBowMaterial(MaterialID.Bronze, 0, 35, 5.2f); // Bronze - TConstructRegistry.addBowMaterial(MaterialID.Alumite, 0, 35, 4.8f); // Alumite - a bit stone-ish since it has obsidian + TConstructRegistry.addBowMaterial(MaterialID.Iron, 40, 5.2f); // Iron + TConstructRegistry.addBowMaterial(MaterialID.Steel, 50, 5.5f); // Steel + TConstructRegistry.addBowMaterial(MaterialID.PigIron, 30, 5.2f); // Pig Iron - it's meat! + TConstructRegistry.addBowMaterial(MaterialID.Ardite, 50, 4.5f); // Ardite + TConstructRegistry.addBowMaterial(MaterialID.Cobalt, 35, 5.2f); // Cobalt + TConstructRegistry.addBowMaterial(MaterialID.Manyullyn, 45, 4.5f); // Manyullyn + TConstructRegistry.addBowMaterial(MaterialID.Copper, 30, 5.1f); // Copper + TConstructRegistry.addBowMaterial(MaterialID.Bronze, 35, 5.2f); // Bronze + TConstructRegistry.addBowMaterial(MaterialID.Alumite, 35, 4.8f); // Alumite - a bit stone-ish since it has obsidian // Stone doesn't bend. takes forever, has no pow. WHY WOULD YOU DO THAT - TConstructRegistry.addBowMaterial(MaterialID.Stone, 0, 80, 1.0f); // Stone - TConstructRegistry.addBowMaterial(MaterialID.Flint, 0, 80, 1.0f); // Flint - TConstructRegistry.addBowMaterial(MaterialID.Obsidian, 0, 99, 1.0f); // Obsidian - TConstructRegistry.addBowMaterial(MaterialID.Netherrack,0, 70, 1.0f); // Netherrack + TConstructRegistry.addBowMaterial(MaterialID.Stone, 80, 1.0f); // Stone + TConstructRegistry.addBowMaterial(MaterialID.Flint, 80, 1.0f); // Flint + TConstructRegistry.addBowMaterial(MaterialID.Obsidian, 99, 1.0f); // Obsidian + TConstructRegistry.addBowMaterial(MaterialID.Netherrack, 70, 1.0f); // Netherrack // Arrow Head Materials: Material ID, mass, fragility - TConstructRegistry.addArrowMaterial(MaterialID.Wood, 0.69F, 1.0F, 100F); //Wood - TConstructRegistry.addArrowMaterial(MaterialID.Stone, 2.05F, 5.0F, 100F); //Stone - TConstructRegistry.addArrowMaterial(MaterialID.Iron, 3.6F, 0.5F, 100F); //Iron - TConstructRegistry.addArrowMaterial(MaterialID.Flint, 1.325F, 1.0F, 100F); //Flint - TConstructRegistry.addArrowMaterial(MaterialID.Cactus, 0.76F, 1.0F, 100F); //Cactus - TConstructRegistry.addArrowMaterial(MaterialID.Bone, 0.69F, 1.0F, 100F); //Bone - TConstructRegistry.addArrowMaterial(MaterialID.Obsidian, 2.4F, 1.0F, 100F); //Obsidian - TConstructRegistry.addArrowMaterial(MaterialID.Netherrack, 1.5F, 1.0F, 100F); //Netherrack - TConstructRegistry.addArrowMaterial(MaterialID.Slime, 0.22F, 0.0F, 100F); //Slime - TConstructRegistry.addArrowMaterial(MaterialID.Paper, 0.69F, 3.0F, 90F); //Paper - TConstructRegistry.addArrowMaterial(MaterialID.Cobalt, 3.0F, 0.25F, 100F); //Cobalt - TConstructRegistry.addArrowMaterial(MaterialID.Ardite, 1.25F, 0.25F, 100F); //Ardite - TConstructRegistry.addArrowMaterial(MaterialID.Manyullyn, 2.25F, 0.1F, 100F); //Manyullyn - TConstructRegistry.addArrowMaterial(MaterialID.Copper, 2.7F, 0.5F, 100F); //Copper - TConstructRegistry.addArrowMaterial(MaterialID.Bronze, 3.6F, 0.25F, 100F); //Bronze - TConstructRegistry.addArrowMaterial(MaterialID.Alumite, 1.1F, 0.25F, 100F); //Alumite - TConstructRegistry.addArrowMaterial(MaterialID.Steel, 3.6F, 0.25F, 100F); //Steel - TConstructRegistry.addArrowMaterial(MaterialID.BlueSlime, 0.22F, 0.0F, 100F); //Blue Slime - TConstructRegistry.addArrowMaterial(MaterialID.PigIron, 3.6F, 0.5F, 100F); //Pigiron + TConstructRegistry.addArrowMaterial(MaterialID.Wood, 0.69F, 1.0F); //Wood + TConstructRegistry.addArrowMaterial(MaterialID.Stone, 2.05F, 5.0F); //Stone + TConstructRegistry.addArrowMaterial(MaterialID.Iron, 3.6F, 0.5F); //Iron + TConstructRegistry.addArrowMaterial(MaterialID.Flint, 1.325F, 1.0F); //Flint + TConstructRegistry.addArrowMaterial(MaterialID.Cactus, 0.76F, 1.0F); //Cactus + TConstructRegistry.addArrowMaterial(MaterialID.Bone, 0.69F, 1.0F); //Bone + TConstructRegistry.addArrowMaterial(MaterialID.Obsidian, 2.4F, 1.0F); //Obsidian + TConstructRegistry.addArrowMaterial(MaterialID.Netherrack, 1.5F, 1.0F); //Netherrack + TConstructRegistry.addArrowMaterial(MaterialID.Slime, 0.22F, 0.0F); //Slime + TConstructRegistry.addArrowMaterial(MaterialID.Paper, 0.69F, 3.0F); //Paper + TConstructRegistry.addArrowMaterial(MaterialID.Cobalt, 3.0F, 0.25f); //Cobalt + TConstructRegistry.addArrowMaterial(MaterialID.Ardite, 1.25F, 0.25f); //Ardite + TConstructRegistry.addArrowMaterial(MaterialID.Manyullyn, 2.25F, 0.1F); //Manyullyn + TConstructRegistry.addArrowMaterial(MaterialID.Copper, 2.7F, 0.5F); //Copper + TConstructRegistry.addArrowMaterial(MaterialID.Bronze, 3.6F, 0.25f); //Bronze + TConstructRegistry.addArrowMaterial(MaterialID.Alumite, 1.1F, 0.25f); //Alumite + TConstructRegistry.addArrowMaterial(MaterialID.Steel, 3.6F, 0.25f); //Steel + TConstructRegistry.addArrowMaterial(MaterialID.BlueSlime, 0.22F, 0.0F); //Blue Slime + TConstructRegistry.addArrowMaterial(MaterialID.PigIron, 3.6F, 0.5F); //Pigiron // Arrow Shaft Materials: Material ID, crafting item, durability-medifier, mass, fragility TConstructRegistry.addCustomMaterial(ArrowShaftMaterial.createMaterial(0, Items.stick, 1.0f, 1.0f, 0.15f, 0x866526)); // wood: reference material, 10% break chance @@ -252,27 +262,28 @@ private void registerMaterials() TConstructRegistry.addCustomMaterial(ArrowShaftMaterial.createMaterial(0, TinkerTools.toolRod, MaterialID.Wood, 1.0f, 1.0f, 0.15f, 0x866526)); // wood: reference material, 10% break chance TConstructRegistry.addCustomMaterial(ArrowShaftMaterial.createMaterial(1, TinkerTools.toolRod, MaterialID.Bone, 0.95f, 1.2f, 0.01f, 0xede6bf)); // bone: heavier, but durable - // Arrow Fletching Materials: Material ID + // Arrow Fletching Materials + TConstructRegistry.addFletchingMaterial(0, 2, new ItemStack(Items.feather), new ItemStack(TinkerWeaponry.fletching, 1, 0), 100F, 0F, 0.05F, 0xffffff); // Feather + TConstructRegistry.addCustomMaterial(new FletchlingLeafMaterial(1, 2, "treeLeaves", new ItemStack(TinkerWeaponry.fletching, 1, 1), 75F, 0F, 0.2F)); // all vanilla and oredicted leaves. and all leaves in general. + TConstructRegistry.addFletchingMaterial(2, 2, new ItemStack(TinkerTools.materials, 1, 1), new ItemStack(TinkerWeaponry.fletching, 1, 2), 100F, 0F, 0.12F, 0x82c873); // Slime + TConstructRegistry.addFletchingMaterial(3, 2, new ItemStack(TinkerTools.materials, 1, 17), new ItemStack(TinkerWeaponry.fletching, 1, 3), 100F, 0F, 0.12F, 0x74c8c7); // BlueSlime + + // Bowstring Materials + TConstructRegistry.addBowstringMaterial(0, 2, new ItemStack(Items.string), new ItemStack(TinkerWeaponry.bowstring, 1, 0), 1F, 1F, 1f, 0xeeeeee); // String } private void addWeaponRecipies() { TConstructRegistry.addToolRecipe(shuriken, partShuriken, partShuriken, partShuriken, partShuriken); TConstructRegistry.addToolRecipe(throwingknife, TinkerTools.knifeBlade, TinkerTools.toolRod); - TConstructRegistry.addToolRecipe(javelin, TinkerTools.arrowhead, TinkerTools.toughRod, TinkerTools.toughRod); - - // hax - //ToolRecipe recipe = ToolBuilder.instance.recipeList.get(TinkerTools.shortbow); - //ToolBuilder.instance.recipeList.remove(TinkerTools.shortbow); - //ToolBuilder.instance.combos.remove(recipe); + TConstructRegistry.addToolRecipe(javelin, arrowhead, TinkerTools.toughRod, TinkerTools.toughRod); - // todo - TConstructRegistry.addToolRecipe(shortbow, partBowLimb, TinkerTools.bowstring, partBowLimb); - TConstructRegistry.addToolRecipe(longbow, partBowLimb, TinkerTools.bowstring, partBowLimb, TinkerTools.largePlate); - TConstructRegistry.addToolRecipe(crossbow, partCrossbowLimb, partCrossbowBody, TinkerTools.bowstring, TinkerTools.toughBinding); + TConstructRegistry.addToolRecipe(shortbow, partBowLimb, bowstring, partBowLimb); + TConstructRegistry.addToolRecipe(longbow, partBowLimb, bowstring, partBowLimb, TinkerTools.largePlate); + TConstructRegistry.addToolRecipe(crossbow, partCrossbowLimb, partCrossbowBody, bowstring, TinkerTools.toughBinding); - TConstructRegistry.addToolRecipe(arrowAmmo, TinkerTools.arrowhead, partArrowShaft, TinkerTools.fletching); - TConstructRegistry.addToolRecipe(boltAmmo, partBolt, partBolt, TinkerTools.fletching); + TConstructRegistry.addToolRecipe(arrowAmmo, arrowhead, partArrowShaft, fletching); + TConstructRegistry.addToolRecipe(boltAmmo, partBolt, partBolt, fletching); } private void registerBoltCasting() @@ -315,6 +326,7 @@ private void setupCreativeTab() compound.getCompoundTag("InfiTool").setInteger("RenderHead", 0); compound.getCompoundTag("InfiTool").setInteger("RenderHandle", 0); compound.getCompoundTag("InfiTool").setInteger("RenderAccessory", 0); + compound.getCompoundTag("InfiTool").setInteger("RenderExtra", 1); tool.setTagCompound(compound); TConstructRegistry.weaponryTab.init(tool); diff --git a/src/main/java/tconstruct/weaponry/WeaponryClientProxy.java b/src/main/java/tconstruct/weaponry/WeaponryClientProxy.java index 0cbd3c4cfc0..96300393455 100644 --- a/src/main/java/tconstruct/weaponry/WeaponryClientProxy.java +++ b/src/main/java/tconstruct/weaponry/WeaponryClientProxy.java @@ -87,20 +87,13 @@ private void registerMaterialRendering() TinkerWeaponry.boltAmmo.registerAlternatePartPaths(i, new String[]{null, null, null, acctex}); } - // todo: do properly when moving stuff into tinkers code - arrow.headStrings.clear(); - arrow.headStrings.put(TinkerTools.MaterialID.PigIron, Reference.resource(arrow.getDefaultFolder() + "/pigiron" + arrow.getIconSuffix(0))); - /* - TConstructClientRegistry.addAlternateMaterialRenderMapping(TinkerWeaponry.shuriken, 2, Reference.RESOURCE, "iron", true); - TConstructClientRegistry.addAlternateMaterialRenderMapping(TinkerWeaponry.throwingknife, 2, Reference.RESOURCE, "iron", true); - - String[] fletching = { "feather", "leaf", "slime", "blueslime" }; - for (int arrowIter = 0; arrowIter < fletching.length; arrowIter++) + // bowstring + String[] bowstringTypes = { "string", "magicfabric", "flamestring" }; + for (int bowIter = 0; bowIter < bowstringTypes.length; bowIter++) { - TConstructClientRegistry.addAlternateMaterialRenderMapping(TinkerWeaponry.throwArrow, arrowIter, "tinker", fletching[arrowIter], true); + TConstructClientRegistry.addAlternateMaterialRenderMapping(TinkerWeaponry.shortbow, bowIter, Reference.RESOURCE, bowstringTypes[bowIter], true); } - */ } private void buttons() diff --git a/src/main/java/tconstruct/weaponry/ammo/ArrowAmmo.java b/src/main/java/tconstruct/weaponry/ammo/ArrowAmmo.java index aae00f51946..04b4343760b 100644 --- a/src/main/java/tconstruct/weaponry/ammo/ArrowAmmo.java +++ b/src/main/java/tconstruct/weaponry/ammo/ArrowAmmo.java @@ -3,7 +3,6 @@ import tconstruct.TConstruct; import tconstruct.weaponry.TinkerWeaponry; import tconstruct.library.weaponry.AmmoItem; -import tconstruct.util.Reference; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -65,7 +64,7 @@ public void registerAlternatePartPaths (int index, String[] location) @Override public Item getHeadItem () { - return TinkerTools.arrowhead; + return TinkerWeaponry.arrowhead; } @Override @@ -76,7 +75,7 @@ public Item getHandleItem() { @Override public Item getAccessoryItem () { - return TinkerTools.fletching; + return TinkerWeaponry.fletching; } @Override diff --git a/src/main/java/tconstruct/weaponry/ammo/BoltAmmo.java b/src/main/java/tconstruct/weaponry/ammo/BoltAmmo.java index 297d4e7e454..5e3c4fb8bc6 100644 --- a/src/main/java/tconstruct/weaponry/ammo/BoltAmmo.java +++ b/src/main/java/tconstruct/weaponry/ammo/BoltAmmo.java @@ -6,7 +6,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import tconstruct.library.crafting.ToolBuilder; -import tconstruct.tools.TinkerTools; import java.util.List; @@ -67,7 +66,7 @@ public Item getHandleItem() { @Override public Item getAccessoryItem() { - return TinkerTools.fletching; + return TinkerWeaponry.fletching; } @Override diff --git a/src/main/java/tconstruct/weaponry/weapons/Crossbow.java b/src/main/java/tconstruct/weaponry/weapons/Crossbow.java index c5bfaf2e822..3c40692c05e 100644 --- a/src/main/java/tconstruct/weaponry/weapons/Crossbow.java +++ b/src/main/java/tconstruct/weaponry/weapons/Crossbow.java @@ -392,7 +392,7 @@ public Item getHandleItem () @Override public Item getAccessoryItem () { - return TinkerTools.bowstring; + return TinkerWeaponry.bowstring; } @Override diff --git a/src/main/java/tconstruct/weaponry/weapons/Javelin.java b/src/main/java/tconstruct/weaponry/weapons/Javelin.java index 7b9ef448d96..20f01b50fdb 100644 --- a/src/main/java/tconstruct/weaponry/weapons/Javelin.java +++ b/src/main/java/tconstruct/weaponry/weapons/Javelin.java @@ -1,5 +1,6 @@ package tconstruct.weaponry.weapons; +import tconstruct.weaponry.TinkerWeaponry; import tconstruct.weaponry.entity.JavelinEntity; import tconstruct.library.weaponry.AmmoWeapon; import net.minecraft.entity.Entity; @@ -146,7 +147,7 @@ public float getAmmoModifier() { @Override public Item getHeadItem() { - return TinkerTools.arrowhead; + return TinkerWeaponry.arrowhead; } @Override diff --git a/src/main/java/tconstruct/weaponry/weapons/LongBow.java b/src/main/java/tconstruct/weaponry/weapons/LongBow.java index 88ef29e5ea6..f46fac06db4 100644 --- a/src/main/java/tconstruct/weaponry/weapons/LongBow.java +++ b/src/main/java/tconstruct/weaponry/weapons/LongBow.java @@ -110,7 +110,7 @@ public Item getHeadItem () @Override public Item getHandleItem () { - return TinkerTools.bowstring; + return TinkerWeaponry.bowstring; } @Override diff --git a/src/main/java/tconstruct/weaponry/weapons/ShortBow.java b/src/main/java/tconstruct/weaponry/weapons/ShortBow.java index fa5a61d44ff..44405f17a7e 100644 --- a/src/main/java/tconstruct/weaponry/weapons/ShortBow.java +++ b/src/main/java/tconstruct/weaponry/weapons/ShortBow.java @@ -9,7 +9,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; -import tconstruct.tools.TinkerTools; public class ShortBow extends BowBaseAmmo { public ShortBow() { @@ -98,7 +97,7 @@ public Item getHeadItem () @Override public Item getHandleItem () { - return TinkerTools.bowstring; + return TinkerWeaponry.bowstring; } @Override