This commit is contained in:
Jesse Boyd 2017-01-08 23:50:16 +11:00
parent 0103706ce7
commit b340ebff0f
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
4 changed files with 23 additions and 7 deletions

View File

@ -63,10 +63,10 @@ public enum BBC {
COMMAND_COPY("%s0 blocks were copied.", "WorldEdit.Copy"),
COMMAND_CUT_SLOW("%s0 blocks were cut.\nTip: lazycut is safer", "WorldEdit.Cut"),
COMMAND_CUT_SLOW("%s0 blocks were cut.", "WorldEdit.Cut"),
COMMAND_CUT_LAZY("%s0 blocks will be removed on paste", "WorldEdit.Cut"),
COMMAND_PASTE("The clipboard has been pasted at %s0\nTip: Paste on click with &c//br copypaste", "WorldEdit.Paste"),
COMMAND_PASTE("The clipboard has been pasted at %s0", "WorldEdit.Paste"),
COMMAND_ROTATE("The clipboard has been rotated", "WorldEdit.Rotate"),
@ -242,6 +242,8 @@ public enum BBC {
TIP_SET_POS1("Tip: Use pos1 as a pattern with &c//set pos1", "Tips"),
TIP_FARWAND("Tip: Select distant points with &c//farwand", "Tips"),
// cut
TIP_LAZYCUT("&7Tip: It is safer to use &c//lazycut", "Tips"),
// set
TIP_FAST("&7Tip: Set fast and without undo using &c//fast", "Tips"),
TIP_CANCEL("&7Tip: You can &c//cancel &7an edit in progress", "Tips"),

View File

@ -385,7 +385,7 @@ public class BrushCommands {
worldEdit.checkMaxBrushRadius(radius);
DoubleActionBrushTool tool = session.getDoubleActionBrushTool(player.getItemInHand());
tool.setSize(radius);
tool.setBrush(new CopyPastaBrush(player, session, tool), "worldedit.brush.copy");
tool.setBrush(new CopyPastaBrush(tool), "worldedit.brush.copy");
player.print(BBC.getPrefix() + BBC.BRUSH_COPY.f(radius));
}
@ -402,7 +402,7 @@ public class BrushCommands {
public void command(Player player, LocalSession session, @Optional("5") double radius, CommandContext args) throws WorldEditException {
BrushTool tool = session.getBrushTool(player.getItemInHand());
String cmd = args.getJoinedStrings(1);
tool.setBrush(new CommandBrush(player, tool, cmd, radius), "worldedit.brush.copy");
tool.setBrush(new CommandBrush(tool, cmd, radius), "worldedit.brush.copy");
player.print(BBC.getPrefix() + BBC.BRUSH_COMMAND.f(cmd));
}

View File

@ -223,6 +223,7 @@ public class ClipboardCommands {
session.setClipboard(new ClipboardHolder(clipboard, editSession.getWorldData()));
BBC.COMMAND_CUT_SLOW.send(player, region.getArea());
if (!FawePlayer.wrap(player).hasPermission("fawe.tips")) BBC.TIP_LAZYCUT.send(player);
}
@Command(aliases = { "download" }, desc = "Download your clipboard")
@ -409,6 +410,10 @@ public class ClipboardCommands {
selector.explainRegionAdjust(player, session);
}
BBC.COMMAND_PASTE.send(player, to);
FawePlayer<Object> fp = FawePlayer.wrap(player);
if (!fp.hasPermission("fawe.tips")) {
BBC.TIP_COPYPASTE.send(fp);
}
}
@Command(

View File

@ -48,6 +48,7 @@ import com.sk89q.worldedit.function.generator.FloraGenerator;
import com.sk89q.worldedit.function.generator.ForestGenerator;
import com.sk89q.worldedit.function.mask.ExistingBlockMask;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.function.mask.Masks;
import com.sk89q.worldedit.function.mask.NoiseFilter2D;
import com.sk89q.worldedit.function.operation.Operations;
import com.sk89q.worldedit.function.pattern.BlockPattern;
@ -319,7 +320,8 @@ public class RegionCommands {
@CommandPermissions("worldedit.region.set")
@Logging(REGION)
public void set(Player player, LocalSession session, EditSession editSession, @Selection Region selection, Pattern to) throws WorldEditException {
if (selection instanceof CuboidRegion && (editSession.hasFastMode() || (editSession.getRegionExtent() == null && editSession.getChangeTask() != null)) && to instanceof BlockPattern) {
if (selection instanceof CuboidRegion && (editSession.hasFastMode() || (editSession.getRegionExtent() == null && editSession.getChangeTask() != null)) && to instanceof BlockPattern && Masks.isNull(session.getMask()) && Masks.isNull(session.getSourceMask())) {
if (session.getMask() == null && session.getSourceMask() == null)
try {
CuboidRegion cuboid = (CuboidRegion) selection;
RegionWrapper current = new RegionWrapper(cuboid.getMinimumPoint(), cuboid.getMaximumPoint());
@ -375,7 +377,12 @@ public class RegionCommands {
MainUtil.handleError(e);
}
}
int affected = editSession.setBlocks(selection, Patterns.wrap(to));
int affected;
if (to instanceof BlockPattern) {
affected = editSession.setBlocks(selection, ((BlockPattern) to).getBlock());
} else {
affected = editSession.setBlocks(selection, Patterns.wrap(to));
}
if (affected != 0) {
BBC.OPERATION.send(player, affected);
if (!FawePlayer.wrap(player).hasPermission("fawe.tips")) BBC.TIP_FAST.or(BBC.TIP_CANCEL, BBC.TIP_MASK, BBC.TIP_MASK_ANGLE, BBC.TIP_SET_LINEAR, BBC.TIP_SURFACE_SPREAD, BBC.TIP_SET_HAND).send(player);
@ -601,7 +608,9 @@ public class RegionCommands {
editSession.regenerate(region, biome, seed);
session.setMask(mask);
session.setSourceMask(mask);
if (biome == null) {
if (!FawePlayer.wrap(player).hasPermission("fawe.tips")) {
BBC.COMMAND_REGEN_2.send(player);
} else if (biome == null) {
BBC.COMMAND_REGEN_0.send(player);
} else if (seed == null) {
BBC.COMMAND_REGEN_1.send(player);