Fix Projectile Weapons and arrows/bolts building creative items with materials that have no bow/arrow material stats

This commit is contained in:
Bernhard Bonigl committed 2014-10-30 22:34:56 +01:00
1 parent 3f74dd7535
commit eb1a6701de
4 files changed
+17

No files matched your search

@@ -1,5 +1,6 @@
package tconstruct.weaponry.weapons;
import tconstruct.library.TConstructRegistry;
import tconstruct.weaponry.TinkerWeaponry;
import tconstruct.weaponry.ammo.BoltAmmo;
import tconstruct.weaponry.entity.BoltEntity;
@@ -415,6 +416,10 @@ public class Crossbow extends ProjectileWeapon {
@Override
public void buildTool (int id, String name, List list)
{
// does the material have a bow material?
if(TConstructRegistry.getBowMaterial(id) == null)
return;
// all creative bows use regular bowstring
ItemStack headStack = new ItemStack(getHeadItem(), 1, id);
ItemStack handleStack = new ItemStack(getHandleItem(), 1, id);