summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-07-15 16:17:35 +1000
committermd_5 <git@md-5.net>2018-07-15 16:17:35 +1000
commitfe7db9d53b7ccaf5be93a64ec1a89b2e3af6a0f7 (patch)
treee9e60eb7c63c43ed22cb180d0c9537a5f2cb6845 /nms-patches
parent72cf620d474ca21b5369b61136e286101f2f635a (diff)
downloadcraftbukkit-fe7db9d53b7ccaf5be93a64ec1a89b2e3af6a0f7.tar
craftbukkit-fe7db9d53b7ccaf5be93a64ec1a89b2e3af6a0f7.tar.gz
craftbukkit-fe7db9d53b7ccaf5be93a64ec1a89b2e3af6a0f7.tar.lz
craftbukkit-fe7db9d53b7ccaf5be93a64ec1a89b2e3af6a0f7.tar.xz
craftbukkit-fe7db9d53b7ccaf5be93a64ec1a89b2e3af6a0f7.zip
Add EntityToggleSwimEvent and isSwimming / setSwimming API
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/Entity.patch26
1 files changed, 20 insertions, 6 deletions
diff --git a/nms-patches/Entity.patch b/nms-patches/Entity.patch
index b7bc2f61..567ef8b0 100644
--- a/nms-patches/Entity.patch
+++ b/nms-patches/Entity.patch
@@ -497,7 +497,21 @@
this.passengers.remove(entity);
entity.k = 60;
}
-@@ -1859,14 +2178,49 @@
+@@ -1799,6 +2118,13 @@
+ }
+
+ public void g(boolean flag) {
++ // CraftBukkit start
++ if (this.bb() != flag && this instanceof EntityLiving) {
++ if (CraftEventFactory.callToggleSwimEvent((EntityLiving) this, flag).isCancelled()) {
++ return;
++ }
++ }
++ // CraftBukkit end
+ this.setFlag(4, flag);
+ }
+
+@@ -1859,14 +2185,49 @@
}
public void setAirTicks(int i) {
@@ -550,7 +564,7 @@
}
}
-@@ -2035,19 +2389,76 @@
+@@ -2035,19 +2396,76 @@
if (!this.world.isClientSide && !this.dead) {
this.world.methodProfiler.a("changeDimension");
MinecraftServer minecraftserver = this.bK();
@@ -630,7 +644,7 @@
BlockPosition blockposition;
if (i == 1) {
-@@ -2076,12 +2487,18 @@
+@@ -2076,12 +2494,18 @@
blockposition = new BlockPosition(this);
}
@@ -650,7 +664,7 @@
if (j == 1 && i == 1) {
BlockPosition blockposition1 = worldserver1.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver1.getSpawn());
-@@ -2089,6 +2506,7 @@
+@@ -2089,6 +2513,7 @@
} else {
entity.setPositionRotation(blockposition, entity.yaw, entity.pitch);
}
@@ -658,7 +672,7 @@
boolean flag = entity.attachedToPlayer;
-@@ -2096,13 +2514,21 @@
+@@ -2096,13 +2521,21 @@
worldserver1.addEntity(entity);
entity.attachedToPlayer = flag;
worldserver1.entityJoinedWorld(entity, false);
@@ -681,7 +695,7 @@
return entity;
} else {
return null;
-@@ -2242,7 +2668,26 @@
+@@ -2242,7 +2675,26 @@
}
public void a(AxisAlignedBB axisalignedbb) {