From 89c0a2cd2fa665c4d861744234c19e81973d6dca Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 8 Sep 2017 09:37:21 +1000 Subject: [PATCH] Fixes #727 --- .../java/com/sk89q/worldedit/command/ClipboardCommands.java | 4 ++-- .../com/sk89q/worldedit/math/transform/AffineTransform.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java b/core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java index 29d2b2a4..d328d72e 100644 --- a/core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java +++ b/core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java @@ -474,7 +474,7 @@ public class ClipboardCommands extends MethodCommands { transform = transform.rotateY(-(yRotate != null ? yRotate : 0)); transform = transform.rotateX(-(xRotate != null ? xRotate : 0)); transform = transform.rotateZ(-(zRotate != null ? zRotate : 0)); - holder.setTransform(holder.getTransform().combine(transform)); + holder.setTransform(transform.combine(holder.getTransform())); BBC.COMMAND_ROTATE.send(player); if (!FawePlayer.wrap(player).hasPermission("fawe.tips")) BBC.TIP_FLIP.or(BBC.TIP_DEFORM, BBC.TIP_TRANSFORM).send(player); @@ -496,7 +496,7 @@ public class ClipboardCommands extends MethodCommands { Clipboard clipboard = holder.getClipboard(); AffineTransform transform = new AffineTransform(); transform = transform.scale(direction.positive().multiply(-2).add(1, 1, 1)); - holder.setTransform(holder.getTransform().combine(transform)); + holder.setTransform(transform.combine(holder.getTransform())); BBC.COMMAND_FLIPPED.send(player); } diff --git a/core/src/main/java/com/sk89q/worldedit/math/transform/AffineTransform.java b/core/src/main/java/com/sk89q/worldedit/math/transform/AffineTransform.java index 24635af1..341770c8 100644 --- a/core/src/main/java/com/sk89q/worldedit/math/transform/AffineTransform.java +++ b/core/src/main/java/com/sk89q/worldedit/math/transform/AffineTransform.java @@ -305,7 +305,9 @@ public class AffineTransform implements Transform, Serializable { @Override public Transform combine(Transform other) { - if (other instanceof AffineTransform) { + if (other instanceof Identity || other.isIdentity()) { + return this; + } else if (other instanceof AffineTransform) { return concatenate((AffineTransform) other); } else { return new CombinedTransform(this, other);