Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
1package net.minecraft.server;
2
3import com.legacyminecraft.poseidon.PoseidonConfig;
4
5public class ItemBow extends Item {
6
7 public ItemBow(int i) {
8 super(i);
9 this.maxStackSize = 1;
10 }
11
12 public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) {
13 if (entityhuman.inventory.b(Item.ARROW.id)) {
14
15 world.makeSound(entityhuman, "random.bow", 1.0F, 1.0F / (b.nextFloat() * 0.4F + 0.8F));
16 if ((boolean) PoseidonConfig.getInstance().getProperty("world.settings.skeleton-shooting-sound-fix.enabled")) {
17 world.a(entityhuman, 1002, MathHelper.floor(entityhuman.locX), MathHelper.floor(entityhuman.locY - (double) entityhuman.height), MathHelper.floor(entityhuman.locZ), 0); // Poseidon - fix player bow sounds (Strultz)
18 }
19
20 if (!world.isStatic) {
21 EntityArrow entityarrow = new EntityArrow(world, entityhuman);
22 world.addEntity(entityarrow);
23 }
24 }
25
26 return itemstack;
27 }
28}