Skip to content

Commit

Permalink
Fix crossbow checking body instead of string for enchanted bowstring #…
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Dec 21, 2014
1 parent 86b2bc0 commit 782d1e5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/tconstruct/weaponry/WeaponryHandler.java
Expand Up @@ -141,6 +141,8 @@ public void onProjectileWeaponCrafted(ToolCraftEvent.NormalTool event)
BowMaterial bottom;
BowstringMaterial string;

boolean enchanted = false;

if(event.tool instanceof BowBaseAmmo) {
top = TConstructRegistry.getBowMaterial(tags.getInteger("Head"));
bottom = TConstructRegistry.getBowMaterial(tags.getInteger("Accessory"));
Expand All @@ -158,6 +160,9 @@ public void onProjectileWeaponCrafted(ToolCraftEvent.NormalTool event)
drawSpeed *= 1.8f;
flightSpeed *= 1.5f;
}

// enchanted bowstring
enchanted = tags.getInteger("Handle") == 1;
}
else if(event.tool instanceof Crossbow)
{
Expand All @@ -173,12 +178,15 @@ else if(event.tool instanceof Crossbow)

// crossbows are stronk
flightSpeed *= 1.5;

// enchanted bowstring
enchanted = tags.getInteger("Accessory") == 1;
}
else
return;

// enchanted fabric
if (tags.getInteger("Handle") == 1) {
if (enchanted) {
int modifiers = tags.getInteger("Modifiers");
modifiers += 1;
tags.setInteger("Modifiers", modifiers);
Expand Down

0 comments on commit 782d1e5

Please sign in to comment.