Many upstream changes. Should be non-breaking

This commit is contained in:
MattBDev
2019-06-25 09:00:44 -04:00
parent c672bcfddd
commit a1c15e1c39
53 changed files with 689 additions and 1067 deletions

View File

@ -35,6 +35,7 @@ import com.boydti.fawe.object.schematic.Schematic;
import com.boydti.fawe.util.ImgurUtility;
import com.boydti.fawe.util.MainUtil;
import com.boydti.fawe.util.MaskTraverser;
import com.sk89q.minecraft.util.commands.Command;
import com.sk89q.minecraft.util.commands.CommandContext;
import com.sk89q.minecraft.util.commands.CommandException;
@ -85,9 +86,11 @@ import java.util.Set;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.sk89q.minecraft.util.commands.Logging.LogMode.PLACEMENT;
import static com.sk89q.minecraft.util.commands.Logging.LogMode.REGION;
/**
* Clipboard commands.
*/
@ -101,9 +104,9 @@ public class ClipboardCommands extends MethodCommands {
*/
public ClipboardCommands(WorldEdit worldEdit) {
super(worldEdit);
checkNotNull(worldEdit);
}
@Command(
aliases = { "/lazycopy" },
flags = "em",
@ -233,17 +236,17 @@ public class ClipboardCommands extends MethodCommands {
}
@Command(
aliases = {"/cut"},
flags = "em",
usage = "[leave-id]",
desc = "Cut the selection to the clipboard",
help = "Copy the selection to the clipboard\n" +
"Flags:\n" +
aliases = { "/cut" },
flags = "em",
usage = "[leave-id]",
desc = "Cut the selection to the clipboard",
help = "Copy the selection to the clipboard\n" +
"Flags:\n" +
" -e will also cut entities\n" +
" -m sets a source mask so that excluded blocks become air\n" +
" -b copies biomes\n" +
"WARNING: Cutting and pasting entities cannot yet be undone!",
max = 1
" -m sets a source mask so that excluded blocks become air\n" +
" -b copies biomes\n" +
"WARNING: Cutting and pasting entities cannot yet be undone!",
max = 1
)
@CommandPermissions("worldedit.clipboard.cut")
@Logging(REGION)
@ -434,20 +437,20 @@ public class ClipboardCommands extends MethodCommands {
}
@Command(
aliases = {"/paste"},
usage = "",
flags = "saobe",
desc = "Paste the clipboard's contents",
help =
"Pastes the clipboard's contents.\n" +
"Flags:\n" +
" -a skips air blocks\n" +
" -b skips pasting biomes\n" +
" -e skips pasting entities\n" +
" -o pastes at the original position\n" +
" -s selects the region after pasting",
min = 0,
max = 0
aliases = { "/paste" },
usage = "",
flags = "saobe",
desc = "Paste the clipboard's contents",
help =
"Pastes the clipboard's contents.\n" +
"Flags:\n" +
" -a skips air blocks\n" +
" -b skips pasting biomes\n" +
" -e skips pasting entities\n" +
" -o pastes at the original position\n" +
" -s selects the region after pasting",
min = 0,
max = 0
)
@CommandPermissions("worldedit.clipboard.paste")
@Logging(PLACEMENT)
@ -455,6 +458,7 @@ public class ClipboardCommands extends MethodCommands {
@Switch('a') boolean ignoreAirBlocks, @Switch('o') boolean atOrigin,
@Switch('b') boolean ignoreBiomes, @Switch('e') boolean ignoreEntities,
@Switch('s') boolean selectPasted) throws WorldEditException {
ClipboardHolder holder = session.getClipboard();
if (holder.getTransform().isIdentity() && editSession.getSourceMask() == null) {
place(player, session, editSession, ignoreAirBlocks, atOrigin, selectPasted);
@ -462,6 +466,7 @@ public class ClipboardCommands extends MethodCommands {
}
Clipboard clipboard = holder.getClipboard();
Region region = clipboard.getRegion();
BlockVector3 to = atOrigin ? clipboard.getOrigin() : session.getPlacementPosition(player);
checkPaste(player, editSession, to, holder, clipboard);
Operation operation = holder
@ -543,12 +548,12 @@ public class ClipboardCommands extends MethodCommands {
}
@Command(
aliases = {"/rotate"},
usage = "<y-axis> [<x-axis>] [<z-axis>]",
desc = "Rotate the contents of the clipboard",
help = "Non-destructively rotate the contents of the clipboard.\n" +
"Angles are provided in degrees and a positive angle will result in a clockwise rotation. " +
"Multiple rotations can be stacked. Interpolation is not performed so angles should be a multiple of 90 degrees.\n"
aliases = { "/rotate" },
usage = "<y-axis> [<x-axis>] [<z-axis>]",
desc = "Rotate the contents of the clipboard",
help = "Non-destructively rotate the contents of the clipboard.\n" +
"Angles are provided in degrees and a positive angle will result in a clockwise rotation. " +
"Multiple rotations can be stacked. Interpolation is not performed so angles should be a multiple of 90 degrees.\n"
)
@CommandPermissions("worldedit.clipboard.rotate")
public void rotate(Player player, LocalSession session, Double yRotate, @Optional Double xRotate, @Optional Double zRotate) throws WorldEditException {
@ -564,13 +569,13 @@ public class ClipboardCommands extends MethodCommands {
}
@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
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,
@ -584,16 +589,14 @@ public class ClipboardCommands extends MethodCommands {
@Command(
aliases = { "clearclipboard" },
usage = "",
desc = "Clear your clipboard",
min = 0,
max = 0
usage = "",
desc = "Clear your clipboard",
min = 0,
max = 0
)
@CommandPermissions("worldedit.clipboard.clear")
public void clearClipboard(Player player, LocalSession session) throws WorldEditException {
session.setClipboard(null);
BBC.CLIPBOARD_CLEARED.send(player);
}
}

View File

@ -20,10 +20,15 @@
package com.sk89q.worldedit.command.composition;
import com.boydti.fawe.config.BBC;
import com.boydti.fawe.object.*;
import com.boydti.fawe.object.FaweChunk;
import com.boydti.fawe.object.FaweQueue;
import com.boydti.fawe.object.RegionWrapper;
import com.boydti.fawe.object.RunnableVal;
import com.boydti.fawe.object.extent.FaweRegionExtent;
import com.boydti.fawe.util.MainUtil;
import com.google.common.base.Joiner;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.collect.Lists;
import com.sk89q.minecraft.util.commands.CommandException;
import com.sk89q.minecraft.util.commands.CommandLocals;
@ -52,8 +57,6 @@ import com.sk89q.worldedit.world.block.BlockStateHolder;
import java.lang.reflect.Field;
import java.util.List;
import static com.google.common.base.Preconditions.checkNotNull;
public class SelectionCommand extends SimpleCommand<Operation> {
private final CommandExecutor<Contextual<? extends Operation>> delegate;
@ -116,11 +119,6 @@ public class SelectionCommand extends SimpleCommand<Operation> {
fc.fillCuboid(0, 15, minY, maxY, 0, 15, block.getInternalId());
fc.optimize();
int bcx = (current.minX) >> 4;
int bcz = (current.minZ) >> 4;
int tcx = (current.maxX) >> 4;
int tcz = (current.maxZ) >> 4;
// [chunkx, chunkz, pos1x, pos1z, pos2x, pos2z, isedge]
MainUtil.chunkTaskSync(current, new RunnableVal<int[]>() {
@Override
@ -181,7 +179,7 @@ public class SelectionCommand extends SimpleCommand<Operation> {
}
@Override
public boolean testPermission0(CommandLocals locals) {
protected boolean testPermission0(CommandLocals locals) {
return locals.get(Actor.class).hasPermission(permission);
}