Skip to content

Commit

Permalink
Sounds for crossbow/arrow break!
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Oct 5, 2014
1 parent ef0ae61 commit 2370b0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/java/tconstruct/weaponry/entity/ArrowEntity.java
Expand Up @@ -49,8 +49,10 @@ public void onHitBlock(MovingObjectPosition movingobjectposition) {

// we might break! oh noez!
float chance = returnStack.getTagCompound().getCompoundTag("InfiTool").getFloat("BreakChance");
if(chance > TConstruct.random.nextFloat())
if(chance > TConstruct.random.nextFloat()) {
this.setDead();
this.playSound("random.break", 1.0F, 1.5F / (this.rand.nextFloat() * 0.2F + 0.9F));
}
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/weaponry/weapons/Crossbow.java
Expand Up @@ -296,7 +296,7 @@ public void playReloadSound(World world, EntityPlayer player, ItemStack weapon,

@Override
public void playFiringSound(World world, EntityPlayer player, ItemStack weapon, ItemStack ammo, float speed, float accuracy) {
// todo: THWOCK
world.playSoundAtEntity(player, "random.bow", 1.0F, 0.5F);
}

@Override
Expand Down

0 comments on commit 2370b0c

Please sign in to comment.