diff --git a/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/EntityUpdateCommand.java b/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/EntityUpdateCommand.java index f7ccb656e..40f7ce2b8 100644 --- a/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/EntityUpdateCommand.java +++ b/Movecraft/src/main/java/net/countercraft/movecraft/mapUpdater/update/EntityUpdateCommand.java @@ -86,15 +86,18 @@ public void doUpdate() { Location location = entity.getLocation().add(x, y, z); location.setYaw(location.getYaw() + yaw); location.setPitch(location.getPitch() + pitch); + location.setWorld(world); + if (sound != null) { + ((Player) entity).playSound(location, sound, volume, 1.0f); + } + // Use bukkit teleporting API for changing worlds because it won't be smooth anyway if (!(entity instanceof Player) || !entity.getLocation().getWorld().equals(world)) { - entity.teleport(new Location(world, x, y, z, yaw, pitch)); + entity.teleport(location); return; } + Movecraft.getInstance().getSmoothTeleport().teleport((Player) entity, location); - if (sound != null) { - ((Player) entity).playSound(location, sound, volume, 1.0f); - } } @Override