Skip to content

Commit

Permalink
Make shuriken and ammoweapon/throwing knifes not throwable without ammo
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Oct 30, 2014
1 parent 9d7d33f commit 3f74dd7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/tconstruct/library/weaponry/AmmoWeapon.java
Expand Up @@ -31,7 +31,8 @@ public int getMaxItemUseDuration(ItemStack par1ItemStack) {
@Override
public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player)
{
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
if(getAmmoCount(stack) > 0)
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
return stack;
}

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/tconstruct/weaponry/weapons/Shuriken.java
Expand Up @@ -101,6 +101,9 @@ public float getWindupProgress(ItemStack itemStack, EntityPlayer player) {

@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if(getAmmoCount(stack) <= 0)
return stack;

launchProjectile(stack, world, player);

// this is only used for the animation
Expand Down

0 comments on commit 3f74dd7

Please sign in to comment.