From 20093440583af0b3d871be6732fe54fb9629b004 Mon Sep 17 00:00:00 2001 From: sk89q Date: Fri, 20 Feb 2015 21:23:54 -0800 Subject: [PATCH] Fix entity rotation. --- .../sk89q/worldedit/function/entity/ExtentEntityCopy.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java index dde39bc01..134e10bd9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/entity/ExtentEntityCopy.java @@ -92,9 +92,10 @@ public class ExtentEntityCopy implements EntityFunction { if (!transform.isIdentity()) { Location location = entity.getLocation(); - Vector newPosition = transform.apply(location.toVector().subtract(from)); + Vector pivot = from.round().add(0.5, 0.5, 0.5); + Vector newPosition = transform.apply(location.toVector().subtract(pivot)); Vector newDirection = transform.apply(location.getDirection()).subtract(transform.apply(Vector.ZERO)).normalize(); - newLocation = new Location(destination, newPosition.add(to), newDirection); + newLocation = new Location(destination, newPosition.add(to.round().add(0.5, 0.5, 0.5)), newDirection); // Some entities store their position data in NBT state = transformNbtData(state);