2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/ItemBow.java
|
|
|
|
+++ b/net/minecraft/server/ItemBow.java
|
2020-08-31 10:39:12 +02:00
|
|
|
@@ -50,6 +50,14 @@
|
2016-02-29 22:32:46 +01:00
|
|
|
if (EnchantmentManager.getEnchantmentLevel(Enchantments.ARROW_FIRE, itemstack) > 0) {
|
2019-01-09 10:38:37 +01:00
|
|
|
entityarrow.setOnFire(100);
|
|
|
|
}
|
2016-02-29 22:32:46 +01:00
|
|
|
+ // CraftBukkit start
|
2020-08-31 10:39:12 +02:00
|
|
|
+ org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(entityhuman, itemstack, itemstack1, entityarrow, entityhuman.getRaisedHand(), f, !flag1);
|
2016-02-29 22:32:46 +01:00
|
|
|
+ if (event.isCancelled()) {
|
|
|
|
+ event.getProjectile().remove();
|
|
|
|
+ return;
|
2019-01-09 10:38:37 +01:00
|
|
|
+ }
|
2020-08-31 10:39:12 +02:00
|
|
|
+ flag1 = !event.shouldConsumeItem();
|
2019-01-09 10:38:37 +01:00
|
|
|
+ // CraftBukkit end
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
itemstack.damage(1, entityhuman, (entityhuman1) -> {
|
2020-01-21 22:00:00 +01:00
|
|
|
entityhuman1.broadcastItemBreak(entityhuman.getRaisedHand());
|
2020-08-31 10:39:12 +02:00
|
|
|
@@ -58,7 +66,16 @@
|
2016-02-29 22:32:46 +01:00
|
|
|
entityarrow.fromPlayer = EntityArrow.PickupStatus.CREATIVE_ONLY;
|
|
|
|
}
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2016-02-29 22:32:46 +01:00
|
|
|
- world.addEntity(entityarrow);
|
2019-01-09 10:38:37 +01:00
|
|
|
+ // CraftBukkit start
|
2016-02-29 22:32:46 +01:00
|
|
|
+ if (event.getProjectile() == entityarrow.getBukkitEntity()) {
|
2016-03-19 01:13:15 +01:00
|
|
|
+ if (!world.addEntity(entityarrow)) {
|
|
|
|
+ if (entityhuman instanceof EntityPlayer) {
|
|
|
|
+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory();
|
|
|
|
+ }
|
|
|
|
+ return;
|
|
|
|
+ }
|
2016-02-29 22:32:46 +01:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
}
|
2014-11-25 22:32:16 +01:00
|
|
|
|
2020-06-25 02:00:00 +02:00
|
|
|
world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F / (ItemBow.RANDOM.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
|