From 8a70f9744545e16a15c2e2990b889c021ba35589 Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Tue, 17 Mar 2020 23:05:52 -0400 Subject: [PATCH] Mask and Pattern modifications --- .../bukkit/util/image/BukkitImageViewer.java | 4 +- .../java/com/boydti/fawe/jnbt/JSON2NBT.java | 2 +- .../com/boydti/fawe/object/NullChangeSet.java | 3 +- .../fawe/object/brush/SplatterBrush.java | 10 +--- .../object/changeset/FaweStreamChangeSet.java | 10 ++-- .../boydti/fawe/object/mask/AngleMask.java | 1 - .../boydti/fawe/object/mask/BiomeMask.java | 29 ----------- .../fawe/object/mask/BlockLightMask.java | 27 ---------- .../fawe/object/mask/BrightnessMask.java | 27 ---------- .../boydti/fawe/object/mask/LightMask.java | 27 ---------- .../boydti/fawe/object/mask/OpacityMask.java | 27 ---------- .../boydti/fawe/object/mask/ROCAngleMask.java | 4 +- .../boydti/fawe/object/mask/SkyLightMask.java | 29 ----------- .../fawe/object/pattern/BiomePattern.java | 44 ---------------- .../object/pattern/FullClipboardPattern.java | 51 ------------------- .../com/sk89q/worldedit/LocalSession.java | 6 +-- .../worldedit/command/PatternCommands.java | 48 ----------------- 17 files changed, 15 insertions(+), 334 deletions(-) delete mode 100644 worldedit-core/src/main/java/com/boydti/fawe/object/mask/BiomeMask.java delete mode 100644 worldedit-core/src/main/java/com/boydti/fawe/object/mask/BlockLightMask.java delete mode 100644 worldedit-core/src/main/java/com/boydti/fawe/object/mask/BrightnessMask.java delete mode 100644 worldedit-core/src/main/java/com/boydti/fawe/object/mask/LightMask.java delete mode 100644 worldedit-core/src/main/java/com/boydti/fawe/object/mask/OpacityMask.java delete mode 100644 worldedit-core/src/main/java/com/boydti/fawe/object/mask/SkyLightMask.java delete mode 100644 worldedit-core/src/main/java/com/boydti/fawe/object/pattern/BiomePattern.java delete mode 100644 worldedit-core/src/main/java/com/boydti/fawe/object/pattern/FullClipboardPattern.java diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/util/image/BukkitImageViewer.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/util/image/BukkitImageViewer.java index b49a35b3f..60f39aacf 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/util/image/BukkitImageViewer.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/util/image/BukkitImageViewer.java @@ -108,7 +108,7 @@ public class BukkitImageViewer implements ImageViewer { Collection entities = world.getNearbyEntities(pos, 0.1, 0.1, 0.1); boolean contains = false; for (Entity ent : entities) { - if (ent instanceof ItemFrame && ((ItemFrame) ent).getFacing() == facing) { + if (ent instanceof ItemFrame && ent.getFacing() == facing) { ItemFrame itemFrame = (ItemFrame) ent; itemFrame.setRotation(Rotation.NONE); contains = true; @@ -188,4 +188,4 @@ public class BukkitImageViewer implements ImageViewer { public void close() throws IOException { last = null; } -} \ No newline at end of file +} diff --git a/worldedit-core/src/main/java/com/boydti/fawe/jnbt/JSON2NBT.java b/worldedit-core/src/main/java/com/boydti/fawe/jnbt/JSON2NBT.java index 9d53caec8..edd082307 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/jnbt/JSON2NBT.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/jnbt/JSON2NBT.java @@ -145,7 +145,7 @@ public class JSON2NBT { private static JSON2NBT.Any getTagFromNameValue(String str, boolean isArray) throws NBTException { String s = locateName(str, isArray); String s1 = locateValue(str, isArray); - return joinStrToNBT(new String[]{s, s1}); + return joinStrToNBT(s, s1); } private static String nextNameValuePair(String str, boolean isCompound) throws NBTException { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/NullChangeSet.java b/worldedit-core/src/main/java/com/boydti/fawe/object/NullChangeSet.java index 1a8d166ec..e8c7cd1a3 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/NullChangeSet.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/NullChangeSet.java @@ -7,6 +7,7 @@ import com.sk89q.worldedit.history.change.Change; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BiomeType; import java.util.ArrayList; +import java.util.Collections; import java.util.Iterator; public class NullChangeSet extends AbstractChangeSet { @@ -58,7 +59,7 @@ public class NullChangeSet extends AbstractChangeSet { @Override public final Iterator getIterator(boolean undo) { - return new ArrayList().iterator(); + return Collections.emptyIterator(); } @Override diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SplatterBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SplatterBrush.java index dc28716eb..c95dd7d9e 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SplatterBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SplatterBrush.java @@ -2,12 +2,10 @@ package com.boydti.fawe.object.brush; import com.boydti.fawe.object.collection.LocalBlockVectorSet; import com.boydti.fawe.object.mask.SurfaceMask; -import com.boydti.fawe.object.pattern.BiomePattern; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.AbstractExtentMask; -import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.operation.Operations; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.visitor.BreadthFirstSearch; @@ -30,13 +28,7 @@ public class SplatterBrush extends ScatterBrush { public void apply(final EditSession editSession, final LocalBlockVectorSet placed, final BlockVector3 position, Pattern p, double size) throws MaxChangedBlocksException { final Pattern finalPattern; if (solid) { - Pattern tmp; - try { - tmp = p.apply(position); - } catch (BiomePattern.BiomePatternException e) { - tmp = e.getPattern(); - } - finalPattern = tmp; + finalPattern = p.apply(position); } else { finalPattern = p; } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/FaweStreamChangeSet.java b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/FaweStreamChangeSet.java index d82a6f4c2..14f25c5a6 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/FaweStreamChangeSet.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/changeset/FaweStreamChangeSet.java @@ -178,7 +178,7 @@ public abstract class FaweStreamChangeSet extends AbstractChangeSet { }; } else { posDel = new FaweStreamPositionDelegate() { - byte[] buffer = new byte[5]; + final byte[] buffer = new byte[5]; int lx, ly, lz; @Override @@ -405,7 +405,7 @@ public abstract class FaweStreamChangeSet extends AbstractChangeSet { public Iterator getBlockIterator(final boolean dir) throws IOException { final FaweInputStream is = getBlockIS(); if (is == null) { - return new ArrayList().iterator(); + return Collections.emptyIterator(); } final MutableBlockChange change = new MutableBlockChange(0, 0, 0, BlockTypes.AIR.getInternalId()); return new Iterator() { @@ -456,7 +456,7 @@ public abstract class FaweStreamChangeSet extends AbstractChangeSet { public Iterator getBiomeIterator(final boolean dir) throws IOException { final FaweInputStream is = getBiomeIS(); if (is == null) { - return new ArrayList().iterator(); + return Collections.emptyIterator(); } final MutableBiomeChange change = new MutableBiomeChange(); return new Iterator() { @@ -570,7 +570,7 @@ public abstract class FaweStreamChangeSet extends AbstractChangeSet { public Iterator getEntityIterator(final NBTInputStream is, final boolean create) { if (is == null) { - return new ArrayList().iterator(); + return Collections.emptyIterator(); } final MutableEntityChange change = new MutableEntityChange(null, create); try { @@ -619,7 +619,7 @@ public abstract class FaweStreamChangeSet extends AbstractChangeSet { public Iterator getTileIterator(final NBTInputStream is, final boolean create) { if (is == null) { - return new ArrayList().iterator(); + return Collections.emptyIterator(); } final MutableTileChange change = new MutableTileChange(null, create); try { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/AngleMask.java b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/AngleMask.java index 5607c2eda..8d619c092 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/AngleMask.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/AngleMask.java @@ -37,7 +37,6 @@ public class AngleMask extends SolidBlockMask implements ResettableMask { cacheBotX = Integer.MIN_VALUE; cacheBotZ = Integer.MIN_VALUE; lastX = Integer.MIN_VALUE; - lastX = Integer.MIN_VALUE; lastY = Integer.MIN_VALUE; if (cacheHeights != null) { Arrays.fill(cacheHeights, (byte) 0); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/BiomeMask.java b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/BiomeMask.java deleted file mode 100644 index 480473d72..000000000 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/BiomeMask.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.boydti.fawe.object.mask; - -import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.function.mask.AbstractExtentMask; -import com.sk89q.worldedit.math.BlockVector2; -import com.sk89q.worldedit.math.BlockVector3; -import com.sk89q.worldedit.math.MutableBlockVector2; -import com.sk89q.worldedit.world.biome.BiomeType; - -public class BiomeMask extends AbstractExtentMask implements ResettableMask { - private final BiomeType biome; - private transient MutableBlockVector2 mutable = new MutableBlockVector2(); - - public BiomeMask(Extent extent, BiomeType biome) { - super(extent); - this.biome = biome; - } - - @Override - public void reset() { - mutable = new MutableBlockVector2(); - } - - @Override - public boolean test(Extent extent, BlockVector3 vector) { - BlockVector2 pos = mutable.setComponents(vector.getBlockX(), vector.getBlockZ()); - return extent.getBiome(pos).getId() == biome.getId(); - } -} diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/BlockLightMask.java b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/BlockLightMask.java deleted file mode 100644 index e956df9ff..000000000 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/BlockLightMask.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.boydti.fawe.object.mask; - -import com.boydti.fawe.object.extent.LightingExtent; -import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.function.mask.AbstractExtentMask; -import com.sk89q.worldedit.math.BlockVector3; - -public class BlockLightMask extends AbstractExtentMask { - - private final int min, max; - - public BlockLightMask(Extent extent, int min, int max) { - super(extent); - this.min = min; - this.max = max; - } - - @Override - public boolean test(Extent extent, BlockVector3 vector) { - if (extent instanceof LightingExtent) { - int light = ((LightingExtent) extent).getBlockLight(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ()); - return light >= min && light <= max; - } - return false; - } - -} diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/BrightnessMask.java b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/BrightnessMask.java deleted file mode 100644 index 96692231b..000000000 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/BrightnessMask.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.boydti.fawe.object.mask; - -import com.boydti.fawe.object.extent.LightingExtent; -import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.function.mask.AbstractExtentMask; -import com.sk89q.worldedit.math.BlockVector3; - -public class BrightnessMask extends AbstractExtentMask { - - private final int min, max; - - public BrightnessMask(Extent extent, int min, int max) { - super(extent); - this.min = min; - this.max = max; - } - - @Override - public boolean test(Extent extent, BlockVector3 vector) { - if (extent instanceof LightingExtent) { - int light = ((LightingExtent) extent).getBrightness(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ()); - return light >= min && light <= max; - } - return false; - } - -} diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/LightMask.java b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/LightMask.java deleted file mode 100644 index 5ab2ecfcb..000000000 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/LightMask.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.boydti.fawe.object.mask; - -import com.boydti.fawe.object.extent.LightingExtent; -import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.function.mask.AbstractExtentMask; -import com.sk89q.worldedit.math.BlockVector3; - -public class LightMask extends AbstractExtentMask { - - private final int min, max; - - public LightMask(Extent extent, int min, int max) { - super(extent); - this.min = min; - this.max = max; - } - - @Override - public boolean test(Extent extent, BlockVector3 vector) { - if (extent instanceof LightingExtent) { - int light = ((LightingExtent) extent).getLight(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ()); - return light >= min && light <= max; - } - return false; - } - -} diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/OpacityMask.java b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/OpacityMask.java deleted file mode 100644 index 76b53938f..000000000 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/OpacityMask.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.boydti.fawe.object.mask; - -import com.boydti.fawe.object.extent.LightingExtent; -import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.function.mask.AbstractExtentMask; -import com.sk89q.worldedit.math.BlockVector3; - -public class OpacityMask extends AbstractExtentMask { - - private final int min, max; - - public OpacityMask(Extent extent, int min, int max) { - super(extent); - this.min = min; - this.max = max; - } - - @Override - public boolean test(Extent extent, BlockVector3 vector) { - if (extent instanceof LightingExtent) { - int light = ((LightingExtent) extent).getOpacity(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ()); - return light >= min && light <= max; - } - return false; - } - -} diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/ROCAngleMask.java b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/ROCAngleMask.java index 826040550..ee7f542d2 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/ROCAngleMask.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/ROCAngleMask.java @@ -10,7 +10,6 @@ public class ROCAngleMask extends AngleMask { @Override protected boolean testSlope(Extent extent, int x, int y, int z) { - double tmp; lastY = y; int base = getHeight(extent, x, y, z); @@ -18,7 +17,8 @@ public class ROCAngleMask extends AngleMask { (getHeight(extent, x + distance, y, z) - base - (base - getHeight(extent, x - distance, y, z))) * ADJACENT_MOD; - tmp = (getHeight(extent, x, y, z + distance) - base - (base - getHeight(extent, x, y, z - distance))) * ADJACENT_MOD; + double tmp = (getHeight(extent, x, y, z + distance) - base - (base - getHeight(extent, x, y, + z - distance))) * ADJACENT_MOD; if (Math.abs(tmp) > Math.abs(slope)) slope = tmp; tmp = (getHeight(extent, x + distance, y, z + distance) - base - (base - getHeight(extent, x - distance, y, diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/SkyLightMask.java b/worldedit-core/src/main/java/com/boydti/fawe/object/mask/SkyLightMask.java deleted file mode 100644 index bc4bf7ae4..000000000 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/mask/SkyLightMask.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.boydti.fawe.object.mask; - -import com.boydti.fawe.object.extent.LightingExtent; -import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.function.mask.AbstractExtentMask; -import com.sk89q.worldedit.math.BlockVector3; - -public class SkyLightMask extends AbstractExtentMask { - - private final int min; - private final int max; - - public SkyLightMask(Extent extent, int min, int max) { - super(extent); - this.min = min; - this.max = max; - } - - @Override - public boolean test(Extent extent, BlockVector3 vector) { - if (extent instanceof LightingExtent) { - int light = ((LightingExtent) extent) - .getSkyLight(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ()); - return light >= min && light <= max; - } - return false; - } - -} diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/BiomePattern.java b/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/BiomePattern.java deleted file mode 100644 index 7907dcb5b..000000000 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/BiomePattern.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.boydti.fawe.object.pattern; - -import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.math.BlockVector3; -import com.sk89q.worldedit.world.biome.BiomeType; -import com.sk89q.worldedit.world.block.BaseBlock; - -public class BiomePattern extends ExistingPattern { - private final BiomeType biome; - - public BiomePattern(Extent extent, BiomeType biome) { - super(extent); - this.biome = biome; - } - - @Override - public BaseBlock apply(BlockVector3 position) { - throw new BiomePatternException(); - } - - @Override - public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException { - return set.setBiome(extent, biome); - } - - public class BiomePatternException extends RuntimeException { - private BiomePatternException() { - } - - public BiomePattern getPattern() { - return BiomePattern.this; - } - - public BiomeType getBiome() { - return biome; - } - - @Override - public Throwable fillInStackTrace() { - return this; - } - } -} diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/FullClipboardPattern.java b/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/FullClipboardPattern.java deleted file mode 100644 index 7d77cf65e..000000000 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/pattern/FullClipboardPattern.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.boydti.fawe.object.pattern; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.extent.clipboard.Clipboard; -import com.sk89q.worldedit.function.mask.ExistingBlockMask; -import com.sk89q.worldedit.function.operation.ForwardExtentCopy; -import com.sk89q.worldedit.function.operation.Operations; -import com.sk89q.worldedit.math.BlockVector3; -import com.sk89q.worldedit.math.MutableBlockVector3; -import com.sk89q.worldedit.world.block.BaseBlock; -import java.io.IOException; -import java.io.NotSerializableException; - -/** - * A pattern that reads from {@link Clipboard}. - */ -public class FullClipboardPattern extends AbstractExtentPattern { - private final Clipboard clipboard; - private final MutableBlockVector3 mutable = new MutableBlockVector3(); - - /** - * Create a new clipboard pattern. - * - * @param clipboard the clipboard - */ - public FullClipboardPattern(Extent extent, Clipboard clipboard) { - super(extent); - checkNotNull(clipboard); - this.clipboard = clipboard; - } - - @Override - public boolean apply(Extent extent, BlockVector3 get, BlockVector3 set) throws WorldEditException { - ForwardExtentCopy copy = new ForwardExtentCopy(clipboard, clipboard.getRegion(), clipboard.getOrigin(), extent, set); - copy.setSourceMask(new ExistingBlockMask(clipboard)); - Operations.completeBlindly(copy); - return true; - } - - @Override - public BaseBlock apply(BlockVector3 position) { - throw new IllegalStateException("Incorrect use. This pattern can only be applied to an extent!"); - } - - private void writeObject(java.io.ObjectOutputStream stream) throws IOException { - throw new NotSerializableException("Clipboard cannot be serialized!"); - } -} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java index 8b39d0460..fed1b0416 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/LocalSession.java @@ -1571,10 +1571,8 @@ public class LocalSession implements TextureHolder { this.sourceMask = mask; } - public void setTextureUtil(TextureUtil texture) { - synchronized (this) { - this.texture = texture; - } + public synchronized void setTextureUtil(TextureUtil texture) { + this.texture = texture; } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/PatternCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/PatternCommands.java index 8124c52c6..313eb8066 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/PatternCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/PatternCommands.java @@ -74,25 +74,6 @@ //@CommandContainer//(superTypes = CommandPermissionsConditionGenerator.Registration.class) //public class PatternCommands { // -// @Command( -// name = "#existing", -// aliases = {"#*", "*", ".*"}, -// desc = "Use the block that is already there" -// ) -// public Pattern existing(Extent extent, @Arg(desc = "String", def = "") String properties) { // TODO FIXME , @Arg(name = "properties", desc = "String", def = "") String properties -// if (properties == null) return new ExistingPattern(extent); -// return new PropertyPattern(extent).addRegex(".*[" + properties + "]"); -// } -// -// @Command( -// name = "#clipboard", -// aliases = {"#copy"}, -// desc = "Use the blocks in your clipboard as the pattern") -// public Pattern clipboard(LocalSession session) throws EmptyClipboardException { -// ClipboardHolder holder = session.getClipboard(); -// Clipboard clipboard = holder.getClipboard(); -// return new ClipboardPattern(clipboard); -// } // // @Command( // name = "#simplex", @@ -175,35 +156,6 @@ // } // // @Command( -// name = "#fullcopy", -// desc = "Places your full clipboard at each block" -//) -// public Pattern fullcopy(Player player, Extent extent, LocalSession session, @Arg(desc = "String", def = "#copy") String location, @Arg(desc = "boolean", def = "false") boolean rotate, @Arg(desc = "boolean", def = "false") boolean flip) throws EmptyClipboardException, InputParseException, IOException { -// List clipboards; -// switch (location.toLowerCase()) { -// case "#copy": -// case "#clipboard": -// ClipboardHolder clipboard = session.getExistingClipboard(); -// if (clipboard == null) { -// throw new InputParseException("To use #fullcopy, please first copy something to your clipboard"); -// } -// if (!rotate && !flip) { -// return new FullClipboardPattern(extent, clipboard.getClipboard()); -// } -// clipboards = Collections.singletonList(clipboard); -// break; -// default: -// MultiClipboardHolder multi = ClipboardFormats.loadAllFromInput(player, location, null, true); -// clipboards = multi != null ? multi.getHolders() : null; -// break; -// } -// if (clipboards == null) { -// throw new InputParseException("#fullcopy:"); -// } -// return new RandomFullClipboardPattern(extent, clipboards, rotate, flip); -// } -// -// @Command( // name = "#buffer", // desc = "Only place a block once while a pattern is in use", // descFooter = "Only place a block once while a pattern is in use\n" +