@Command( aliases = {"/flip"}, usage = "[<direction>]", desc = "Flip the contents of the clipboard", help = "Flips the contents of the clipboard across the point from which the copy was made.\n", min = 0, max = 1) @CommandPermissions("worldedit.clipboard.flip") public void flip( Player player, LocalSession session, EditSession editSession, @Optional(Direction.AIM) @Direction Vector direction) throws WorldEditException { ClipboardHolder holder = session.getClipboard(); 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)); player.print("The clipboard copy has been flipped."); }
@Override public Vector positive() { return wrap(m_parent.positive()); }