From 6e016a66f0fb0a2225625252188ec5eee14f0678 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Sun, 28 Apr 2019 16:05:01 +1000 Subject: [PATCH] Fixed //size on clipboards --- .../worldedit/command/SelectionCommands.java | 28 ++++++++----------- .../component/SchematicPaginationBox.java | 19 +++++++++++++ 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java index d2e2a3708..8a62dc529 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java @@ -457,33 +457,27 @@ public class SelectionCommands { public void size(Player player, LocalSession session, @Switch(name = 'c', desc = "Get clipboard info instead") boolean clipboardInfo) throws WorldEditException { + Region region; if (clipboardInfo) { ClipboardHolder holder = session.getClipboard(); Clipboard clipboard = holder.getClipboard(); - Region region = clipboard.getRegion(); - BlockVector3 size = region.getMaximumPoint().subtract(region.getMinimumPoint()); + region = clipboard.getRegion(); + BlockVector3 origin = clipboard.getOrigin(); - - player.print("Cuboid dimensions (max - min): " + size); player.print("Offset: " + origin); - player.print("Cuboid distance: " + size.distance(BlockVector3.ONE)); - player.print("# of blocks: " + (size.getX() * size.getY() * size.getZ())); - return; - } + } else { + region = session.getSelection(player.getWorld()); - Region region = session.getSelection(player.getWorld()); + player.print("Type: " + session.getRegionSelector(player.getWorld()).getTypeName()); + + for (String line : session.getRegionSelector(player.getWorld()).getInformationLines()) { + player.print(line); + } + } BlockVector3 size = region.getMaximumPoint() .subtract(region.getMinimumPoint()) .add(1, 1, 1); - player.print("Type: " + session.getRegionSelector(player.getWorld()) - .getTypeName()); - - for (String line : session.getRegionSelector(player.getWorld()) - .getInformationLines()) { - player.print(line); - } - player.print("Size: " + size); player.print("Cuboid distance: " + region.getMaximumPoint().distance(region.getMinimumPoint())); player.print("# of blocks: " + region.getArea()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SchematicPaginationBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SchematicPaginationBox.java index 6a1f0712c..eb9598a49 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SchematicPaginationBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SchematicPaginationBox.java @@ -1,3 +1,22 @@ +/* + * WorldEdit, a Minecraft world manipulation toolkit + * Copyright (C) sk89q + * Copyright (C) WorldEdit team and contributors + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + package com.sk89q.worldedit.util.formatting.component; import com.google.common.collect.Multimap;