2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java
|
|
|
|
+++ b/net/minecraft/world/entity/monster/EntitySkeletonAbstract.java
|
2024-06-13 17:05:00 +02:00
|
|
|
@@ -204,8 +204,19 @@
|
2021-06-11 07:00:00 +02:00
|
|
|
double d3 = Math.sqrt(d0 * d0 + d2 * d2);
|
2016-11-17 02:41:03 +01:00
|
|
|
|
2023-06-07 17:30:00 +02:00
|
|
|
entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level().getDifficulty().getId() * 4));
|
2016-11-17 02:41:03 +01:00
|
|
|
+ // CraftBukkit start
|
2021-11-21 23:00:00 +01:00
|
|
|
+ org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getMainHandItem(), null, entityarrow, net.minecraft.world.EnumHand.MAIN_HAND, 0.8F, true);
|
2016-11-17 02:41:03 +01:00
|
|
|
+ if (event.isCancelled()) {
|
|
|
|
+ event.getProjectile().remove();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (event.getProjectile() == entityarrow.getBukkitEntity()) {
|
2023-06-07 17:30:00 +02:00
|
|
|
+ this.level().addFreshEntity(entityarrow);
|
2016-11-17 02:41:03 +01:00
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2021-06-11 07:00:00 +02:00
|
|
|
this.playSound(SoundEffects.SKELETON_SHOOT, 1.0F, 1.0F / (this.getRandom().nextFloat() * 0.4F + 0.8F));
|
2023-06-07 17:30:00 +02:00
|
|
|
- this.level().addFreshEntity(entityarrow);
|
|
|
|
+ // this.level().addFreshEntity(entityarrow); // CraftBukkit - moved up
|
2016-11-17 02:41:03 +01:00
|
|
|
}
|
|
|
|
|
2024-06-13 17:05:00 +02:00
|
|
|
protected EntityArrow getArrow(ItemStack itemstack, float f, @Nullable ItemStack itemstack1) {
|