SPIGOT-3864: Protect against suffocation on world change

This commit is contained in:
md_5 2018-03-22 21:05:34 +11:00
parent 7e94e65a1c
commit 29705a0d4f

View File

@ -621,7 +621,7 @@
+ exitWorld.getTravelAgent().adjustExit(entityplayer, exit, velocity); + exitWorld.getTravelAgent().adjustExit(entityplayer, exit, velocity);
+ +
+ entityplayer.worldChangeInvuln = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds + entityplayer.worldChangeInvuln = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds
+ this.moveToWorld(entityplayer, exitWorld.dimension, true, exit, false); // Vanilla doesn't check for suffocation when handling portals, so neither should we + this.moveToWorld(entityplayer, exitWorld.dimension, true, exit, true); // SPIGOT-3864
+ if (entityplayer.motX != velocity.getX() || entityplayer.motY != velocity.getY() || entityplayer.motZ != velocity.getZ()) { + if (entityplayer.motX != velocity.getX() || entityplayer.motY != velocity.getY() || entityplayer.motZ != velocity.getZ()) {
+ entityplayer.getBukkitEntity().setVelocity(velocity); + entityplayer.getBukkitEntity().setVelocity(velocity);
+ } + }