forked from xjboss/KCauldronX
34 lines
1.2 KiB
Diff
34 lines
1.2 KiB
Diff
|
--- ../src-base/minecraft/net/minecraft/item/ItemBow.java
|
||
|
+++ ../src-work/minecraft/net/minecraft/item/ItemBow.java
|
||
|
@@ -84,6 +84,21 @@
|
||
|
entityarrow.setFire(100);
|
||
|
}
|
||
|
|
||
|
+ // CraftBukkit start
|
||
|
+ org.bukkit.event.entity.EntityShootBowEvent cbEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(p_77615_3_, p_77615_1_, entityarrow, f);
|
||
|
+
|
||
|
+ if (cbEvent.isCancelled())
|
||
|
+ {
|
||
|
+ cbEvent.getProjectile().remove();
|
||
|
+ return;
|
||
|
+ }
|
||
|
+
|
||
|
+ if (cbEvent.getProjectile() == entityarrow.getBukkitEntity())
|
||
|
+ {
|
||
|
+ p_77615_2_.spawnEntityInWorld(entityarrow);
|
||
|
+ }
|
||
|
+
|
||
|
+ // CraftBukkit end
|
||
|
p_77615_1_.damageItem(1, p_77615_3_);
|
||
|
p_77615_2_.playSoundAtEntity(p_77615_3_, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
|
||
|
|
||
|
@@ -98,7 +113,7 @@
|
||
|
|
||
|
if (!p_77615_2_.isRemote)
|
||
|
{
|
||
|
- p_77615_2_.spawnEntityInWorld(entityarrow);
|
||
|
+ // p_77615_2_.spawnEntityInWorld(entityarrow); // CraftBukkit - moved up
|
||
|
}
|
||
|
}
|
||
|
}
|