From 2683195ecdd4ed3b35edd4e26cd3d4b6ba06d16c Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 14 Feb 2017 10:34:56 +1100 Subject: [PATCH] SPIGOT-3063: Call EntityAirChangeEvent --- nms-patches/Entity.patch | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/nms-patches/Entity.patch b/nms-patches/Entity.patch index 79aa39c020..a947ff7438 100644 --- a/nms-patches/Entity.patch +++ b/nms-patches/Entity.patch @@ -426,13 +426,14 @@ this.passengers.remove(entity); entity.j = 60; } -@@ -1715,14 +1975,48 @@ +@@ -1715,14 +1975,49 @@ } public void setAirTicks(int i) { - this.datawatcher.set(Entity.az, Integer.valueOf(i)); + // CraftBukkit start + EntityAirChangeEvent event = new EntityAirChangeEvent(this.getBukkitEntity(), i); ++ event.getEntity().getServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return; + } @@ -478,7 +479,7 @@ } } -@@ -1867,19 +2161,70 @@ +@@ -1867,19 +2162,70 @@ if (!this.world.isClientSide && !this.dead) { this.world.methodProfiler.a("changeDimension"); MinecraftServer minecraftserver = this.B_(); @@ -552,7 +553,7 @@ BlockPosition blockposition; if (i == 1) { -@@ -1908,12 +2253,18 @@ +@@ -1908,12 +2254,18 @@ blockposition = new BlockPosition(this); } @@ -572,7 +573,7 @@ if (j == 1 && i == 1) { BlockPosition blockposition1 = worldserver1.q(worldserver1.getSpawn()); -@@ -1921,6 +2272,7 @@ +@@ -1921,6 +2273,7 @@ } else { entity.setPositionRotation(blockposition, entity.yaw, entity.pitch); } @@ -580,7 +581,7 @@ boolean flag = entity.attachedToPlayer; -@@ -1928,13 +2280,21 @@ +@@ -1928,13 +2281,21 @@ worldserver1.addEntity(entity); entity.attachedToPlayer = flag; worldserver1.entityJoinedWorld(entity, false); @@ -603,7 +604,7 @@ return entity; } else { return null; -@@ -2038,6 +2398,11 @@ +@@ -2038,6 +2399,11 @@ } public void setCustomName(String s) { @@ -615,7 +616,7 @@ this.datawatcher.set(Entity.aA, s); } -@@ -2095,7 +2460,26 @@ +@@ -2095,7 +2461,26 @@ } public void a(AxisAlignedBB axisalignedbb) { @@ -643,7 +644,7 @@ } public float getHeadHeight() { -@@ -2269,7 +2653,7 @@ +@@ -2269,7 +2654,7 @@ for (Iterator iterator = this.bx().iterator(); iterator.hasNext(); entity.a(oclass, set)) { entity = (Entity) iterator.next(); if (oclass.isAssignableFrom(entity.getClass())) {