From c25ddf063a808e3adb749e22017661f403c5fb7e Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 17 Nov 2016 12:41:03 +1100 Subject: Update to Minecraft 1.11 --- nms-patches/EntitySkeleton.patch | 84 ++++------------------------------------ 1 file changed, 7 insertions(+), 77 deletions(-) (limited to 'nms-patches/EntitySkeleton.patch') diff --git a/nms-patches/EntitySkeleton.patch b/nms-patches/EntitySkeleton.patch index 2d866566..18243710 100644 --- a/nms-patches/EntitySkeleton.patch +++ b/nms-patches/EntitySkeleton.patch @@ -1,89 +1,19 @@ --- a/net/minecraft/server/EntitySkeleton.java +++ b/net/minecraft/server/EntitySkeleton.java -@@ -2,13 +2,14 @@ - - import java.util.Calendar; - import javax.annotation.Nullable; -+import org.bukkit.event.entity.EntityCombustEvent; // CraftBukkit - - public class EntitySkeleton extends EntityMonster implements IRangedEntity { - - private static final DataWatcherObject a = DataWatcher.a(EntitySkeleton.class, DataWatcherRegistry.b); - private static final DataWatcherObject b = DataWatcher.a(EntitySkeleton.class, DataWatcherRegistry.h); - private final PathfinderGoalBowShoot c = new PathfinderGoalBowShoot(this, 1.0D, 20, 15.0F); -- private final PathfinderGoalMeleeAttack bx = new PathfinderGoalMeleeAttack(this, 1.2D, flag) { -+ private final PathfinderGoalMeleeAttack bx = new PathfinderGoalMeleeAttack(this, 1.2D, false) { // CraftBukkit decompile error flag -> false - public void d() { - super.d(); - EntitySkeleton.this.a(false); -@@ -105,7 +106,14 @@ - } - - if (flag) { -- this.setOnFire(8); -+ // CraftBukkit start -+ EntityCombustEvent event = new EntityCombustEvent(this.getBukkitEntity(), 8); -+ this.world.getServer().getPluginManager().callEvent(event); -+ -+ if (!event.isCancelled()) { -+ this.setOnFire(event.getDuration()); -+ } -+ // CraftBukkit end - } - } - } -@@ -128,7 +136,7 @@ +@@ -34,7 +34,7 @@ } public void die(DamageSource damagesource) { - super.die(damagesource); + // super.die(damagesource); // CraftBukkit - if (damagesource.i() instanceof EntityArrow && damagesource.getEntity() instanceof EntityHuman) { - EntityHuman entityhuman = (EntityHuman) damagesource.getEntity(); - double d0 = entityhuman.locX - this.locX; -@@ -141,6 +149,7 @@ - ((EntityCreeper) damagesource.getEntity()).setCausedHeadDrop(); - this.a(new ItemStack(Items.SKULL, 1, this.getSkeletonType() == EnumSkeletonType.WITHER ? 1 : 0), 0.0F); - } -+ super.die(damagesource); // CraftBukkit - moved from above + if (damagesource.getEntity() instanceof EntityCreeper) { + EntityCreeper entitycreeper = (EntityCreeper) damagesource.getEntity(); - } - -@@ -234,7 +243,14 @@ - - flag = flag || EnchantmentManager.a(Enchantments.ARROW_FIRE, (EntityLiving) this) > 0; - if (flag) { -- entitytippedarrow.setOnFire(100); -+ // CraftBukkit start - call EntityCombustEvent -+ EntityCombustEvent event = new EntityCombustEvent(entitytippedarrow.getBukkitEntity(), 100); -+ this.world.getServer().getPluginManager().callEvent(event); -+ -+ if (!event.isCancelled()) { -+ entitytippedarrow.setOnFire(event.getDuration()); -+ } -+ // CraftBukkit end - } - - ItemStack itemstack = this.b(EnumHand.OFF_HAND); -@@ -245,8 +261,20 @@ - entitytippedarrow.a(new MobEffect(MobEffects.SLOWER_MOVEMENT, 600)); +@@ -43,6 +43,7 @@ + this.a(new ItemStack(Items.SKULL, 1, 0), 0.0F); + } } ++ super.die(damagesource); // CraftBukkit - moved from above -+ // CraftBukkit start -+ org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getItemInMainHand(), entitytippedarrow, 0.8F); -+ if (event.isCancelled()) { -+ event.getProjectile().remove(); -+ return; -+ } -+ -+ if (event.getProjectile() == entitytippedarrow.getBukkitEntity()) { -+ world.addEntity(entitytippedarrow); -+ } -+ // CraftBukkit end -+ - this.a(SoundEffects.fz, 1.0F, 1.0F / (this.getRandom().nextFloat() * 0.4F + 0.8F)); -- this.world.addEntity(entitytippedarrow); -+ // this.world.addEntity(entitytippedarrow); // CraftBukkit - moved up } - public EnumSkeletonType getSkeletonType() { -- cgit v1.2.3