diff --git a/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/REntity.java b/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/REntity.java index 5035e30f..ba849b29 100644 --- a/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/REntity.java +++ b/SpigotCore/SpigotCore_Main/src/de/steamwar/entity/REntity.java @@ -180,7 +180,7 @@ public class REntity { } public void setVelocity(double dX, double dY, double dZ) { - server.updateEntity(this, new ClientboundSetEntityMotionPacket(entityId, new Vec3(calcVelocity(dX), calcVelocity(dY), calcVelocity(dZ)))); + server.updateEntity(this, new ClientboundSetEntityMotionPacket(entityId, new Vec3(dX, dY, dZ))); } public void showDamage() { @@ -340,8 +340,8 @@ public class REntity { } private Object getTeleportPacket() { - PositionMoveRotation rot = new PositionMoveRotation(new Vec3(x, y, z), Vec3.ZERO, pitch, yaw); - return new ClientboundTeleportEntityPacket(entityId, rot, Collections.emptySet(), false); + PositionMoveRotation rot = new PositionMoveRotation(new Vec3(x, y, z), Vec3.ZERO, pitch * 360F / 256F, yaw * 360F / 256F); + return new ClientboundEntityPositionSyncPacket(entityId, rot, false); } private Object getMoveLookPacket(double diffX, double diffY, double diffZ, boolean rotEq) { @@ -387,10 +387,6 @@ public class REntity { return (byte) ((int) (rot * 256.0F / 360.0F)); } - private int calcVelocity(double value) { - return (int) (Math.max(-3.9, Math.min(value, 3.9)) * 8000); - } - private static Optional formatDisplayName(String displayName) { return displayName != null ? Optional.of(MutableComponent.create(PlainTextContents.create(displayName))) : Optional.empty(); }