diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/monster/AbstractSkeleton.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/monster/AbstractSkeleton.java.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/monster/AbstractSkeleton.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/monster/AbstractSkeleton.java.patch new file mode 100644 index 0000000000..cd9b888c27 --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/monster/AbstractSkeleton.java.patch @@ -0,0 +1,28 @@ +--- a/net/minecraft/world/entity/monster/AbstractSkeleton.java ++++ b/net/minecraft/world/entity/monster/AbstractSkeleton.java +@@ -186,10 +197,22 @@ + double d = target.getX() - this.getX(); + double d1 = target.getY(0.3333333333333333) - arrow.getY(); + double d2 = target.getZ() - this.getZ(); +- double squareRoot = Math.sqrt(d * d + d2 * d2); +- arrow.shoot(d, d1 + squareRoot * 0.2F, d2, 1.6F, (float)(14 - this.level().getDifficulty().getId() * 4)); ++ double d3 = Math.sqrt(d0 * d0 + d2 * d2); ++ ++ entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level().getDifficulty().getId() * 4)); ++ // CraftBukkit start ++ 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); ++ if (event.isCancelled()) { ++ event.getProjectile().remove(); ++ return; ++ } ++ ++ if (event.getProjectile() == entityarrow.getBukkitEntity()) { ++ this.level().addFreshEntity(entityarrow); ++ } ++ // CraftBukkit end + this.playSound(SoundEvents.SKELETON_SHOOT, 1.0F, 1.0F / (this.getRandom().nextFloat() * 0.4F + 0.8F)); +- this.level().addFreshEntity(arrow); ++ // this.level().addFreshEntity(entityarrow); // CraftBukkit - moved up + } + + protected AbstractArrow getArrow(ItemStack arrowStack, float velocity) { |