Commits
md_5 authored b15abb12cb5
301 301 | |
302 302 | if (entity.isVehicle() || entity.dead) { |
303 303 | return false; |
304 304 | } |
305 305 | |
306 306 | // If this entity is riding another entity, we must dismount before teleporting. |
307 307 | entity.stopRiding(); |
308 308 | |
309 309 | // Let the server handle cross world teleports |
310 310 | if (!location.getWorld().equals(getWorld())) { |
311 - | entity.teleportTo(location, cause == TeleportCause.NETHER_PORTAL); |
311 + | entity.teleportTo(location, false); |
312 312 | return true; |
313 313 | } |
314 314 | |
315 315 | // entity.setLocation() throws no event, and so cannot be cancelled |
316 316 | entity.setLocation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); |
317 317 | // SPIGOT-619: Force sync head rotation also |
318 318 | entity.setHeadRotation(location.getYaw()); |
319 319 | |
320 320 | return true; |
321 321 | } |