mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
@ -1086,9 +1086,9 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
||||
if (used.MAX_CHANGES > 0 || used.MAX_ENTITIES > 0) {
|
||||
player.print(Caption.of("fawe.error.worldedit.some.fails", used.MAX_FAILS));
|
||||
} else if (new ExtentTraverser<>(getExtent()).findAndGet(FaweRegionExtent.class) != null) {
|
||||
player.printError(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.outside.region"));
|
||||
player.print(Caption.of("fawe.cancel.worldedit.cancel.reason.outside.region"));
|
||||
} else {
|
||||
player.printError(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.outside.level"));
|
||||
player.print(Caption.of("fawe.cancel.worldedit.cancel.reason.outside.level"));
|
||||
}
|
||||
}
|
||||
if (wnaMode) {
|
||||
@ -1112,7 +1112,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
player.printError(TranslatableComponent.of("fawe.error.lighting"));
|
||||
player.print(Caption.of("fawe.error.lighting"));
|
||||
e.printStackTrace();
|
||||
}
|
||||
// Enqueue it
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit;
|
||||
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.boydti.fawe.config.Caption;
|
||||
|
||||
/**
|
||||
* Raised when a world is missing but is required.
|
||||
@ -27,6 +27,6 @@ import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
public class MissingWorldException extends WorldEditException {
|
||||
|
||||
public MissingWorldException() {
|
||||
super(TranslatableComponent.of("worldedit.error.missing-world"));
|
||||
super(Caption.of("worldedit.error.missing-world"));
|
||||
}
|
||||
}
|
||||
|
@ -19,8 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.world.item.ItemType;
|
||||
|
||||
/**
|
||||
@ -32,7 +32,7 @@ public class NotABlockException extends WorldEditException {
|
||||
* Create a new instance.
|
||||
*/
|
||||
public NotABlockException() {
|
||||
super(TranslatableComponent.of("worldedit.error.not-a-block"));
|
||||
super(Caption.of("worldedit.error.not-a-block"));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -42,7 +42,7 @@ public class NotABlockException extends WorldEditException {
|
||||
*/
|
||||
@Deprecated
|
||||
public NotABlockException(String input) {
|
||||
super(TranslatableComponent.of("worldedit.error.not-a-block.item", TextComponent.of(input)));
|
||||
super(Caption.of("worldedit.error.not-a-block.item", TextComponent.of(input)));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -52,7 +52,7 @@ public class NotABlockException extends WorldEditException {
|
||||
*/
|
||||
@Deprecated
|
||||
public NotABlockException(int input) {
|
||||
super(TranslatableComponent.of("worldedit.error.not-a-block.item", TextComponent.of(input)));
|
||||
super(Caption.of("worldedit.error.not-a-block.item", TextComponent.of(input)));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -61,6 +61,6 @@ public class NotABlockException extends WorldEditException {
|
||||
* @param input the input that was used
|
||||
*/
|
||||
public NotABlockException(ItemType input) {
|
||||
super(TranslatableComponent.of("worldedit.error.not-a-block.item", input.getRichName()));
|
||||
super(Caption.of("worldedit.error.not-a-block.item", input.getRichName()));
|
||||
}
|
||||
}
|
||||
|
@ -19,8 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
|
||||
/**
|
||||
* Thrown when an unknown direction is specified or detected.
|
||||
@ -35,7 +35,7 @@ public class UnknownDirectionException extends WorldEditException {
|
||||
* @param dir the input that was tried
|
||||
*/
|
||||
public UnknownDirectionException(String dir) {
|
||||
super(TranslatableComponent.of("worldedit.error.unknown-direction", TextComponent.of(dir)));
|
||||
super(Caption.of("worldedit.error.unknown-direction", TextComponent.of(dir)));
|
||||
this.dir = dir;
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.google.common.base.Throwables;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
@ -58,7 +59,6 @@ import com.sk89q.worldedit.util.concurrency.EvenMoreExecutors;
|
||||
import com.sk89q.worldedit.util.concurrency.LazyReference;
|
||||
import com.sk89q.worldedit.util.eventbus.EventBus;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
import com.sk89q.worldedit.util.io.file.FileSelectionAbortedException;
|
||||
import com.sk89q.worldedit.util.io.file.FilenameException;
|
||||
@ -315,7 +315,7 @@ public final class WorldEdit {
|
||||
}
|
||||
|
||||
if (f == null) {
|
||||
throw new FileSelectionAbortedException(TranslatableComponent.of("worldedit.error.no-file-selected"));
|
||||
throw new FileSelectionAbortedException(Caption.of("worldedit.error.no-file-selected"));
|
||||
}
|
||||
} else {
|
||||
List<String> exts = extensions == null ? ImmutableList.of(defaultExt) : Lists.asList(defaultExt, extensions);
|
||||
@ -334,12 +334,12 @@ public final class WorldEdit {
|
||||
|
||||
boolean isSym = existingParent != null && !existingParent.toRealPath().equals(existingParent);
|
||||
if (!inDir || (!getConfiguration().allowSymlinks && isSym)) {
|
||||
throw new FilenameResolutionException(filename, TranslatableComponent.of("worldedit.error.file-resolution.outside-root"));
|
||||
throw new FilenameResolutionException(filename, Caption.of("worldedit.error.file-resolution.outside-root"));
|
||||
}
|
||||
|
||||
return filePath.toFile();
|
||||
} catch (IOException e) {
|
||||
throw new FilenameResolutionException(filename, TranslatableComponent.of("worldedit.error.file-resolution.resolve-failed"));
|
||||
throw new FilenameResolutionException(filename, Caption.of("worldedit.error.file-resolution.resolve-failed"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -366,7 +366,7 @@ public final class WorldEdit {
|
||||
result = getSafeFileWithExtension(dir, filename, iter.next());
|
||||
}
|
||||
if (result == null) {
|
||||
throw new InvalidFilenameException(filename, TranslatableComponent.of("worldedit.error.invalid-filename.invalid-characters"));
|
||||
throw new InvalidFilenameException(filename, Caption.of("worldedit.error.invalid-filename.invalid-characters"));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -717,7 +717,7 @@ public final class WorldEdit {
|
||||
String ext = filename.substring(index + 1);
|
||||
|
||||
if (!ext.equalsIgnoreCase("js")) {
|
||||
player.printError(TranslatableComponent.of("worldedit.script.unsupported"));
|
||||
player.print(Caption.of("worldedit.script.unsupported"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -730,7 +730,7 @@ public final class WorldEdit {
|
||||
file = WorldEdit.class.getResourceAsStream("craftscripts/" + filename);
|
||||
|
||||
if (file == null) {
|
||||
player.printError(TranslatableComponent.of("worldedit.script.file-not-found", TextComponent.of(filename)));
|
||||
player.print(Caption.of("worldedit.script.file-not-found", TextComponent.of(filename)));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@ -743,7 +743,7 @@ public final class WorldEdit {
|
||||
in.close();
|
||||
script = new String(data, 0, data.length, StandardCharsets.UTF_8);
|
||||
} catch (IOException e) {
|
||||
player.printError(TranslatableComponent.of("worldedit.script.read-error", TextComponent.of(e.getMessage())));
|
||||
player.print(Caption.of("worldedit.script.read-error", TextComponent.of(e.getMessage())));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -756,7 +756,7 @@ public final class WorldEdit {
|
||||
try {
|
||||
engine = new RhinoCraftScriptEngine();
|
||||
} catch (NoClassDefFoundError ignored) {
|
||||
player.printError(TranslatableComponent.of("worldedit.script.no-script-engine"));
|
||||
player.print(Caption.of("worldedit.script.no-script-engine"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -772,13 +772,13 @@ public final class WorldEdit {
|
||||
} catch (ScriptException e) {
|
||||
// non-exceptional return check
|
||||
if (!(Throwables.getRootCause(e) instanceof ReturnException)) {
|
||||
player.printError(TranslatableComponent.of("worldedit.script.failed", TextComponent.of(e.getMessage(), TextColor.WHITE)));
|
||||
player.print(Caption.of("worldedit.script.failed", TextComponent.of(e.getMessage(), TextColor.WHITE)));
|
||||
logger.warn("Failed to execute script", e);
|
||||
}
|
||||
} catch (NumberFormatException | WorldEditException e) {
|
||||
throw e;
|
||||
} catch (Throwable e) {
|
||||
player.printError(TranslatableComponent.of("worldedit.script.failed-console", TextComponent.of(e.getClass().getCanonicalName(),
|
||||
player.print(Caption.of("worldedit.script.failed-console", TextComponent.of(e.getClass().getCanonicalName(),
|
||||
TextColor.WHITE)));
|
||||
logger.warn("Failed to execute script", e);
|
||||
} finally {
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
@ -41,7 +42,6 @@ import com.sk89q.worldedit.internal.expression.Expression;
|
||||
import com.sk89q.worldedit.regions.factory.RegionFactory;
|
||||
import com.sk89q.worldedit.util.TreeGenerator;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextDecoration;
|
||||
import org.enginehub.piston.CommandManager;
|
||||
@ -62,19 +62,19 @@ import static org.enginehub.piston.part.CommandParts.arg;
|
||||
@CommandContainer(superTypes = CommandPermissionsConditionGenerator.Registration.class)
|
||||
public class ApplyBrushCommands {
|
||||
|
||||
private static final CommandArgument REGION_FACTORY = arg(TranslatableComponent.of("shape"), TranslatableComponent.of("worldedit.brush.apply.shape"))
|
||||
private static final CommandArgument REGION_FACTORY = arg(Caption.of("shape"), Caption.of("worldedit.brush.apply.shape"))
|
||||
.defaultsTo(ImmutableList.of())
|
||||
.ofTypes(ImmutableList.of(Key.of(RegionFactory.class)))
|
||||
.build();
|
||||
|
||||
private static final CommandArgument RADIUS = arg(TranslatableComponent.of("radius"), TranslatableComponent.of("worldedit.brush.apply.radius"))
|
||||
private static final CommandArgument RADIUS = arg(Caption.of("radius"), Caption.of("worldedit.brush.apply.radius"))
|
||||
.defaultsTo(ImmutableList.of("5"))
|
||||
.ofTypes(ImmutableList.of(Key.of(double.class)))
|
||||
.build();
|
||||
|
||||
public static void register(CommandManagerService service, CommandManager commandManager, CommandRegistrationHandler registration) {
|
||||
commandManager.register("apply", builder -> {
|
||||
builder.description(TranslatableComponent.of("worldedit.brush.apply.description"));
|
||||
builder.description(Caption.of("worldedit.brush.apply.description"));
|
||||
builder.action(org.enginehub.piston.Command.Action.NULL_ACTION);
|
||||
|
||||
CommandManager manager = service.newCommandManager();
|
||||
@ -86,7 +86,7 @@ public class ApplyBrushCommands {
|
||||
|
||||
builder.condition(new PermissionCondition(ImmutableSet.of("worldedit.brush.apply")));
|
||||
builder.addParts(REGION_FACTORY, RADIUS);
|
||||
builder.addPart(SubCommandPart.builder(TranslatableComponent.of("type"), TranslatableComponent.of("worldedit.brush.apply.type"))
|
||||
builder.addPart(SubCommandPart.builder(Caption.of("type"), Caption.of("worldedit.brush.apply.type"))
|
||||
.withCommands(manager.getAllCommands().collect(Collectors.toList()))
|
||||
.required()
|
||||
.build());
|
||||
@ -126,7 +126,7 @@ public class ApplyBrushCommands {
|
||||
@Direction(includeDiagonals = true)
|
||||
com.sk89q.worldedit.util.Direction direction) throws WorldEditException {
|
||||
player.print(TextComponent.builder().append("WARNING: ", TextColor.RED, TextDecoration.BOLD)
|
||||
.append(TranslatableComponent.of("worldedit.brush.apply.item.warning")).build());
|
||||
.append(Caption.of("worldedit.brush.apply.item.warning")).build());
|
||||
setApplyBrush(parameters, player, localSession, new ItemUseFactory(item, direction));
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
@ -49,7 +50,6 @@ import com.sk89q.worldedit.util.formatting.component.PaginationBox;
|
||||
import com.sk89q.worldedit.util.formatting.component.TextUtils;
|
||||
import com.sk89q.worldedit.util.formatting.text.Component;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.event.HoverEvent;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
@ -124,7 +124,7 @@ public class BiomeCommands {
|
||||
if (useLineOfSight) {
|
||||
Location blockPosition = player.getBlockTrace(300);
|
||||
if (blockPosition == null) {
|
||||
player.printError(TranslatableComponent.of("worldedit.raytrace.noblock"));
|
||||
player.print(Caption.of("worldedit.raytrace.noblock"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@ public class BiomeCommands {
|
||||
HoverEvent.showText(TextComponent.of(biome.getId()))
|
||||
)
|
||||
).collect(Collectors.toList());
|
||||
player.printInfo(TranslatableComponent.of(messageKey, TextUtils.join(components, TextComponent.of(", "))));
|
||||
player.print(Caption.of(messageKey, TextUtils.join(components, TextComponent.of(", "))));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -185,7 +185,7 @@ public class BiomeCommands {
|
||||
RegionVisitor visitor = new RegionVisitor(region, replace);
|
||||
Operations.completeLegacy(visitor);
|
||||
|
||||
player.printInfo(TranslatableComponent.of(
|
||||
player.print(Caption.of(
|
||||
"worldedit.setbiome.changed",
|
||||
TextComponent.of(visitor.getAffected())
|
||||
));
|
||||
|
@ -106,7 +106,6 @@ import com.sk89q.worldedit.util.HandSide;
|
||||
import com.sk89q.worldedit.util.TreeGenerator;
|
||||
import com.sk89q.worldedit.util.formatting.text.Component;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.event.ClickEvent;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
import com.sk89q.worldedit.world.block.BlockID;
|
||||
@ -315,7 +314,7 @@ public class BrushCommands {
|
||||
public void sweepBrush(Player player, InjectedValueAccess context,
|
||||
@Arg(desc = "int", def = "-1")
|
||||
int copies) throws WorldEditException {
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.spline"));
|
||||
player.print(Caption.of("fawe.worldedit.brush.brush.spline"));
|
||||
set(context, new SweepBrush(copies));
|
||||
}
|
||||
|
||||
@ -428,7 +427,7 @@ public class BrushCommands {
|
||||
case BlockID.SAND:
|
||||
case BlockID.GRAVEL:
|
||||
player.print(
|
||||
TranslatableComponent.of("fawe.worldedit.brush.brush.try.other"));
|
||||
Caption.of("fawe.worldedit.brush.brush.try.other"));
|
||||
falling = true;
|
||||
break;
|
||||
default:
|
||||
@ -1111,7 +1110,7 @@ public class BrushCommands {
|
||||
}
|
||||
player.print(Caption.of("fawe.worldedit.schematic.schematic.saved", name));
|
||||
} else {
|
||||
player.printError(TranslatableComponent.of("fawe.worldedit.brush.brush.none"));
|
||||
player.print(Caption.of("fawe.worldedit.brush.brush.none"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1145,7 +1144,7 @@ public class BrushCommands {
|
||||
player.print(Caption.of("fawe.worldedit.brush.brush.equipped", name));
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
player.printError(TranslatableComponent.of("fawe.error.brush.incompatible"));
|
||||
player.print(Caption.of("fawe.error.brush.incompatible"));
|
||||
}
|
||||
} */
|
||||
|
||||
@ -1273,7 +1272,7 @@ public class BrushCommands {
|
||||
tool.setFill(null);
|
||||
tool.setBrush(new OperationFactoryBrush(factory, shape, session), permission);
|
||||
|
||||
player.printInfo(TranslatableComponent.of("worldedit.brush.operation.equip", TextComponent.of(factory.toString())));
|
||||
player.print(Caption.of("worldedit.brush.operation.equip", TextComponent.of(factory.toString())));
|
||||
ToolCommands.sendUnbindInstruction(player, UNBIND_COMMAND_COMPONENT);
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.google.gson.JsonIOException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
@ -86,9 +87,9 @@ public class ChunkCommands {
|
||||
int chunkZ = (int) Math.floor(pos.getBlockZ() / 16.0);
|
||||
|
||||
final BlockVector2 chunkPos = BlockVector2.at(chunkX, chunkZ);
|
||||
player.printInfo(TranslatableComponent.of("worldedit.chunkinfo.chunk", TextComponent.of(chunkX), TextComponent.of(chunkZ)));
|
||||
player.printInfo(TranslatableComponent.of("worldedit.chunkinfo.old-filename", TextComponent.of(LegacyChunkStore.getFilename(chunkPos))));
|
||||
player.printInfo(TranslatableComponent.of("worldedit.chunkinfo.mcregion-filename", TextComponent.of(McRegionChunkStore.getFilename(chunkPos))));
|
||||
player.print(Caption.of("worldedit.chunkinfo.chunk", TextComponent.of(chunkX), TextComponent.of(chunkZ)));
|
||||
player.print(Caption.of("worldedit.chunkinfo.old-filename", TextComponent.of(LegacyChunkStore.getFilename(chunkPos))));
|
||||
player.print(Caption.of("worldedit.chunkinfo.mcregion-filename", TextComponent.of(McRegionChunkStore.getFilename(chunkPos))));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -101,7 +102,7 @@ public class ChunkCommands {
|
||||
@ArgFlag(name = 'p', desc = "Page number.", def = "1") int page) throws WorldEditException {
|
||||
final Region region = session.getSelection(world);
|
||||
|
||||
actor.print(TranslatableComponent.of("worldedit.listchunks.listfor", TextComponent.of(actor.getName())));
|
||||
actor.print(Caption.of("worldedit.listchunks.listfor", TextComponent.of(actor.getName())));
|
||||
actor.print(new ChunkListPaginationBox(region).create(page));
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,6 @@ import com.sk89q.worldedit.regions.selector.CuboidRegionSelector;
|
||||
import com.sk89q.worldedit.session.ClipboardHolder;
|
||||
import com.sk89q.worldedit.util.formatting.text.Component;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.event.ClickEvent;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import org.enginehub.piston.annotation.Command;
|
||||
@ -185,7 +184,7 @@ public class ClipboardCommands {
|
||||
long volume = (((long) max.getX() - (long) min.getX() + 1) * ((long) max.getY() - (long) min.getY() + 1) * ((long) max.getZ() - (long) min.getZ() + 1));
|
||||
FaweLimit limit = actor.getLimit();
|
||||
if (volume >= limit.MAX_CHECKS) {
|
||||
throw new FaweException(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.max.checks"));
|
||||
throw new FaweException(Caption.of("fawe.cancel.worldedit.cancel.reason.max.checks"));
|
||||
}
|
||||
session.setClipboard(null);
|
||||
ReadOnlyClipboard lazyClipboard = ReadOnlyClipboard.of(region, !skipEntities, copyBiomes);
|
||||
@ -224,7 +223,7 @@ public class ClipboardCommands {
|
||||
ReadOnlyClipboard lazyClipboard = new WorldCutClipboard(editSession, region, !skipEntities, copyBiomes);
|
||||
clipboard.setOrigin(session.getPlacementPosition(actor));
|
||||
session.setClipboard(new ClipboardHolder(lazyClipboard));
|
||||
actor.print(TranslatableComponent.of("fawe.worldedit.cut.command.cut.lazy", region.getArea()));
|
||||
actor.print(Caption.of("fawe.worldedit.cut.command.cut.lazy", region.getArea()));
|
||||
}*/
|
||||
|
||||
@Command(
|
||||
@ -289,7 +288,7 @@ public class ClipboardCommands {
|
||||
session.setClipboard(new ClipboardHolder(clipboard));
|
||||
|
||||
if (!actor.hasPermission("fawe.tips")) {
|
||||
actor.print(TranslatableComponent.of("fawe.tips.tip.lazycut"));
|
||||
actor.print(Caption.of("fawe.tips.tip.lazycut"));
|
||||
}
|
||||
copy.getStatusMessages().forEach(actor::print);
|
||||
}
|
||||
@ -384,7 +383,7 @@ public class ClipboardCommands {
|
||||
}
|
||||
}
|
||||
if (url == null) {
|
||||
player.printError(TranslatableComponent.of("fawe.web.generating.link.failed"));
|
||||
player.print(Caption.of("fawe.web.generating.link.failed"));
|
||||
} else {
|
||||
String urlText = url.toString();
|
||||
if (Settings.IMP.WEB.SHORTEN_URLS) {
|
||||
@ -459,9 +458,9 @@ public class ClipboardCommands {
|
||||
}
|
||||
|
||||
if (onlySelect) {
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.paste.selected"));
|
||||
actor.print(Caption.of("worldedit.paste.selected"));
|
||||
} else {
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.paste.pasted", TextComponent.of(to.toString())));
|
||||
actor.print(Caption.of("worldedit.paste.pasted", TextComponent.of(to.toString())));
|
||||
}
|
||||
messages.forEach(actor::print);
|
||||
}
|
||||
@ -474,7 +473,7 @@ public class ClipboardCommands {
|
||||
PasteEvent event = new PasteEvent(player, clipboard, uri, editSession, to);
|
||||
WorldEdit.getInstance().getEventBus().post(event);
|
||||
if (event.isCancelled()) {
|
||||
throw new FaweException(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.manual"));
|
||||
throw new FaweException(Caption.of("fawe.cancel.worldedit.cancel.reason.manual"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -516,7 +515,7 @@ public class ClipboardCommands {
|
||||
actor.print(Caption.of("fawe.worldedit.paste.command.paste", to));
|
||||
|
||||
if (!actor.hasPermission("fawe.tips")) {
|
||||
actor.print(TranslatableComponent.of("fawe.tips.tip.copypaste"));
|
||||
actor.print(Caption.of("fawe.tips.tip.copypaste"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -541,7 +540,7 @@ public class ClipboardCommands {
|
||||
transform = transform.rotateX(-rotateX);
|
||||
transform = transform.rotateZ(-rotateZ);
|
||||
holder.setTransform(transform.combine(holder.getTransform()));
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.rotate.rotated"));
|
||||
actor.print(Caption.of("worldedit.rotate.rotated"));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -556,7 +555,7 @@ public class ClipboardCommands {
|
||||
AffineTransform transform = new AffineTransform();
|
||||
transform = transform.scale(direction.abs().multiply(-2).add(1, 1, 1).toVector3());
|
||||
holder.setTransform(transform.combine(holder.getTransform()));
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.flip.flipped"));
|
||||
actor.print(Caption.of("worldedit.flip.flipped"));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -567,7 +566,7 @@ public class ClipboardCommands {
|
||||
@CommandPermissions("worldedit.clipboard.clear")
|
||||
public void clearClipboard(Actor actor, LocalSession session) throws WorldEditException {
|
||||
session.setClipboard(null);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.clearclipboard.cleared"));
|
||||
actor.print(Caption.of("worldedit.clearclipboard.cleared"));
|
||||
}
|
||||
|
||||
private void saveDiskClipboard(Clipboard clipboard) {
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
@ -33,7 +34,6 @@ import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.regions.RegionOperationException;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import org.enginehub.piston.Command;
|
||||
import org.enginehub.piston.CommandManager;
|
||||
@ -73,7 +73,7 @@ public class ExpandCommands {
|
||||
command.condition(new PermissionCondition(ImmutableSet.of("worldedit.selection.expand")));
|
||||
|
||||
command.addPart(SubCommandPart.builder(
|
||||
TranslatableComponent.of("vert"),
|
||||
Caption.of("vert"),
|
||||
TextComponent.of("Vertical expansion sub-command")
|
||||
)
|
||||
.withCommands(ImmutableSet.of(createVertCommand(commandManager)))
|
||||
@ -88,7 +88,7 @@ public class ExpandCommands {
|
||||
|
||||
private static Command createVertCommand(CommandManager commandManager) {
|
||||
return commandManager.newCommand("vert")
|
||||
.description(TranslatableComponent.of("worldedit.expand.description.vert"))
|
||||
.description(Caption.of("worldedit.expand.description.vert"))
|
||||
.action(parameters -> {
|
||||
expandVert(
|
||||
requireIV(Key.of(LocalSession.class), "localSession", parameters),
|
||||
@ -112,7 +112,7 @@ public class ExpandCommands {
|
||||
session.getRegionSelector(world).explainRegionAdjust(actor, session);
|
||||
long changeSize = newSize - oldSize;
|
||||
actor.printInfo(
|
||||
TranslatableComponent.of("worldedit.expand.expanded.vert", TextComponent.of(changeSize))
|
||||
Caption.of("worldedit.expand.expanded.vert", TextComponent.of(changeSize))
|
||||
);
|
||||
} catch (RegionOperationException e) {
|
||||
actor.printError(TextComponent.of(e.getMessage()));
|
||||
@ -151,7 +151,7 @@ public class ExpandCommands {
|
||||
session.getRegionSelector(world).explainRegionAdjust(actor, session);
|
||||
|
||||
long changeSize = newSize - oldSize;
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.expand.expanded", TextComponent.of(changeSize)));
|
||||
actor.print(Caption.of("worldedit.expand.expanded", TextComponent.of(changeSize)));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ public class GeneralCommands {
|
||||
limit = limit == null ? config.defaultChangeLimit : Math.max(-1, limit);
|
||||
if (!mayDisable && config.maxChangeLimit > -1) {
|
||||
if (limit > config.maxChangeLimit) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.limit.too-high", TextComponent.of(config.maxChangeLimit)));
|
||||
actor.print(Caption.of("worldedit.limit.too-high", TextComponent.of(config.maxChangeLimit)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -199,7 +199,7 @@ public class GeneralCommands {
|
||||
limit = limit == null ? config.calculationTimeout : Math.max(-1, limit);
|
||||
if (!mayDisable && config.maxCalculationTimeout > -1) {
|
||||
if (limit > config.maxCalculationTimeout) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.timeout.too-high", TextComponent.of(config.maxCalculationTimeout)));
|
||||
actor.print(Caption.of("worldedit.timeout.too-high", TextComponent.of(config.maxCalculationTimeout)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -223,16 +223,16 @@ public class GeneralCommands {
|
||||
Boolean fastMode) {
|
||||
boolean hasFastMode = session.hasFastMode();
|
||||
if (fastMode != null && fastMode == hasFastMode) {
|
||||
actor.printError(TranslatableComponent.of(fastMode ? "worldedit.fast.enabled.already" : "worldedit.fast.disabled.already"));
|
||||
actor.print(Caption.of(fastMode ? "worldedit.fast.enabled.already" : "worldedit.fast.disabled.already"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (hasFastMode) {
|
||||
session.setFastMode(false);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.fast.disabled"));
|
||||
actor.print(Caption.of("worldedit.fast.disabled"));
|
||||
} else {
|
||||
session.setFastMode(true);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.fast.enabled"));
|
||||
actor.print(Caption.of("worldedit.fast.enabled"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -254,7 +254,7 @@ public class GeneralCommands {
|
||||
SideEffect.State currentState = session.getSideEffectSet().getState(sideEffect);
|
||||
if (newState != null && newState == currentState) {
|
||||
if (!showInfoBox) {
|
||||
actor.printError(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.perf.sideeffect.already-set",
|
||||
TranslatableComponent.of(sideEffect.getDisplayName()),
|
||||
TranslatableComponent.of(newState.getDisplayName())
|
||||
@ -266,14 +266,14 @@ public class GeneralCommands {
|
||||
if (newState != null) {
|
||||
session.setSideEffectSet(session.getSideEffectSet().with(sideEffect, newState));
|
||||
if (!showInfoBox) {
|
||||
actor.printInfo(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.perf.sideeffect.set",
|
||||
TranslatableComponent.of(sideEffect.getDisplayName()),
|
||||
TranslatableComponent.of(newState.getDisplayName())
|
||||
));
|
||||
}
|
||||
} else {
|
||||
actor.printInfo(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.perf.sideeffect.get",
|
||||
TranslatableComponent.of(sideEffect.getDisplayName()),
|
||||
TranslatableComponent.of(currentState.getDisplayName())
|
||||
@ -286,7 +286,7 @@ public class GeneralCommands {
|
||||
}
|
||||
session.setSideEffectSet(applier);
|
||||
if (!showInfoBox) {
|
||||
actor.printInfo(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.perf.sideeffect.set-all",
|
||||
TranslatableComponent.of(newState.getDisplayName())
|
||||
));
|
||||
@ -308,10 +308,10 @@ public class GeneralCommands {
|
||||
@Arg(desc = "The reorder mode", def = "")
|
||||
EditSession.ReorderMode reorderMode) {
|
||||
if (reorderMode == null) {
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.reorder.current", TextComponent.of(session.getReorderMode().getDisplayName())));
|
||||
actor.print(Caption.of("worldedit.reorder.current", TextComponent.of(session.getReorderMode().getDisplayName())));
|
||||
} else {
|
||||
session.setReorderMode(reorderMode);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.reorder.set", TextComponent.of(session.getReorderMode().getDisplayName())));
|
||||
actor.print(Caption.of("worldedit.reorder.set", TextComponent.of(session.getReorderMode().getDisplayName())));
|
||||
}
|
||||
}
|
||||
|
||||
@ -328,18 +328,18 @@ public class GeneralCommands {
|
||||
}
|
||||
boolean useServerCui = session.shouldUseServerCUI();
|
||||
if (drawSelection != null && drawSelection == useServerCui) {
|
||||
player.printError(TranslatableComponent.of("worldedit.drawsel." + (useServerCui ? "enabled" : "disabled") + ".already"));
|
||||
player.print(Caption.of("worldedit.drawsel." + (useServerCui ? "enabled" : "disabled") + ".already"));
|
||||
|
||||
return;
|
||||
}
|
||||
if (useServerCui) {
|
||||
session.setUseServerCUI(false);
|
||||
session.updateServerCUI(player);
|
||||
player.printInfo(TranslatableComponent.of("worldedit.drawsel.disabled"));
|
||||
player.print(Caption.of("worldedit.drawsel.disabled"));
|
||||
} else {
|
||||
session.setUseServerCUI(true);
|
||||
session.updateServerCUI(player);
|
||||
player.printInfo(TranslatableComponent.of("worldedit.drawsel.enabled"));
|
||||
player.print(Caption.of("worldedit.drawsel.enabled"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -352,9 +352,9 @@ public class GeneralCommands {
|
||||
@Arg(desc = "The world override", def = "") World world) {
|
||||
session.setWorldOverride(world);
|
||||
if (world == null) {
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.world.remove"));
|
||||
actor.print(Caption.of("worldedit.world.remove"));
|
||||
} else {
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.world.set", TextComponent.of(world.getId())));
|
||||
actor.print(Caption.of("worldedit.world.set", TextComponent.of(world.getId())));
|
||||
}
|
||||
}
|
||||
|
||||
@ -369,16 +369,16 @@ public class GeneralCommands {
|
||||
@Arg(desc = "The mode to set the watchdog hook to", def = "")
|
||||
HookMode hookMode) {
|
||||
if (WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getWatchdog() == null) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.watchdog.no-hook"));
|
||||
actor.print(Caption.of("worldedit.watchdog.no-hook"));
|
||||
return;
|
||||
}
|
||||
boolean previousMode = session.isTickingWatchdog();
|
||||
if (hookMode != null && (hookMode == HookMode.ACTIVE) == previousMode) {
|
||||
actor.printError(TranslatableComponent.of(previousMode ? "worldedit.watchdog.active.already" : "worldedit.watchdog.inactive.already"));
|
||||
actor.print(Caption.of(previousMode ? "worldedit.watchdog.active.already" : "worldedit.watchdog.inactive.already"));
|
||||
return;
|
||||
}
|
||||
session.setTickingWatchdog(!previousMode);
|
||||
actor.printInfo(TranslatableComponent.of(previousMode ? "worldedit.watchdog.inactive" : "worldedit.watchdog.active"));
|
||||
actor.print(Caption.of(previousMode ? "worldedit.watchdog.inactive" : "worldedit.watchdog.active"));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -392,10 +392,10 @@ public class GeneralCommands {
|
||||
Mask mask) {
|
||||
if (mask == null) {
|
||||
session.setMask(null);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.gmask.disabled"));
|
||||
actor.print(Caption.of("worldedit.gmask.disabled"));
|
||||
} else {
|
||||
session.setMask(mask);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.gmask.set"));
|
||||
actor.print(Caption.of("worldedit.gmask.set"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -407,9 +407,9 @@ public class GeneralCommands {
|
||||
@CommandPermissions("worldedit.toggleplace")
|
||||
public void togglePlace(Player player, LocalSession session) {
|
||||
if (session.togglePlacementPosition()) {
|
||||
player.printInfo(TranslatableComponent.of("worldedit.toggleplace.pos1"));
|
||||
player.print(Caption.of("worldedit.toggleplace.pos1"));
|
||||
} else {
|
||||
player.printInfo(TranslatableComponent.of("worldedit.toggleplace.player"));
|
||||
player.print(Caption.of("worldedit.toggleplace.player"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -430,11 +430,11 @@ public class GeneralCommands {
|
||||
List<String> query) {
|
||||
String search = String.join(" ", query);
|
||||
if (search.length() <= 2) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.searchitem.too-short"));
|
||||
actor.print(Caption.of("worldedit.searchitem.too-short"));
|
||||
return;
|
||||
}
|
||||
if (blocksOnly && itemsOnly) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.searchitem.either-b-or-i"));
|
||||
actor.print(Caption.of("worldedit.searchitem.either-b-or-i"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,6 @@ import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.util.TreeGenerator.TreeType;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BlockType;
|
||||
import org.enginehub.piston.annotation.Command;
|
||||
@ -239,7 +238,7 @@ public class GenerationCommands {
|
||||
break;
|
||||
|
||||
default:
|
||||
actor.printError(TranslatableComponent.of("worldedit.cyl.invalid-radius"));
|
||||
actor.print(Caption.of("worldedit.cyl.invalid-radius"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -249,7 +248,7 @@ public class GenerationCommands {
|
||||
|
||||
BlockVector3 pos = session.getPlacementPosition(actor);
|
||||
int affected = editSession.makeCylinder(pos, pattern, radiusX, radiusZ, height, !hollow);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.cyl.created", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.cyl.created", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -301,7 +300,7 @@ public class GenerationCommands {
|
||||
break;
|
||||
|
||||
default:
|
||||
actor.printError(TranslatableComponent.of("worldedit.sphere.invalid-radius"));
|
||||
actor.print(Caption.of("worldedit.sphere.invalid-radius"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -317,7 +316,7 @@ public class GenerationCommands {
|
||||
if (actor instanceof Player) {
|
||||
((Player) actor).findFreePosition();
|
||||
}
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.sphere.created", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.sphere.created", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -339,7 +338,7 @@ public class GenerationCommands {
|
||||
worldEdit.checkMaxRadius(size);
|
||||
density /= 100;
|
||||
int affected = editSession.makeForest(session.getPlacementPosition(actor), size, density, type);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.forestgen.created", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.forestgen.created", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -358,7 +357,7 @@ public class GenerationCommands {
|
||||
checkCommandArgument(0 <= density && density <= 100, "Density must be between 0 and 100");
|
||||
worldEdit.checkMaxRadius(size);
|
||||
int affected = editSession.makePumpkinPatches(session.getPlacementPosition(actor), size, density);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.pumpkins.created", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.pumpkins.created", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -395,7 +394,7 @@ public class GenerationCommands {
|
||||
if (actor instanceof Player) {
|
||||
((Player) actor).findFreePosition();
|
||||
}
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.pyramid.created", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.pyramid.created", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -463,7 +462,7 @@ public class GenerationCommands {
|
||||
if (actor instanceof Player) {
|
||||
((Player) actor).findFreePosition();
|
||||
}
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.generate.created", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.generate.created", TextComponent.of(affected)));
|
||||
return affected;
|
||||
} catch (ExpressionException e) {
|
||||
actor.printError(TextComponent.of(e.getMessage()));
|
||||
@ -532,7 +531,7 @@ public class GenerationCommands {
|
||||
final Vector3 unit1 = unit;
|
||||
try {
|
||||
final int affected = editSession.makeBiomeShape(region, zero, unit1, target, String.join(" ", expression), hollow, session.getTimeout());
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.generatebiome.changed", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.generatebiome.changed", TextComponent.of(affected)));
|
||||
return affected;
|
||||
} catch (ExpressionException e) {
|
||||
actor.printError(TextComponent.of(e.getMessage()));
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
@ -30,7 +31,6 @@ import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import org.enginehub.piston.annotation.Command;
|
||||
import org.enginehub.piston.annotation.CommandContainer;
|
||||
import org.enginehub.piston.annotation.param.Arg;
|
||||
@ -69,14 +69,14 @@ public class HistoryCommands {
|
||||
times = Math.max(1, times);
|
||||
LocalSession undoSession = session;
|
||||
if (session.hasFastMode()) {
|
||||
actor.print(TranslatableComponent.of("fawe.worldedit.history.command.undo.disabled"));
|
||||
actor.print(Caption.of("fawe.worldedit.history.command.undo.disabled"));
|
||||
return;
|
||||
}
|
||||
if (playerName != null) {
|
||||
actor.checkPermission("worldedit.history.undo.other");
|
||||
undoSession = worldEdit.getSessionManager().findByName(playerName);
|
||||
if (undoSession == null) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.session.cant-find-session", TextComponent.of(playerName)));
|
||||
actor.print(Caption.of("worldedit.session.cant-find-session", TextComponent.of(playerName)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -92,9 +92,9 @@ public class HistoryCommands {
|
||||
}
|
||||
}
|
||||
if (timesUndone > 0) {
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.undo.undone", TextComponent.of(timesUndone)));
|
||||
actor.print(Caption.of("worldedit.undo.undone", TextComponent.of(timesUndone)));
|
||||
} else {
|
||||
actor.printError(TranslatableComponent.of("worldedit.undo.none"));
|
||||
actor.print(Caption.of("worldedit.undo.none"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ public class HistoryCommands {
|
||||
actor.checkPermission("worldedit.history.redo.other");
|
||||
redoSession = worldEdit.getSessionManager().findByName(playerName);
|
||||
if (redoSession == null) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.session.cant-find-session", TextComponent.of(playerName)));
|
||||
actor.print(Caption.of("worldedit.session.cant-find-session", TextComponent.of(playerName)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -131,9 +131,9 @@ public class HistoryCommands {
|
||||
}
|
||||
}
|
||||
if (timesRedone > 0) {
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.redo.redone", TextComponent.of(timesRedone)));
|
||||
actor.print(Caption.of("worldedit.redo.redone", TextComponent.of(timesRedone)));
|
||||
} else {
|
||||
actor.printError(TranslatableComponent.of("worldedit.redo.none"));
|
||||
actor.print(Caption.of("worldedit.redo.none"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ public class HistoryCommands {
|
||||
@CommandPermissions("worldedit.history.clear")
|
||||
public void clearHistory(Actor actor, LocalSession session) {
|
||||
session.clearHistory();
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.clearhistory.cleared"));
|
||||
actor.print(Caption.of("worldedit.clearhistory.cleared"));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -221,7 +221,7 @@ public class HistorySubCommands {
|
||||
Integer index) throws WorldEditException, ExecutionException, InterruptedException {
|
||||
RollbackOptimizedHistory edit = database.getEdit(other, index).get();
|
||||
if (edit == null) {
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.schematic.schematic.none"));
|
||||
player.print(Caption.of("fawe.worldedit.schematic.schematic.none"));
|
||||
return;
|
||||
}
|
||||
Location origin = player.getLocation();
|
||||
@ -341,10 +341,10 @@ public class HistorySubCommands {
|
||||
return;
|
||||
}
|
||||
if (other == null && radius == 0 && timeDiff == 0) {
|
||||
throw new InsufficientArgumentsException(TranslatableComponent.of("fawe.error.invalid-user"));
|
||||
throw new InsufficientArgumentsException(Caption.of("fawe.error.invalid-user"));
|
||||
}
|
||||
checkCommandArgument(radius > 0, TranslatableComponent.of("fawe.error.radius-too-small"));
|
||||
checkCommandArgument(timeDiff > 0, TranslatableComponent.of("fawe.error.time-too-less"));
|
||||
checkCommandArgument(radius > 0, Caption.of("fawe.error.radius-too-small"));
|
||||
checkCommandArgument(timeDiff > 0, Caption.of("fawe.error.time-too-less"));
|
||||
|
||||
Location origin = player.getLocation();
|
||||
String pageCommand = "/" + arguments.get().replaceAll("-p [0-9]+", "").trim();
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
@ -67,7 +68,7 @@ class LegacySnapshotCommands {
|
||||
if (!snapshots.isEmpty()) {
|
||||
actor.print(new SnapshotListBox(world.getName(), snapshots).create(page));
|
||||
} else {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.none-found-console"));
|
||||
actor.print(Caption.of("worldedit.restore.none-found-console"));
|
||||
|
||||
// Okay, let's toss some debugging information!
|
||||
File dir = config.snapshotRepo.getDirectory();
|
||||
@ -82,7 +83,7 @@ class LegacySnapshotCommands {
|
||||
}
|
||||
}
|
||||
} catch (MissingWorldException ex) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world"));
|
||||
actor.print(Caption.of("worldedit.restore.none-for-world"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,19 +97,19 @@ class LegacySnapshotCommands {
|
||||
|
||||
if (snapshot != null) {
|
||||
session.setSnapshot(null);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.snapshot.use.newest"));
|
||||
actor.print(Caption.of("worldedit.snapshot.use.newest"));
|
||||
} else {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.none-found"));
|
||||
actor.print(Caption.of("worldedit.restore.none-found"));
|
||||
}
|
||||
} catch (MissingWorldException ex) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world"));
|
||||
actor.print(Caption.of("worldedit.restore.none-for-world"));
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
session.setSnapshot(config.snapshotRepo.getSnapshot(name));
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.snapshot.use", TextComponent.of(name)));
|
||||
actor.print(Caption.of("worldedit.snapshot.use", TextComponent.of(name)));
|
||||
} catch (InvalidSnapshotException e) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.not-available"));
|
||||
actor.print(Caption.of("worldedit.restore.not-available"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -117,25 +118,25 @@ class LegacySnapshotCommands {
|
||||
LocalConfiguration config = we.getConfiguration();
|
||||
|
||||
if (index < 1) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.snapshot.index-above-0"));
|
||||
actor.print(Caption.of("worldedit.snapshot.index-above-0"));
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
List<Snapshot> snapshots = config.snapshotRepo.getSnapshots(true, world.getName());
|
||||
if (snapshots.size() < index) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.snapshot.index-oob", TextComponent.of(snapshots.size())));
|
||||
actor.print(Caption.of("worldedit.snapshot.index-oob", TextComponent.of(snapshots.size())));
|
||||
return;
|
||||
}
|
||||
Snapshot snapshot = snapshots.get(index - 1);
|
||||
if (snapshot == null) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.not-available"));
|
||||
actor.print(Caption.of("worldedit.restore.not-available"));
|
||||
return;
|
||||
}
|
||||
session.setSnapshot(snapshot);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.snapshot.use", TextComponent.of(snapshot.getName())));
|
||||
actor.print(Caption.of("worldedit.snapshot.use", TextComponent.of(snapshot.getName())));
|
||||
} catch (MissingWorldException e) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world"));
|
||||
actor.print(Caption.of("worldedit.restore.none-for-world"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -146,16 +147,16 @@ class LegacySnapshotCommands {
|
||||
Snapshot snapshot = config.snapshotRepo.getSnapshotBefore(date, world.getName());
|
||||
|
||||
if (snapshot == null) {
|
||||
actor.printError(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.snapshot.none-before",
|
||||
TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date)))
|
||||
);
|
||||
} else {
|
||||
session.setSnapshot(snapshot);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.snapshot.use", TextComponent.of(snapshot.getName())));
|
||||
actor.print(Caption.of("worldedit.snapshot.use", TextComponent.of(snapshot.getName())));
|
||||
}
|
||||
} catch (MissingWorldException ex) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world"));
|
||||
actor.print(Caption.of("worldedit.restore.none-for-world"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -165,16 +166,16 @@ class LegacySnapshotCommands {
|
||||
try {
|
||||
Snapshot snapshot = config.snapshotRepo.getSnapshotAfter(date, world.getName());
|
||||
if (snapshot == null) {
|
||||
actor.printError(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.snapshot.none-after",
|
||||
TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date)))
|
||||
);
|
||||
} else {
|
||||
session.setSnapshot(snapshot);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.snapshot.use", TextComponent.of(snapshot.getName())));
|
||||
actor.print(Caption.of("worldedit.snapshot.use", TextComponent.of(snapshot.getName())));
|
||||
}
|
||||
} catch (MissingWorldException ex) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world"));
|
||||
actor.print(Caption.of("worldedit.restore.none-for-world"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
@ -58,7 +59,7 @@ class LegacySnapshotUtilCommands {
|
||||
try {
|
||||
snapshot = config.snapshotRepo.getSnapshot(snapshotName);
|
||||
} catch (InvalidSnapshotException e) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.not-available"));
|
||||
actor.print(Caption.of("worldedit.restore.not-available"));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@ -71,7 +72,7 @@ class LegacySnapshotUtilCommands {
|
||||
snapshot = config.snapshotRepo.getDefaultSnapshot(world.getName());
|
||||
|
||||
if (snapshot == null) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.none-found-console"));
|
||||
actor.print(Caption.of("worldedit.restore.none-found-console"));
|
||||
|
||||
// Okay, let's toss some debugging information!
|
||||
File dir = config.snapshotRepo.getDirectory();
|
||||
@ -88,7 +89,7 @@ class LegacySnapshotUtilCommands {
|
||||
return;
|
||||
}
|
||||
} catch (MissingWorldException ex) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world"));
|
||||
actor.print(Caption.of("worldedit.restore.none-for-world"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -98,9 +99,9 @@ class LegacySnapshotUtilCommands {
|
||||
// Load chunk store
|
||||
try {
|
||||
chunkStore = snapshot.getChunkStore();
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.restore.loaded", TextComponent.of(snapshot.getName())));
|
||||
actor.print(Caption.of("worldedit.restore.loaded", TextComponent.of(snapshot.getName())));
|
||||
} catch (DataException | IOException e) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.failed", TextComponent.of(e.getMessage())));
|
||||
actor.print(Caption.of("worldedit.restore.failed", TextComponent.of(e.getMessage())));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -114,15 +115,15 @@ class LegacySnapshotUtilCommands {
|
||||
if (restore.hadTotalFailure()) {
|
||||
String error = restore.getLastErrorMessage();
|
||||
if (!restore.getMissingChunks().isEmpty()) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.chunk-not-present"));
|
||||
actor.print(Caption.of("worldedit.restore.chunk-not-present"));
|
||||
} else if (error != null) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.block-place-failed"));
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.block-place-error", TextComponent.of(error)));
|
||||
actor.print(Caption.of("worldedit.restore.block-place-failed"));
|
||||
actor.print(Caption.of("worldedit.restore.block-place-error", TextComponent.of(error)));
|
||||
} else {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.chunk-load-failed"));
|
||||
actor.print(Caption.of("worldedit.restore.chunk-load-failed"));
|
||||
}
|
||||
} else {
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.restore.restored",
|
||||
actor.print(Caption.of("worldedit.restore.restored",
|
||||
TextComponent.of(restore.getMissingChunks().size()),
|
||||
TextComponent.of(restore.getErrorChunks().size())));
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
@ -63,7 +64,7 @@ public class NavigationCommands {
|
||||
@CommandPermissions("worldedit.navigation.unstuck")
|
||||
public void unstuck(Player player) throws WorldEditException {
|
||||
player.findFreePosition();
|
||||
player.printInfo(TranslatableComponent.of("worldedit.unstuck.moved"));
|
||||
player.print(Caption.of("worldedit.unstuck.moved"));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -83,9 +84,9 @@ public class NavigationCommands {
|
||||
}
|
||||
}
|
||||
if (ascentLevels == 0) {
|
||||
player.printError(TranslatableComponent.of("worldedit.ascend.obstructed"));
|
||||
player.print(Caption.of("worldedit.ascend.obstructed"));
|
||||
} else {
|
||||
player.printInfo(TranslatableComponent.of("worldedit.ascend.moved", TextComponent.of(ascentLevels)));
|
||||
player.print(Caption.of("worldedit.ascend.moved", TextComponent.of(ascentLevels)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,9 +107,9 @@ public class NavigationCommands {
|
||||
}
|
||||
}
|
||||
if (descentLevels == 0) {
|
||||
player.printError(TranslatableComponent.of("worldedit.descend.obstructed"));
|
||||
player.print(Caption.of("worldedit.descend.obstructed"));
|
||||
} else {
|
||||
player.printInfo(TranslatableComponent.of("worldedit.descend.moved", TextComponent.of(descentLevels)));
|
||||
player.print(Caption.of("worldedit.descend.moved", TextComponent.of(descentLevels)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -130,9 +131,9 @@ public class NavigationCommands {
|
||||
|
||||
boolean alwaysGlass = getAlwaysGlass(forceFlight, forceGlass);
|
||||
if (player.ascendToCeiling(clearance, alwaysGlass)) {
|
||||
player.printInfo(TranslatableComponent.of("worldedit.ceil.moved"));
|
||||
player.print(Caption.of("worldedit.ceil.moved"));
|
||||
} else {
|
||||
player.printError(TranslatableComponent.of("worldedit.ceil.obstructed"));
|
||||
player.print(Caption.of("worldedit.ceil.obstructed"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,9 +145,9 @@ public class NavigationCommands {
|
||||
@CommandPermissions("worldedit.navigation.thru.command")
|
||||
public void thru(Player player) throws WorldEditException {
|
||||
if (player.passThroughForwardWall(6)) {
|
||||
player.printInfo(TranslatableComponent.of("worldedit.thru.moved"));
|
||||
player.print(Caption.of("worldedit.thru.moved"));
|
||||
} else {
|
||||
player.printError(TranslatableComponent.of("worldedit.thru.obstructed"));
|
||||
player.print(Caption.of("worldedit.thru.obstructed"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -167,9 +168,9 @@ public class NavigationCommands {
|
||||
}
|
||||
if (pos != null) {
|
||||
player.findFreePosition(pos);
|
||||
player.printInfo(TranslatableComponent.of("worldedit.jumpto.moved"));
|
||||
player.print(Caption.of("worldedit.jumpto.moved"));
|
||||
} else {
|
||||
player.printError(TranslatableComponent.of("worldedit.jumpto.none"));
|
||||
player.print(Caption.of("worldedit.jumpto.none"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -189,9 +190,9 @@ public class NavigationCommands {
|
||||
boolean forceGlass) throws WorldEditException {
|
||||
boolean alwaysGlass = getAlwaysGlass(forceFlight, forceGlass);
|
||||
if (player.ascendUpwards(distance, alwaysGlass)) {
|
||||
player.printInfo(TranslatableComponent.of("worldedit.up.moved"));
|
||||
player.print(Caption.of("worldedit.up.moved"));
|
||||
} else {
|
||||
player.printError(TranslatableComponent.of("worldedit.up.obstructed"));
|
||||
player.print(Caption.of("worldedit.up.obstructed"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ public class RegionCommands {
|
||||
Pattern pattern) {
|
||||
int affected = editSession.setBlocks(region, pattern);
|
||||
if (affected != 0) {
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.set.done"));
|
||||
actor.print(Caption.of("worldedit.set.done"));
|
||||
}
|
||||
return affected;
|
||||
}
|
||||
@ -194,14 +194,14 @@ public class RegionCommands {
|
||||
public void nbtinfo(Player player, EditSession editSession) {
|
||||
Location pos = player.getBlockTrace(128);
|
||||
if (pos == null) {
|
||||
player.printError(TranslatableComponent.of("fawe.navigation.no.block"));
|
||||
player.print(Caption.of("fawe.navigation.no.block"));
|
||||
return;
|
||||
}
|
||||
CompoundTag nbt = editSession.getFullBlock(pos.toBlockPoint()).getNbtData();
|
||||
if (nbt != null) {
|
||||
player.print(TextComponent.of(nbt.getValue().toString()));
|
||||
} else {
|
||||
player.printError(TranslatableComponent.of("fawe.navigation.no.block"));
|
||||
player.print(Caption.of("fawe.navigation.no.block"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ public class RegionCommands {
|
||||
@Switch(name = 'h', desc = "Generate only a shell")
|
||||
boolean shell) throws WorldEditException {
|
||||
if (!(region instanceof CuboidRegion)) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.line.cuboid-only"));
|
||||
actor.print(Caption.of("worldedit.line.cuboid-only"));
|
||||
return 0;
|
||||
}
|
||||
checkCommandArgument(thickness >= 0, "Thickness must be >= 0");
|
||||
@ -250,7 +250,7 @@ public class RegionCommands {
|
||||
BlockVector3 pos2 = cuboidregion.getPos2();
|
||||
int blocksChanged = editSession.drawLine(pattern, pos1, pos2, thickness, !shell);
|
||||
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.line.changed", TextComponent.of(blocksChanged)));
|
||||
actor.print(Caption.of("worldedit.line.changed", TextComponent.of(blocksChanged)));
|
||||
return blocksChanged;
|
||||
}
|
||||
|
||||
@ -271,7 +271,7 @@ public class RegionCommands {
|
||||
@Switch(name = 'h', desc = "Generate only a shell")
|
||||
boolean shell) throws WorldEditException {
|
||||
if (!(region instanceof ConvexPolyhedralRegion)) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.curve.invalid-type"));
|
||||
actor.print(Caption.of("worldedit.curve.invalid-type"));
|
||||
return 0;
|
||||
}
|
||||
checkCommandArgument(thickness >= 0, "Thickness must be >= 0");
|
||||
@ -281,7 +281,7 @@ public class RegionCommands {
|
||||
|
||||
int blocksChanged = editSession.drawSpline(pattern, vectors, 0, 0, 0, 10, thickness, !shell);
|
||||
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.curve.changed", TextComponent.of(blocksChanged)));
|
||||
actor.print(Caption.of("worldedit.curve.changed", TextComponent.of(blocksChanged)));
|
||||
return blocksChanged;
|
||||
}
|
||||
|
||||
@ -305,7 +305,7 @@ public class RegionCommands {
|
||||
((AbstractExtentMask) from).setExtent(editSession);
|
||||
}
|
||||
int affected = editSession.replaceBlocks(region, from, to);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.replace.replaced", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.replace.replaced", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -320,7 +320,7 @@ public class RegionCommands {
|
||||
@Arg(desc = "The pattern of blocks to overlay")
|
||||
Pattern pattern) throws WorldEditException {
|
||||
int affected = editSession.overlayCuboidBlocks(region, pattern);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.overlay.overlaid", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.overlay.overlaid", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -360,7 +360,7 @@ public class RegionCommands {
|
||||
@Arg(desc = "The pattern of blocks to set")
|
||||
Pattern pattern) throws WorldEditException {
|
||||
int affected = editSession.center(region, pattern);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.center.changed", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.center.changed", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -373,7 +373,7 @@ public class RegionCommands {
|
||||
@Confirm(Confirm.Processor.REGION)
|
||||
public int naturalize(Actor actor, EditSession editSession, @Selection Region region) throws WorldEditException {
|
||||
int affected = editSession.naturalizeCuboidBlocks(region);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.naturalize.naturalized", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.naturalize.naturalized", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -388,7 +388,7 @@ public class RegionCommands {
|
||||
@Arg(desc = "The pattern of blocks to set")
|
||||
Pattern pattern) throws WorldEditException {
|
||||
int affected = editSession.makeWalls(region, pattern);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.walls.changed", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.walls.changed", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -404,7 +404,7 @@ public class RegionCommands {
|
||||
@Arg(desc = "The pattern of blocks to set")
|
||||
Pattern pattern) throws WorldEditException {
|
||||
int affected = editSession.makeCuboidFaces(region, pattern);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.faces.changed", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.faces.changed", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -435,7 +435,7 @@ public class RegionCommands {
|
||||
HeightMap heightMap = new HeightMap(editSession, region, mask, snow);
|
||||
HeightMapFilter filter = new HeightMapFilter(new GaussianKernel(5, 1.0));
|
||||
affected = heightMap.applyFilter(filter, iterations);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.smooth.changed", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.smooth.changed", TextComponent.of(affected)));
|
||||
} catch (Throwable e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@ -451,9 +451,9 @@ public class RegionCommands {
|
||||
@CommandPermissions("fawe.admin")
|
||||
public void wea(Actor actor) throws WorldEditException {
|
||||
if (actor.togglePermission("fawe.bypass")) {
|
||||
actor.print(TranslatableComponent.of("fawe.info.worldedit.bypassed"));
|
||||
actor.print(Caption.of("fawe.info.worldedit.bypassed"));
|
||||
} else {
|
||||
actor.print(TranslatableComponent.of("fawe.info.worldedit.restricted"));
|
||||
actor.print(Caption.of("fawe.info.worldedit.restricted"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -528,7 +528,7 @@ public class RegionCommands {
|
||||
}
|
||||
}
|
||||
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.move.moved", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.move.moved", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -602,7 +602,7 @@ public class RegionCommands {
|
||||
}
|
||||
}
|
||||
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.stack.changed", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.stack.changed", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -628,7 +628,7 @@ public class RegionCommands {
|
||||
try {
|
||||
session.setMask(null);
|
||||
session.setSourceMask(null);
|
||||
actor.printInfo(TranslatableComponent.of("fawe.regen.time"));
|
||||
actor.print(Caption.of("fawe.regen.time"));
|
||||
RegenOptions options = RegenOptions.builder()
|
||||
.seed(seed)
|
||||
.regenBiomes(regenBiomes)
|
||||
@ -640,9 +640,9 @@ public class RegionCommands {
|
||||
session.setSourceMask(mask);
|
||||
}
|
||||
if (success) {
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.regen.regenerated"));
|
||||
actor.print(Caption.of("worldedit.regen.regenerated"));
|
||||
} else {
|
||||
actor.printError(TranslatableComponent.of("worldedit.regen.failed"));
|
||||
actor.print(Caption.of("worldedit.regen.failed"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -705,7 +705,7 @@ public class RegionCommands {
|
||||
if (actor instanceof Player) {
|
||||
((Player) actor).findFreePosition();
|
||||
}
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.deform.deformed", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.deform.deformed", TextComponent.of(affected)));
|
||||
return affected;
|
||||
} catch (ExpressionException e) {
|
||||
actor.printError(TextComponent.of(e.getMessage()));
|
||||
@ -735,7 +735,7 @@ public class RegionCommands {
|
||||
Mask finalMask = mask == null ? new SolidBlockMask(editSession) : mask;
|
||||
|
||||
int affected = editSession.hollowOutRegion(region, thickness, pattern, finalMask);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.hollow.changed", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.hollow.changed", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -753,7 +753,7 @@ public class RegionCommands {
|
||||
double density) throws WorldEditException {
|
||||
checkCommandArgument(0 <= density && density <= 100, "Density must be in [0, 100]");
|
||||
int affected = editSession.makeForest(region, density / 100, type);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.forest.created", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.forest.created", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -776,7 +776,7 @@ public class RegionCommands {
|
||||
Operations.completeLegacy(visitor);
|
||||
|
||||
int affected = ground.getAffected();
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.flora.created", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.flora.created", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,6 @@ import com.sk89q.worldedit.util.formatting.component.PaginationBox;
|
||||
import com.sk89q.worldedit.util.formatting.component.TextComponentProducer;
|
||||
import com.sk89q.worldedit.util.formatting.text.Component;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.event.ClickEvent;
|
||||
import com.sk89q.worldedit.util.formatting.text.event.HoverEvent;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
@ -176,7 +175,7 @@ public class SchematicCommands {
|
||||
@CommandPermissions({"worldedit.clipboard.clear", "worldedit.schematic.clear"})
|
||||
public void clear(Player player, LocalSession session) throws WorldEditException {
|
||||
session.setClipboard(null);
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.clipboard.clipboard.cleared"));
|
||||
player.print(Caption.of("fawe.worldedit.clipboard.clipboard.cleared"));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -208,7 +207,7 @@ public class SchematicCommands {
|
||||
} else {
|
||||
session.setClipboard(null);
|
||||
}
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.clipboard.clipboard.cleared"));
|
||||
player.print(Caption.of("fawe.worldedit.clipboard.clipboard.cleared"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -262,7 +261,7 @@ public class SchematicCommands {
|
||||
}
|
||||
file = actor.openFileOpenDialog(extensions);
|
||||
if (file == null || !file.exists()) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.schematic.load.does-not-exist", TextComponent.of(filename)));
|
||||
actor.print(Caption.of("worldedit.schematic.load.does-not-exist", TextComponent.of(filename)));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@ -291,7 +290,7 @@ public class SchematicCommands {
|
||||
if (format == null) {
|
||||
format = ClipboardFormats.findByFile(file);
|
||||
if (format == null) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.schematic.unknown-format", TextComponent.of(formatName)));
|
||||
actor.print(Caption.of("worldedit.schematic.unknown-format", TextComponent.of(formatName)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -339,7 +338,7 @@ public class SchematicCommands {
|
||||
|
||||
ClipboardFormat format = ClipboardFormats.findByAlias(formatName);
|
||||
if (format == null) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.schematic.unknown-format", TextComponent.of(formatName)));
|
||||
actor.print(Caption.of("worldedit.schematic.unknown-format", TextComponent.of(formatName)));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -370,7 +369,7 @@ public class SchematicCommands {
|
||||
}
|
||||
}
|
||||
if (!allowOverwrite) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.schematic.save.already-exists"));
|
||||
actor.print(Caption.of("worldedit.schematic.save.already-exists"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -379,7 +378,7 @@ public class SchematicCommands {
|
||||
File parent = f.getParentFile();
|
||||
if (parent != null && !parent.exists()) {
|
||||
if (!parent.mkdirs()) {
|
||||
throw new StopExecutionException(TranslatableComponent.of(
|
||||
throw new StopExecutionException(Caption.of(
|
||||
"worldedit.schematic.save.failed-directory"));
|
||||
}
|
||||
}
|
||||
@ -389,7 +388,7 @@ public class SchematicCommands {
|
||||
SchematicSaveTask task = new SchematicSaveTask(actor, f, dir, format, holder, overwrite);
|
||||
AsyncCommandBuilder.wrap(task, actor)
|
||||
.registerWithSupervisor(worldEdit.getSupervisor(), "Saving schematic " + filename)
|
||||
.sendMessageAfterDelay(TranslatableComponent.of("worldedit.schematic.save.saving"))
|
||||
.sendMessageAfterDelay(Caption.of("worldedit.schematic.save.saving"))
|
||||
.onSuccess(filename + " saved" + (overwrite ? " (overwriting previous file)." : "."), null)
|
||||
.onFailure("Failed to save schematic", worldEdit.getPlatformManager().getPlatformCommandManager().getExceptionConverter())
|
||||
.buildAndExec(worldEdit.getExecutorService());
|
||||
@ -417,7 +416,7 @@ public class SchematicCommands {
|
||||
ClipboardHolder clipboard = session.getClipboard();
|
||||
List<File> sources = getFiles(clipboard);
|
||||
if (sources.isEmpty()) {
|
||||
player.printError(TranslatableComponent.of("fawe.worldedit.schematic.schematic.none"));
|
||||
player.print(Caption.of("fawe.worldedit.schematic.schematic.none"));
|
||||
return;
|
||||
}
|
||||
if (!destDir.exists() && !destDir.mkdirs()) {
|
||||
@ -470,7 +469,7 @@ public class SchematicCommands {
|
||||
)
|
||||
@CommandPermissions("worldedit.schematic.formats")
|
||||
public void formats(Actor actor) {
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.schematic.formats.title"));
|
||||
actor.print(Caption.of("worldedit.schematic.formats.title"));
|
||||
StringBuilder builder;
|
||||
boolean first = true;
|
||||
for (ClipboardFormat format : ClipboardFormats.getAll()) {
|
||||
@ -654,12 +653,12 @@ public class SchematicCommands {
|
||||
}
|
||||
|
||||
if (files.isEmpty()) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.schematic.delete.does-not-exist", TextComponent.of(filename)));
|
||||
actor.print(Caption.of("worldedit.schematic.delete.does-not-exist", TextComponent.of(filename)));
|
||||
return;
|
||||
}
|
||||
for (File f : files) {
|
||||
if (!MainUtil.isInSubDirectory(working, f) || !f.exists()) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.schematic.delete.does-not-exist", TextComponent.of(filename)));
|
||||
actor.print(Caption.of("worldedit.schematic.delete.does-not-exist", TextComponent.of(filename)));
|
||||
continue;
|
||||
}
|
||||
if (Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS && !MainUtil.isInSubDirectory(dir, f) && !actor.hasPermission("worldedit.schematic.delete.other")) {
|
||||
@ -667,7 +666,7 @@ public class SchematicCommands {
|
||||
continue;
|
||||
}
|
||||
if (!deleteFile(f)) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.schematic.delete.failed", TextComponent.of(filename)));
|
||||
actor.print(Caption.of("worldedit.schematic.delete.failed", TextComponent.of(filename)));
|
||||
continue;
|
||||
}
|
||||
actor.print(Caption.of("worldedit.schematic.delete.deleted", filename));
|
||||
@ -862,7 +861,7 @@ public class SchematicCommands {
|
||||
}
|
||||
LOGGER.info(actor.getName() + " saved " + file.getCanonicalPath());
|
||||
} else {
|
||||
actor.printError(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.manual"));
|
||||
actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason.manual"));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
@ -26,7 +27,6 @@ import com.sk89q.worldedit.command.util.CommandPermissions;
|
||||
import com.sk89q.worldedit.command.util.CommandPermissionsConditionGenerator;
|
||||
import com.sk89q.worldedit.command.util.Logging;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import org.enginehub.piston.annotation.Command;
|
||||
import org.enginehub.piston.annotation.CommandContainer;
|
||||
import org.enginehub.piston.annotation.param.Arg;
|
||||
@ -70,7 +70,7 @@ public class ScriptingCommands {
|
||||
@Arg(desc = "Arguments to the CraftScript", def = "", variable = true)
|
||||
List<String> args) throws WorldEditException {
|
||||
if (!player.hasPermission("worldedit.scripting.execute." + filename)) {
|
||||
player.printError(TranslatableComponent.of("worldedit.execute.script-permissions"));
|
||||
player.print(Caption.of("worldedit.execute.script-permissions"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -97,12 +97,12 @@ public class ScriptingCommands {
|
||||
String lastScript = session.getLastScript();
|
||||
|
||||
if (!player.hasPermission("worldedit.scripting.execute." + lastScript)) {
|
||||
player.printError(TranslatableComponent.of("worldedit.execute.script-permissions"));
|
||||
player.print(Caption.of("worldedit.execute.script-permissions"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (lastScript == null) {
|
||||
player.printError(TranslatableComponent.of("worldedit.executelast.no-script"));
|
||||
player.print(Caption.of("worldedit.executelast.no-script"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,6 @@ import com.sk89q.worldedit.util.formatting.component.SubtleFormat;
|
||||
import com.sk89q.worldedit.util.formatting.component.TextComponentProducer;
|
||||
import com.sk89q.worldedit.util.formatting.text.Component;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.event.ClickEvent;
|
||||
import com.sk89q.worldedit.util.formatting.text.event.HoverEvent;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
@ -124,12 +123,12 @@ public class SelectionCommands {
|
||||
} else if (actor instanceof Locatable) {
|
||||
pos = ((Locatable) actor).getBlockLocation().clampY(0, world.getMaxY());
|
||||
} else {
|
||||
actor.printError(TranslatableComponent.of("worldedit.pos.console-require-coords"));
|
||||
actor.print(Caption.of("worldedit.pos.console-require-coords"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!session.getRegionSelector(world).selectPrimary(pos.toVector().toBlockPoint(), ActorSelectorLimits.forActor(actor))) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.pos.already-set"));
|
||||
actor.print(Caption.of("worldedit.pos.already-set"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -153,12 +152,12 @@ public class SelectionCommands {
|
||||
} else if (actor instanceof Locatable) {
|
||||
pos = ((Locatable) actor).getBlockLocation().clampY(0, world.getMaxY());
|
||||
} else {
|
||||
actor.printError(TranslatableComponent.of("worldedit.pos.console-require-coords"));
|
||||
actor.print(Caption.of("worldedit.pos.console-require-coords"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!session.getRegionSelector(world).selectSecondary(pos.toVector().toBlockPoint(), ActorSelectorLimits.forActor(actor))) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.pos.already-set"));
|
||||
actor.print(Caption.of("worldedit.pos.already-set"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -177,14 +176,14 @@ public class SelectionCommands {
|
||||
|
||||
if (pos != null) {
|
||||
if (!session.getRegionSelector(player.getWorld()).selectPrimary(pos.toVector().toBlockPoint(), ActorSelectorLimits.forActor(player))) {
|
||||
player.printError(TranslatableComponent.of("worldedit.hpos.already-set"));
|
||||
player.print(Caption.of("worldedit.hpos.already-set"));
|
||||
return;
|
||||
}
|
||||
|
||||
session.getRegionSelector(player.getWorld())
|
||||
.explainPrimarySelection(player, session, pos.toBlockPoint());
|
||||
} else {
|
||||
player.printError(TranslatableComponent.of("worldedit.hpos.no-block"));
|
||||
player.print(Caption.of("worldedit.hpos.no-block"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,14 +198,14 @@ public class SelectionCommands {
|
||||
|
||||
if (pos != null) {
|
||||
if (!session.getRegionSelector(player.getWorld()).selectSecondary(pos.toVector().toBlockPoint(), ActorSelectorLimits.forActor(player))) {
|
||||
player.printError(TranslatableComponent.of("worldedit.hpos.already-set"));
|
||||
player.print(Caption.of("worldedit.hpos.already-set"));
|
||||
return;
|
||||
}
|
||||
|
||||
session.getRegionSelector(player.getWorld())
|
||||
.explainSecondarySelection(player, session, pos.toBlockPoint());
|
||||
} else {
|
||||
player.printError(TranslatableComponent.of("worldedit.hpos.no-block"));
|
||||
player.print(Caption.of("worldedit.hpos.no-block"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -235,7 +234,7 @@ public class SelectionCommands {
|
||||
min = BlockVector3.at(min2D.getBlockX() * 16, 0, min2D.getBlockZ() * 16);
|
||||
max = BlockVector3.at(max2D.getBlockX() * 16 + 15, world.getMaxY(), max2D.getBlockZ() * 16 + 15);
|
||||
|
||||
actor.printInfo(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.chunk.selected-multiple",
|
||||
TextComponent.of(min2D.getBlockX()),
|
||||
TextComponent.of(min2D.getBlockZ()),
|
||||
@ -261,7 +260,7 @@ public class SelectionCommands {
|
||||
min = BlockVector3.at(min2D.getBlockX() * 16, 0, min2D.getBlockZ() * 16);
|
||||
max = min.add(15, world.getMaxY(), 15);
|
||||
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.chunk.selected", TextComponent.of(min2D.getBlockX()),
|
||||
actor.print(Caption.of("worldedit.chunk.selected", TextComponent.of(min2D.getBlockX()),
|
||||
TextComponent.of(min2D.getBlockZ())));
|
||||
}
|
||||
|
||||
@ -293,16 +292,16 @@ public class SelectionCommands {
|
||||
}
|
||||
ItemType itemType = ItemTypes.parse(wandId);
|
||||
if (itemType == null) {
|
||||
player.printError(TranslatableComponent.of("worldedit.wand.invalid"));
|
||||
player.print(Caption.of("worldedit.wand.invalid"));
|
||||
return;
|
||||
}
|
||||
player.giveItem(new BaseItemStack(itemType, 1));
|
||||
if (navWand) {
|
||||
session.setTool(itemType, NavigationWand.INSTANCE);
|
||||
player.printInfo(TranslatableComponent.of("worldedit.wand.navwand.info"));
|
||||
player.print(Caption.of("worldedit.wand.navwand.info"));
|
||||
} else {
|
||||
session.setTool(itemType, SelectionWand.INSTANCE);
|
||||
player.printInfo(TranslatableComponent.of("worldedit.wand.selwand.info"));
|
||||
player.print(Caption.of("worldedit.wand.selwand.info"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -314,7 +313,7 @@ public class SelectionCommands {
|
||||
@CommandPermissions("worldedit.wand.toggle")
|
||||
public void toggleWand(Player player) {
|
||||
player.printInfo(
|
||||
TranslatableComponent.of(
|
||||
Caption.of(
|
||||
"worldedit.wand.selwand.now.tool",
|
||||
TextComponent.of("/tool none", TextColor.AQUA).clickEvent(
|
||||
ClickEvent.of(ClickEvent.Action.RUN_COMMAND, "/tool none")),
|
||||
@ -357,7 +356,7 @@ public class SelectionCommands {
|
||||
|
||||
session.getRegionSelector(world).explainRegionAdjust(actor, session);
|
||||
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.contract.contracted", TextComponent.of(oldSize - newSize)));
|
||||
actor.print(Caption.of("worldedit.contract.contracted", TextComponent.of(oldSize - newSize)));
|
||||
} catch (RegionOperationException e) {
|
||||
actor.printError(TextComponent.of(e.getMessage()));
|
||||
}
|
||||
@ -386,7 +385,7 @@ public class SelectionCommands {
|
||||
|
||||
session.getRegionSelector(world).explainRegionAdjust(actor, session);
|
||||
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.shift.shifted"));
|
||||
actor.print(Caption.of("worldedit.shift.shifted"));
|
||||
} catch (RegionOperationException e) {
|
||||
actor.printError(TextComponent.of(e.getMessage()));
|
||||
}
|
||||
@ -409,7 +408,7 @@ public class SelectionCommands {
|
||||
region.expand(getChangesForEachDir(amount, onlyHorizontal, onlyVertical));
|
||||
session.getRegionSelector(world).learnChanges();
|
||||
session.getRegionSelector(world).explainRegionAdjust(actor, session);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.outset.outset"));
|
||||
actor.print(Caption.of("worldedit.outset.outset"));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -429,7 +428,7 @@ public class SelectionCommands {
|
||||
region.contract(getChangesForEachDir(amount, onlyHorizontal, onlyVertical));
|
||||
session.getRegionSelector(world).learnChanges();
|
||||
session.getRegionSelector(world).explainRegionAdjust(actor, session);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.inset.inset"));
|
||||
actor.print(Caption.of("worldedit.inset.inset"));
|
||||
}
|
||||
|
||||
private BlockVector3[] getChangesForEachDir(int amount, boolean onlyHorizontal, boolean onlyVertical) {
|
||||
@ -485,14 +484,14 @@ public class SelectionCommands {
|
||||
String originStr = origin.getBlockX() + "," + origin.getBlockY() + "," + origin.getBlockZ();
|
||||
|
||||
long numBlocks = ((long) size.getBlockX() * size.getBlockY() * size.getBlockZ());
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.size.offset", TextComponent.of(name), TextComponent.of(sizeStr), TextComponent.of(originStr), TextComponent.of(numBlocks)));
|
||||
actor.print(Caption.of("worldedit.size.offset", TextComponent.of(name), TextComponent.of(sizeStr), TextComponent.of(originStr), TextComponent.of(numBlocks)));
|
||||
index++;
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
region = session.getSelection(world);
|
||||
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.size.type", TextComponent.of(session.getRegionSelector(world).getTypeName())));
|
||||
actor.print(Caption.of("worldedit.size.type", TextComponent.of(session.getRegionSelector(world).getTypeName())));
|
||||
|
||||
for (Component line : session.getRegionSelector(world).getSelectionInfoLines()) {
|
||||
actor.printInfo(line);
|
||||
@ -502,9 +501,9 @@ public class SelectionCommands {
|
||||
.subtract(region.getMinimumPoint())
|
||||
.add(1, 1, 1);
|
||||
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.size.size", TextComponent.of(size.toString())));
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.size.distance", TextComponent.of(region.getMaximumPoint().distance(region.getMinimumPoint()))));
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.size.blocks", TextComponent.of(region.getVolume())));
|
||||
actor.print(Caption.of("worldedit.size.size", TextComponent.of(size.toString())));
|
||||
actor.print(Caption.of("worldedit.size.distance", TextComponent.of(region.getMaximumPoint().distance(region.getMinimumPoint()))));
|
||||
actor.print(Caption.of("worldedit.size.blocks", TextComponent.of(region.getVolume())));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -516,7 +515,7 @@ public class SelectionCommands {
|
||||
@Arg(desc = "The mask of blocks to match")
|
||||
Mask mask) throws WorldEditException {
|
||||
int count = editSession.countBlocks(session.getSelection(world), mask);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.count.counted", TextComponent.of(count)));
|
||||
actor.print(Caption.of("worldedit.count.counted", TextComponent.of(count)));
|
||||
return count;
|
||||
}
|
||||
|
||||
@ -551,13 +550,13 @@ public class SelectionCommands {
|
||||
} else {
|
||||
distribution = session.getLastDistribution();
|
||||
if (distribution == null) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.distr.no-previous"));
|
||||
actor.print(Caption.of("worldedit.distr.no-previous"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (distribution.isEmpty()) { // *Should* always be false
|
||||
actor.printError(TranslatableComponent.of("worldedit.distr.no-blocks"));
|
||||
actor.print(Caption.of("worldedit.distr.no-blocks"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -582,7 +581,7 @@ public class SelectionCommands {
|
||||
if (selector == null) {
|
||||
session.getRegionSelector(world).clear();
|
||||
session.dispatchCUISelection(actor);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.cleared"));
|
||||
actor.print(Caption.of("worldedit.select.cleared"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -592,54 +591,54 @@ public class SelectionCommands {
|
||||
switch (selector) {
|
||||
case CUBOID:
|
||||
newSelector = new CuboidRegionSelector(oldSelector);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.cuboid.message"));
|
||||
actor.print(Caption.of("worldedit.select.cuboid.message"));
|
||||
break;
|
||||
case EXTEND:
|
||||
newSelector = new ExtendingCuboidRegionSelector(oldSelector);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.extend.message"));
|
||||
actor.print(Caption.of("worldedit.select.extend.message"));
|
||||
break;
|
||||
case POLY: {
|
||||
newSelector = new Polygonal2DRegionSelector(oldSelector);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.poly.message"));
|
||||
actor.print(Caption.of("worldedit.select.poly.message"));
|
||||
Optional<Integer> limit = ActorSelectorLimits.forActor(actor).getPolygonVertexLimit();
|
||||
limit.ifPresent(integer -> actor.printInfo(TranslatableComponent.of("worldedit.select.poly.limit-message", TextComponent.of(integer))));
|
||||
limit.ifPresent(integer -> actor.print(Caption.of("worldedit.select.poly.limit-message", TextComponent.of(integer))));
|
||||
break;
|
||||
}
|
||||
case ELLIPSOID:
|
||||
newSelector = new EllipsoidRegionSelector(oldSelector);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.ellipsoid.message"));
|
||||
actor.print(Caption.of("worldedit.select.ellipsoid.message"));
|
||||
break;
|
||||
case SPHERE:
|
||||
newSelector = new SphereRegionSelector(oldSelector);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.sphere.message"));
|
||||
actor.print(Caption.of("worldedit.select.sphere.message"));
|
||||
break;
|
||||
case CYL:
|
||||
newSelector = new CylinderRegionSelector(oldSelector);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.cyl.message"));
|
||||
actor.print(Caption.of("worldedit.select.cyl.message"));
|
||||
break;
|
||||
case CONVEX:
|
||||
case HULL:
|
||||
case POLYHEDRON: {
|
||||
newSelector = new ConvexPolyhedralRegionSelector(oldSelector);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.convex.message"));
|
||||
actor.print(Caption.of("worldedit.select.convex.message"));
|
||||
Optional<Integer> limit = ActorSelectorLimits.forActor(actor).getPolyhedronVertexLimit();
|
||||
limit.ifPresent(integer -> actor.printInfo(TranslatableComponent.of("worldedit.select.convex.limit-message", TextComponent.of(integer))));
|
||||
limit.ifPresent(integer -> actor.print(Caption.of("worldedit.select.convex.limit-message", TextComponent.of(integer))));
|
||||
break;
|
||||
}
|
||||
case POLYHEDRAL:
|
||||
newSelector = new PolyhedralRegionSelector(world);
|
||||
actor.print(TranslatableComponent.of("fawe.selection.sel.convex.polyhedral"));
|
||||
actor.print(Caption.of("fawe.selection.sel.convex.polyhedral"));
|
||||
Optional<Integer> limit = ActorSelectorLimits.forActor(actor).getPolyhedronVertexLimit();
|
||||
limit.ifPresent(integer -> actor.print(Caption.of("fawe.selection.sel.max", integer)));
|
||||
actor.print(TranslatableComponent.of("fawe.selection.sel.list"));
|
||||
actor.print(Caption.of("fawe.selection.sel.list"));
|
||||
break;
|
||||
case FUZZY:
|
||||
case MAGIC:
|
||||
Mask maskOpt = new IdMask(world);
|
||||
//TODO Make FuzzyRegionSelector accept actors
|
||||
newSelector = new FuzzyRegionSelector((Player) actor, world, maskOpt);
|
||||
actor.print(TranslatableComponent.of("fawe.selection.sel.fuzzy"));
|
||||
actor.print(TranslatableComponent.of("fawe.selection.sel.list"));
|
||||
actor.print(Caption.of("fawe.selection.sel.fuzzy"));
|
||||
actor.print(Caption.of("fawe.selection.sel.list"));
|
||||
break;
|
||||
case LIST:
|
||||
default:
|
||||
@ -648,13 +647,13 @@ public class SelectionCommands {
|
||||
TextComponentProducer contents = box.getContents();
|
||||
contents.append(SubtleFormat.wrap("Select one of the modes below:")).newline();
|
||||
|
||||
box.appendCommand("cuboid", TranslatableComponent.of("worldedit.select.cuboid.description"), "//sel cuboid");
|
||||
box.appendCommand("extend", TranslatableComponent.of("worldedit.select.extend.description"), "//sel extend");
|
||||
box.appendCommand("poly", TranslatableComponent.of("worldedit.select.poly.description"), "//sel poly");
|
||||
box.appendCommand("ellipsoid", TranslatableComponent.of("worldedit.select.ellipsoid.description"), "//sel ellipsoid");
|
||||
box.appendCommand("sphere", TranslatableComponent.of("worldedit.select.sphere.description"), "//sel sphere");
|
||||
box.appendCommand("cyl", TranslatableComponent.of("worldedit.select.cyl.description"), "//sel cyl");
|
||||
box.appendCommand("convex", TranslatableComponent.of("worldedit.select.convex.description"), "//sel convex");
|
||||
box.appendCommand("cuboid", Caption.of("worldedit.select.cuboid.description"), "//sel cuboid");
|
||||
box.appendCommand("extend", Caption.of("worldedit.select.extend.description"), "//sel extend");
|
||||
box.appendCommand("poly", Caption.of("worldedit.select.poly.description"), "//sel poly");
|
||||
box.appendCommand("ellipsoid", Caption.of("worldedit.select.ellipsoid.description"), "//sel ellipsoid");
|
||||
box.appendCommand("sphere", Caption.of("worldedit.select.sphere.description"), "//sel sphere");
|
||||
box.appendCommand("cyl", Caption.of("worldedit.select.cyl.description"), "//sel cyl");
|
||||
box.appendCommand("convex", Caption.of("worldedit.select.convex.description"), "//sel convex");
|
||||
box.appendCommand("polyhedral", "Select a hollow polyhedral", "//sel polyhedral");
|
||||
box.appendCommand("fuzzy[=<mask>]", "Select all connected blocks (magic wand)", "//sel fuzzy[=<mask>]");
|
||||
|
||||
@ -673,7 +672,7 @@ public class SelectionCommands {
|
||||
|
||||
if (found != null) {
|
||||
session.setDefaultRegionSelector(found);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.select.default-set", TextComponent.of(found.name())));
|
||||
actor.print(Caption.of("worldedit.select.default-set", TextComponent.of(found.name())));
|
||||
} else {
|
||||
throw new RuntimeException("Something unexpected happened. Please report this.");
|
||||
}
|
||||
@ -740,7 +739,7 @@ public class SelectionCommands {
|
||||
|
||||
@Override
|
||||
public Component create(int page) throws InvalidComponentException {
|
||||
super.getContents().append(TranslatableComponent.of("worldedit.distr.total", TextColor.GRAY, TextComponent.of(totalBlocks)))
|
||||
super.getContents().append(Caption.of("worldedit.distr.total", TextComponent.of(totalBlocks)))
|
||||
.append(TextComponent.newline());
|
||||
return super.create(page);
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
@ -74,7 +75,7 @@ public class SnapshotCommands {
|
||||
|
||||
static void checkSnapshotsConfigured(LocalConfiguration localConfiguration) {
|
||||
if (!localConfiguration.snapshotsConfigured) {
|
||||
throw new StopExecutionException(TranslatableComponent.of(
|
||||
throw new StopExecutionException(Caption.of(
|
||||
"worldedit.restore.not-configured"
|
||||
));
|
||||
}
|
||||
@ -120,7 +121,7 @@ public class SnapshotCommands {
|
||||
if (!snapshots.isEmpty()) {
|
||||
actor.print(new SnapshotListBox(world.getName(), snapshots).create(page));
|
||||
} else {
|
||||
actor.printError(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.restore.none-for-specific-world",
|
||||
TextComponent.of(world.getName())
|
||||
));
|
||||
@ -169,9 +170,9 @@ public class SnapshotCommands {
|
||||
session.getSnapshotExperimental().close();
|
||||
}
|
||||
session.setSnapshot(null);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.snapshot.use.newest"));
|
||||
actor.print(Caption.of("worldedit.snapshot.use.newest"));
|
||||
} else {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world"));
|
||||
actor.print(Caption.of("worldedit.restore.none-for-world"));
|
||||
}
|
||||
} else {
|
||||
URI uri = resolveSnapshotName(config, name);
|
||||
@ -181,11 +182,11 @@ public class SnapshotCommands {
|
||||
session.getSnapshotExperimental().close();
|
||||
}
|
||||
session.setSnapshotExperimental(snapshot.get());
|
||||
actor.printInfo(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.snapshot.use", TextComponent.of(name)
|
||||
));
|
||||
} else {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.not-available"));
|
||||
actor.print(Caption.of("worldedit.restore.not-available"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -207,7 +208,7 @@ public class SnapshotCommands {
|
||||
}
|
||||
|
||||
if (index < 1) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.snapshot.index-above-0"));
|
||||
actor.print(Caption.of("worldedit.snapshot.index-above-0"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -218,7 +219,7 @@ public class SnapshotCommands {
|
||||
.collect(toList());
|
||||
}
|
||||
if (snapshots.size() < index) {
|
||||
actor.printError(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.snapshot.index-oob",
|
||||
TextComponent.of(snapshots.size())
|
||||
));
|
||||
@ -226,14 +227,14 @@ public class SnapshotCommands {
|
||||
}
|
||||
Snapshot snapshot = snapshots.get(index - 1);
|
||||
if (snapshot == null) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.not-available"));
|
||||
actor.print(Caption.of("worldedit.restore.not-available"));
|
||||
return;
|
||||
}
|
||||
if (session.getSnapshotExperimental() != null) {
|
||||
session.getSnapshotExperimental().close();
|
||||
}
|
||||
session.setSnapshotExperimental(snapshot);
|
||||
actor.printInfo(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.snapshot.use",
|
||||
TextComponent.of(snapshot.getInfo().getDisplayName())
|
||||
));
|
||||
@ -263,7 +264,7 @@ public class SnapshotCommands {
|
||||
}
|
||||
|
||||
if (snapshot == null) {
|
||||
actor.printError(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.snapshot.none-before",
|
||||
TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date)))
|
||||
);
|
||||
@ -272,7 +273,7 @@ public class SnapshotCommands {
|
||||
session.getSnapshotExperimental().close();
|
||||
}
|
||||
session.setSnapshotExperimental(snapshot);
|
||||
actor.printInfo(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.snapshot.use",
|
||||
TextComponent.of(snapshot.getInfo().getDisplayName())
|
||||
));
|
||||
@ -302,7 +303,7 @@ public class SnapshotCommands {
|
||||
.findFirst().orElse(null);
|
||||
}
|
||||
if (snapshot == null) {
|
||||
actor.printError(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.snapshot.none-after",
|
||||
TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date)))
|
||||
);
|
||||
@ -311,7 +312,7 @@ public class SnapshotCommands {
|
||||
session.getSnapshotExperimental().close();
|
||||
}
|
||||
session.setSnapshotExperimental(snapshot);
|
||||
actor.printInfo(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.snapshot.use",
|
||||
TextComponent.of(snapshot.getInfo().getDisplayName())
|
||||
));
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
@ -30,7 +31,6 @@ import com.sk89q.worldedit.command.util.Logging;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.snapshot.experimental.Snapshot;
|
||||
import com.sk89q.worldedit.world.snapshot.experimental.SnapshotRestore;
|
||||
@ -83,7 +83,7 @@ public class SnapshotUtilCommands {
|
||||
URI uri = resolveSnapshotName(config, snapshotName);
|
||||
Optional<Snapshot> snapOpt = config.snapshotDatabase.getSnapshot(uri);
|
||||
if (!snapOpt.isPresent()) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.not-available"));
|
||||
actor.print(Caption.of("worldedit.restore.not-available"));
|
||||
return;
|
||||
}
|
||||
snapshot = snapOpt.get();
|
||||
@ -100,14 +100,14 @@ public class SnapshotUtilCommands {
|
||||
}
|
||||
|
||||
if (snapshot == null) {
|
||||
actor.printError(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.restore.none-for-specific-world",
|
||||
TextComponent.of(world.getName())
|
||||
));
|
||||
return;
|
||||
}
|
||||
}
|
||||
actor.printInfo(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.restore.loaded",
|
||||
TextComponent.of(snapshot.getInfo().getDisplayName())
|
||||
));
|
||||
@ -122,15 +122,15 @@ public class SnapshotUtilCommands {
|
||||
if (restore.hadTotalFailure()) {
|
||||
String error = restore.getLastErrorMessage();
|
||||
if (!restore.getMissingChunks().isEmpty()) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.chunk-not-present"));
|
||||
actor.print(Caption.of("worldedit.restore.chunk-not-present"));
|
||||
} else if (error != null) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.block-place-failed"));
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.block-place-error", TextComponent.of(error)));
|
||||
actor.print(Caption.of("worldedit.restore.block-place-failed"));
|
||||
actor.print(Caption.of("worldedit.restore.block-place-error", TextComponent.of(error)));
|
||||
} else {
|
||||
actor.printError(TranslatableComponent.of("worldedit.restore.chunk-load-failed"));
|
||||
actor.print(Caption.of("worldedit.restore.chunk-load-failed"));
|
||||
}
|
||||
} else {
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.restore.restored",
|
||||
actor.print(Caption.of("worldedit.restore.restored",
|
||||
TextComponent.of(restore.getMissingChunks().size()),
|
||||
TextComponent.of(restore.getErrorChunks().size())));
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
@ -51,7 +52,7 @@ public class SuperPickaxeCommands {
|
||||
public void single(Player player, LocalSession session) throws WorldEditException {
|
||||
session.setSuperPickaxe(new SinglePickaxe());
|
||||
session.enableSuperPickAxe();
|
||||
player.printInfo(TranslatableComponent.of("worldedit.tool.superpickaxe.mode.single"));
|
||||
player.print(Caption.of("worldedit.tool.superpickaxe.mode.single"));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -66,12 +67,12 @@ public class SuperPickaxeCommands {
|
||||
LocalConfiguration config = we.getConfiguration();
|
||||
|
||||
if (range > config.maxSuperPickaxeSize) {
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.superpickaxe.max-range", TextComponent.of(config.maxSuperPickaxeSize)));
|
||||
player.print(Caption.of("worldedit.tool.superpickaxe.max-range", TextComponent.of(config.maxSuperPickaxeSize)));
|
||||
return;
|
||||
}
|
||||
session.setSuperPickaxe(new AreaPickaxe(range));
|
||||
session.enableSuperPickAxe();
|
||||
player.printInfo(TranslatableComponent.of("worldedit.tool.superpickaxe.mode.area"));
|
||||
player.print(Caption.of("worldedit.tool.superpickaxe.mode.area"));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -87,12 +88,12 @@ public class SuperPickaxeCommands {
|
||||
LocalConfiguration config = we.getConfiguration();
|
||||
|
||||
if (range > config.maxSuperPickaxeSize) {
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.superpickaxe.max-range", TextComponent.of(config.maxSuperPickaxeSize)));
|
||||
player.print(Caption.of("worldedit.tool.superpickaxe.max-range", TextComponent.of(config.maxSuperPickaxeSize)));
|
||||
return;
|
||||
}
|
||||
|
||||
session.setSuperPickaxe(new RecursivePickaxe(range));
|
||||
session.enableSuperPickAxe();
|
||||
player.printInfo(TranslatableComponent.of("worldedit.tool.superpickaxe.mode.recursive"));
|
||||
player.print(Caption.of("worldedit.tool.superpickaxe.mode.recursive"));
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.object.brush.InspectBrush;
|
||||
import com.google.common.collect.Collections2;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
@ -52,7 +53,6 @@ import com.sk89q.worldedit.util.HandSide;
|
||||
import com.sk89q.worldedit.util.TreeGenerator;
|
||||
import com.sk89q.worldedit.util.formatting.text.Component;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.event.ClickEvent;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
@ -120,7 +120,7 @@ public class ToolCommands {
|
||||
.collect(Collectors.toSet());
|
||||
commandManager.register("tool", command -> {
|
||||
command.addPart(SubCommandPart.builder(
|
||||
TranslatableComponent.of("tool"),
|
||||
Caption.of("tool"),
|
||||
TextComponent.of("The tool to bind")
|
||||
)
|
||||
.withCommands(nonGlobalCommands)
|
||||
@ -145,18 +145,18 @@ public class ToolCommands {
|
||||
throws InvalidToolBindException {
|
||||
isBrush = session.getTool(player) instanceof BrushTool;
|
||||
session.setTool(player.getItemInHand(HandSide.MAIN_HAND).getType(), null);
|
||||
player.printInfo(TranslatableComponent.of(isBrush ? "worldedit.brush.none.equip" : "worldedit.tool.none.equip"));
|
||||
player.print(Caption.of(isBrush ? "worldedit.brush.none.equip" : "worldedit.tool.none.equip"));
|
||||
}
|
||||
|
||||
static void sendUnbindInstruction(Player sender, Component commandComponent) {
|
||||
sender.printDebug(TranslatableComponent.of("worldedit.tool.unbind-instruction", commandComponent));
|
||||
sender.print(Caption.of("worldedit.tool.unbind-instruction", commandComponent));
|
||||
}
|
||||
|
||||
private static void setTool(Player player, LocalSession session, Tool tool,
|
||||
String translationKey) throws InvalidToolBindException {
|
||||
BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND);
|
||||
session.setTool(itemStack.getType(), tool);
|
||||
player.printInfo(TranslatableComponent.of(translationKey, itemStack.getRichName()));
|
||||
player.print(Caption.of(translationKey, itemStack.getRichName()));
|
||||
sendUnbindInstruction(player, UNBIND_COMMAND_COMPONENT);
|
||||
}
|
||||
|
||||
@ -278,7 +278,7 @@ public class ToolCommands {
|
||||
LocalConfiguration config = we.getConfiguration();
|
||||
|
||||
if (range > config.maxSuperPickaxeSize) {
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.superpickaxe.max-range", TextComponent.of(config.maxSuperPickaxeSize)));
|
||||
player.print(Caption.of("worldedit.tool.superpickaxe.max-range", TextComponent.of(config.maxSuperPickaxeSize)));
|
||||
return;
|
||||
}
|
||||
setTool(player, session, new FloodFillTool(range, pattern), "worldedit.tool.floodfill.equip");
|
||||
@ -328,6 +328,6 @@ public class ToolCommands {
|
||||
} else {
|
||||
secondaryName = TextComponent.of("pattern");
|
||||
}
|
||||
player.printInfo(TranslatableComponent.of("worldedit.tool.lrbuild.set", primaryName, secondaryName));
|
||||
player.print(Caption.of("worldedit.tool.lrbuild.set", primaryName, secondaryName));
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,6 @@ import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.internal.command.CommandArgParser;
|
||||
import com.sk89q.worldedit.util.HandSide;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import org.enginehub.piston.annotation.Command;
|
||||
import org.enginehub.piston.annotation.CommandContainer;
|
||||
import org.enginehub.piston.annotation.param.Arg;
|
||||
@ -77,11 +76,11 @@ public class ToolUtilCommands {
|
||||
Mask maskOpt, Arguments arguments) throws WorldEditException {
|
||||
BrushTool tool = session.getBrushTool(player, false);
|
||||
if (tool == null) {
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none"));
|
||||
player.print(Caption.of("fawe.worldedit.brush.brush.none"));
|
||||
return;
|
||||
}
|
||||
if (maskOpt == null) {
|
||||
player.printInfo(TranslatableComponent.of("worldedit.tool.mask.disabled"));
|
||||
player.print(Caption.of("worldedit.tool.mask.disabled"));
|
||||
tool.setMask(null);
|
||||
} else {
|
||||
BrushSettings settings = offHand ? tool.getOffHand() : tool.getContext();
|
||||
@ -90,7 +89,7 @@ public class ToolUtilCommands {
|
||||
settings.addSetting(BrushSettings.SettingType.MASK, lastArg);
|
||||
settings.setMask(maskOpt);
|
||||
tool.update();
|
||||
player.printInfo(TranslatableComponent.of("worldedit.tool.mask.set"));
|
||||
player.print(Caption.of("worldedit.tool.mask.set"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,7 +106,7 @@ public class ToolUtilCommands {
|
||||
boolean offHand, Arguments arguments) throws WorldEditException {
|
||||
BrushTool tool = session.getBrushTool(player, false);
|
||||
if (tool == null) {
|
||||
player.printInfo(TranslatableComponent.of("fawe.worldedit.brush.brush.none"));
|
||||
player.print(Caption.of("fawe.worldedit.brush.brush.none"));
|
||||
return;
|
||||
}
|
||||
if (pattern == null) {
|
||||
@ -119,7 +118,7 @@ public class ToolUtilCommands {
|
||||
settings.addSetting(BrushSettings.SettingType.FILL, lastArg);
|
||||
tool.update();
|
||||
}
|
||||
player.printInfo(TranslatableComponent.of("worldedit.tool.material.set"));
|
||||
player.print(Caption.of("worldedit.tool.material.set"));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -132,7 +131,7 @@ public class ToolUtilCommands {
|
||||
@Arg(desc = "The range of the brush")
|
||||
int range) throws WorldEditException {
|
||||
session.getBrushTool(player, false).setRange(range);
|
||||
player.printInfo(TranslatableComponent.of("worldedit.tool.range.set"));
|
||||
player.print(Caption.of("worldedit.tool.range.set"));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -146,7 +145,7 @@ public class ToolUtilCommands {
|
||||
we.checkMaxBrushRadius(size);
|
||||
|
||||
session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()).setSize(size);
|
||||
player.printInfo(TranslatableComponent.of("worldedit.tool.size.set"));
|
||||
player.print(Caption.of("worldedit.tool.size.set"));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -160,9 +159,9 @@ public class ToolUtilCommands {
|
||||
Mask maskOpt) throws WorldEditException {
|
||||
session.getBrushTool(player, false).setTraceMask(maskOpt);
|
||||
if (maskOpt == null) {
|
||||
player.printInfo(TranslatableComponent.of("worldedit.tool.tracemask.disabled"));
|
||||
player.print(Caption.of("worldedit.tool.tracemask.disabled"));
|
||||
} else {
|
||||
player.printInfo(TranslatableComponent.of("worldedit.tool.tracemask.set"));
|
||||
player.print(Caption.of("worldedit.tool.tracemask.set"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -177,15 +176,15 @@ public class ToolUtilCommands {
|
||||
Boolean superPickaxe) {
|
||||
boolean hasSuperPickAxe = session.hasSuperPickAxe();
|
||||
if (superPickaxe != null && superPickaxe == hasSuperPickAxe) {
|
||||
player.printError(TranslatableComponent.of(superPickaxe ? "worldedit.tool.superpickaxe.enabled.already" : "worldedit.tool.superpickaxe.disabled.already"));
|
||||
player.print(Caption.of(superPickaxe ? "worldedit.tool.superpickaxe.enabled.already" : "worldedit.tool.superpickaxe.disabled.already"));
|
||||
return;
|
||||
}
|
||||
if (hasSuperPickAxe) {
|
||||
session.disableSuperPickAxe();
|
||||
player.printInfo(TranslatableComponent.of("worldedit.tool.superpickaxe.disabled"));
|
||||
player.print(Caption.of("worldedit.tool.superpickaxe.disabled"));
|
||||
} else {
|
||||
session.enableSuperPickAxe();
|
||||
player.printInfo(TranslatableComponent.of("worldedit.tool.superpickaxe.enabled"));
|
||||
player.print(Caption.of("worldedit.tool.superpickaxe.enabled"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -248,7 +247,7 @@ public class ToolUtilCommands {
|
||||
int mode) throws WorldEditException {
|
||||
BrushTool tool = session.getBrushTool(player, false);
|
||||
if (tool == null) {
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none"));
|
||||
player.print(Caption.of("fawe.worldedit.brush.brush.none"));
|
||||
return;
|
||||
}
|
||||
VisualMode[] modes = VisualMode.values();
|
||||
@ -268,7 +267,7 @@ public class ToolUtilCommands {
|
||||
int mode) throws WorldEditException {
|
||||
BrushTool tool = session.getBrushTool(player, false);
|
||||
if (tool == null) {
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none"));
|
||||
player.print(Caption.of("fawe.worldedit.brush.brush.none"));
|
||||
return;
|
||||
}
|
||||
TargetMode[] modes = TargetMode.values();
|
||||
@ -287,7 +286,7 @@ public class ToolUtilCommands {
|
||||
@Arg(name = "offset", desc = "offset", def = "0") int offset) throws WorldEditException {
|
||||
BrushTool tool = session.getBrushTool(player, false);
|
||||
if (tool == null) {
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none"));
|
||||
player.print(Caption.of("fawe.worldedit.brush.brush.none"));
|
||||
return;
|
||||
}
|
||||
tool.setTargetOffset(offset);
|
||||
@ -308,7 +307,7 @@ public class ToolUtilCommands {
|
||||
List<String> commandStr) throws WorldEditException {
|
||||
BrushTool bt = session.getBrushTool(player, false);
|
||||
if (bt == null) {
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none"));
|
||||
player.print(Caption.of("fawe.worldedit.brush.brush.none"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -316,7 +315,7 @@ public class ToolUtilCommands {
|
||||
Scroll action = Scroll.fromArguments(bt, player, session, mode, commandStr, true);
|
||||
settings.setScrollAction(action);
|
||||
if (mode == Scroll.Action.NONE) {
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.scroll.action.unset"));
|
||||
player.print(Caption.of("fawe.worldedit.brush.brush.scroll.action.unset"));
|
||||
} else if (action != null) {
|
||||
String full = (mode.name().toLowerCase(Locale.ROOT) + " " + StringMan.join(commandStr, " ")).trim();
|
||||
settings.addSetting(BrushSettings.SettingType.SCROLL_ACTION, full);
|
||||
@ -342,11 +341,11 @@ public class ToolUtilCommands {
|
||||
Arguments arguments) throws WorldEditException {
|
||||
BrushTool tool = session.getBrushTool(player, false);
|
||||
if (tool == null) {
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none"));
|
||||
player.print(Caption.of("fawe.worldedit.brush.brush.none"));
|
||||
return;
|
||||
}
|
||||
if (maskArg == null) {
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.source.mask.disabled"));
|
||||
player.print(Caption.of("fawe.worldedit.brush.brush.source.mask.disabled"));
|
||||
tool.setSourceMask(null);
|
||||
return;
|
||||
}
|
||||
@ -355,7 +354,7 @@ public class ToolUtilCommands {
|
||||
settings.addSetting(BrushSettings.SettingType.SOURCE_MASK, lastArg);
|
||||
settings.setSourceMask(maskArg);
|
||||
tool.update();
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.source.mask"));
|
||||
player.print(Caption.of("fawe.worldedit.brush.brush.source.mask"));
|
||||
}
|
||||
|
||||
// TODO: Ping @MattBDev to reimplement 2020-02-04
|
||||
|
@ -67,7 +67,6 @@ import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.util.formatting.component.SubtleFormat;
|
||||
import com.sk89q.worldedit.util.formatting.text.Component;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
@ -217,7 +216,7 @@ public class UtilityCommands {
|
||||
|
||||
BlockVector3 pos = session.getPlacementPosition(actor);
|
||||
int affected = editSession.fillDirection(pos, pattern, radius, depth, direction);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.fill.created", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.fill.created", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -315,7 +314,7 @@ public class UtilityCommands {
|
||||
|
||||
BlockVector3 pos = session.getPlacementPosition(actor);
|
||||
int affected = editSession.fillXZ(pos, pattern, radius, depth, true);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.fillr.created", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.fillr.created", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -336,7 +335,7 @@ public class UtilityCommands {
|
||||
radius = Math.max(0, radius);
|
||||
we.checkMaxRadius(radius);
|
||||
int affected = editSession.drainArea(session.getPlacementPosition(actor), radius, waterlogged, plants);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.drain.drained", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.drain.drained", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -353,7 +352,7 @@ public class UtilityCommands {
|
||||
radius = Math.max(0, radius);
|
||||
we.checkMaxRadius(radius);
|
||||
int affected = editSession.fixLiquid(session.getPlacementPosition(actor), radius, BlockTypes.LAVA);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.fixlava.fixed", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.fixlava.fixed", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -370,7 +369,7 @@ public class UtilityCommands {
|
||||
radius = Math.max(0, radius);
|
||||
we.checkMaxRadius(radius);
|
||||
int affected = editSession.fixLiquid(session.getPlacementPosition(actor), radius, BlockTypes.WATER);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.fixwater.fixed", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.fixwater.fixed", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -391,7 +390,7 @@ public class UtilityCommands {
|
||||
height = height != null ? Math.min((world.getMaxY() + 1), height + 1) : (world.getMaxY() + 1);
|
||||
|
||||
int affected = editSession.removeAbove(session.getPlacementPosition(actor), size, height);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.removeabove.removed", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.removeabove.removed", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -412,7 +411,7 @@ public class UtilityCommands {
|
||||
height = height != null ? Math.min((world.getMaxY() + 1), height + 1) : (world.getMaxY() + 1);
|
||||
|
||||
int affected = editSession.removeBelow(session.getPlacementPosition(actor), size, height);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.removebelow.removed", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.removebelow.removed", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -432,7 +431,7 @@ public class UtilityCommands {
|
||||
we.checkMaxRadius(radius);
|
||||
|
||||
int affected = editSession.removeNear(session.getPlacementPosition(actor), mask, radius);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.removenear.removed", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.removenear.removed", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -463,7 +462,7 @@ public class UtilityCommands {
|
||||
}
|
||||
|
||||
int affected = editSession.replaceBlocks(region, from, to);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.replacenear.replaced", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.replacenear.replaced", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -494,7 +493,7 @@ public class UtilityCommands {
|
||||
|
||||
CylinderRegion region = new CylinderRegion(position, Vector2.at(size, size), position.getBlockY() - height, position.getBlockY() + height);
|
||||
int affected = editSession.simulateSnow(region, stack);
|
||||
actor.printInfo(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.snow.created", TextComponent.of(affected)
|
||||
));
|
||||
return affected;
|
||||
@ -521,7 +520,7 @@ public class UtilityCommands {
|
||||
we.checkMaxRadius(size);
|
||||
|
||||
int affected = editSession.thaw(session.getPlacementPosition(actor), size, height);
|
||||
actor.printInfo(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.thaw.removed", TextComponent.of(affected)
|
||||
));
|
||||
return affected;
|
||||
@ -553,7 +552,7 @@ public class UtilityCommands {
|
||||
final int affected = editSession.green(
|
||||
session.getPlacementPosition(actor), size, height, onlyNormalDirt
|
||||
);
|
||||
actor.printInfo(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.green.changed", TextComponent.of(affected)
|
||||
));
|
||||
return affected;
|
||||
@ -578,7 +577,7 @@ public class UtilityCommands {
|
||||
|
||||
Mask mask = new BlockTypeMask(editSession, BlockTypes.FIRE);
|
||||
int affected = editSession.removeNear(session.getPlacementPosition(actor), mask, size);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.extinguish.removed", TextComponent.of(affected)));
|
||||
actor.print(Caption.of("worldedit.extinguish.removed", TextComponent.of(affected)));
|
||||
return affected;
|
||||
}
|
||||
|
||||
@ -615,7 +614,7 @@ public class UtilityCommands {
|
||||
if (radius == null) {
|
||||
radius = config.butcherDefaultRadius;
|
||||
} else if (radius < -1) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.butcher.explain-all"));
|
||||
actor.print(Caption.of("worldedit.butcher.explain-all"));
|
||||
return 0;
|
||||
} else if (radius == -1) {
|
||||
if (config.butcherMaxRadius != -1) {
|
||||
@ -639,7 +638,7 @@ public class UtilityCommands {
|
||||
|
||||
int killed = killMatchingEntities(radius, actor, flags::createFunction);
|
||||
|
||||
actor.printInfo(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.butcher.killed",
|
||||
TextComponent.of(killed),
|
||||
TextComponent.of(radius)
|
||||
@ -661,12 +660,12 @@ public class UtilityCommands {
|
||||
@Arg(desc = "The radius of the cuboid to remove from")
|
||||
int radius) throws WorldEditException {
|
||||
if (radius < -1) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.remove.explain-all"));
|
||||
actor.print(Caption.of("worldedit.remove.explain-all"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
int removed = killMatchingEntities(radius, actor, remover::createFunction);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.remove.removed", TextComponent.of(removed)));
|
||||
actor.print(Caption.of("worldedit.remove.removed", TextComponent.of(removed)));
|
||||
return removed;
|
||||
}
|
||||
|
||||
@ -716,7 +715,7 @@ public class UtilityCommands {
|
||||
try {
|
||||
expression = Expression.compile(String.join(" ", input));
|
||||
} catch (ExpressionException e) {
|
||||
actor.printError(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.calc.invalid.with-error",
|
||||
TextComponent.of(String.join(" ", input)),
|
||||
TextComponent.of(e.getMessage())
|
||||
@ -755,7 +754,7 @@ public class UtilityCommands {
|
||||
@CommandPermissions(value = "fawe.confirm", queued = false)
|
||||
public void confirm(Player player) throws WorldEditException {
|
||||
if (!player.confirm()) {
|
||||
player.print(TranslatableComponent.of("fawe.worldedit.utility.nothing.confirmed"));
|
||||
player.print(Caption.of("fawe.worldedit.utility.nothing.confirmed"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -819,7 +818,7 @@ public class UtilityCommands {
|
||||
getFiles(dir, actor, args, formatName, playerFolder, fileList::add);
|
||||
|
||||
if (fileList.isEmpty()) {
|
||||
actor.print(TranslatableComponent.of("fawe.worldedit.schematic.schematic.none"));
|
||||
actor.print(Caption.of("fawe.worldedit.schematic.schematic.none"));
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@ package com.sk89q.worldedit.command;
|
||||
|
||||
import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.FaweVersion;
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.intellectualsites.paster.IncendoPaster;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
@ -92,7 +93,7 @@ public class WorldEditCommands {
|
||||
TextComponent buildArg = TextComponent.of(version.build);
|
||||
TextComponent platformArg = TextComponent.of(Settings.IMP.PLATFORM);
|
||||
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.version.version", dateArg, commitArg, buildArg, platformArg));
|
||||
actor.print(Caption.of("worldedit.version.version", dateArg, commitArg, buildArg, platformArg));
|
||||
}
|
||||
|
||||
actor.printInfo(TextComponent.of("Wiki: https://wiki.intellectualsites.com/FastAsyncWorldEdit/index"));
|
||||
@ -132,7 +133,7 @@ public class WorldEditCommands {
|
||||
we.getPlatformManager().queryCapability(Capability.CONFIGURATION).reload();
|
||||
we.getEventBus().post(new ConfigurationLoadEvent(we.getPlatformManager().queryCapability(Capability.CONFIGURATION).getConfiguration()));
|
||||
Fawe.get().setupConfigs();
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.reload.config"));
|
||||
actor.print(Caption.of("worldedit.reload.config"));
|
||||
}
|
||||
|
||||
@Command(
|
||||
@ -151,7 +152,7 @@ public class WorldEditCommands {
|
||||
actor.printInfo(TextComponent.of(e.getMessage()));
|
||||
return;
|
||||
}
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.report.written", TextComponent.of(dest).clickEvent(
|
||||
actor.print(Caption.of("worldedit.report.written", TextComponent.of(dest).clickEvent(
|
||||
ClickEvent.openUrl(dest))));
|
||||
}
|
||||
|
||||
@ -164,7 +165,7 @@ public class WorldEditCommands {
|
||||
Map<Thread, StackTraceElement[]> stacks = Thread.getAllStackTraces();
|
||||
for (Map.Entry<Thread, StackTraceElement[]> entry : stacks.entrySet()) {
|
||||
Thread thread = entry.getKey();
|
||||
actor.printDebug(TranslatableComponent.of(
|
||||
actor.printDebug(TextComponent.of(
|
||||
"--------------------------------------------------------------------------------------------"));
|
||||
actor.printDebug("Thread: " + thread.getName() + " | Id: " + thread.getId() + " | Alive: " + thread.isAlive());
|
||||
for (StackTraceElement elem : entry.getValue()) {
|
||||
@ -194,13 +195,13 @@ public class WorldEditCommands {
|
||||
try {
|
||||
ZoneId tz = ZoneId.of(timezone);
|
||||
session.setTimezone(tz);
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.timezone.set", TextComponent.of(tz.getDisplayName(
|
||||
actor.print(Caption.of("worldedit.timezone.set", TextComponent.of(tz.getDisplayName(
|
||||
TextStyle.FULL, actor.getLocale()
|
||||
))));
|
||||
actor.printInfo(TranslatableComponent.of("worldedit.timezone.current",
|
||||
actor.print(Caption.of("worldedit.timezone.current",
|
||||
TextComponent.of(dateFormat.withLocale(actor.getLocale()).format(ZonedDateTime.now(tz)))));
|
||||
} catch (ZoneRulesException e) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.timezone.invalid"));
|
||||
actor.print(Caption.of("worldedit.timezone.invalid"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command.tool;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
@ -80,7 +81,7 @@ public class AreaPickaxe implements BlockTool {
|
||||
}
|
||||
editSession.flushQueue();
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes"));
|
||||
player.print(Caption.of("worldedit.tool.max-block-changes"));
|
||||
} finally {
|
||||
session.remember(editSession);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command.tool;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
@ -65,12 +66,12 @@ public class BlockDataCyler implements DoubleActionBlockTool {
|
||||
if (!config.allowedDataCycleBlocks.isEmpty()
|
||||
&& !player.hasPermission("worldedit.override.data-cycler")
|
||||
&& !config.allowedDataCycleBlocks.contains(block.getBlockType().getId())) {
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.data-cycler.block-not-permitted"));
|
||||
player.print(Caption.of("worldedit.tool.data-cycler.block-not-permitted"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (block.getStates().keySet().isEmpty()) {
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.data-cycler.cant-cycle"));
|
||||
player.print(Caption.of("worldedit.tool.data-cycler.cant-cycle"));
|
||||
} else {
|
||||
Property<?> currentProperty = selectedProperties.get(player.getUniqueId());
|
||||
|
||||
@ -92,13 +93,13 @@ public class BlockDataCyler implements DoubleActionBlockTool {
|
||||
|
||||
try {
|
||||
editSession.setBlock(blockPoint, newBlock);
|
||||
player.printInfo(TranslatableComponent.of(
|
||||
player.print(Caption.of(
|
||||
"worldedit.tool.data-cycler.new-value",
|
||||
TextComponent.of(currentProperty.getName()),
|
||||
TextComponent.of(String.valueOf(currentProperty.getValues().get(index)))
|
||||
));
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes"));
|
||||
player.print(Caption.of("worldedit.tool.max-block-changes"));
|
||||
} finally {
|
||||
session.remember(editSession);
|
||||
}
|
||||
@ -109,7 +110,7 @@ public class BlockDataCyler implements DoubleActionBlockTool {
|
||||
index = (index + 1) % properties.size();
|
||||
currentProperty = properties.get(index);
|
||||
selectedProperties.put(player.getUniqueId(), currentProperty);
|
||||
player.printInfo(TranslatableComponent.of("worldedit.tool.data-cycler.cycling", TextComponent.of(currentProperty.getName())));
|
||||
player.print(Caption.of("worldedit.tool.data-cycler.cycling", TextComponent.of(currentProperty.getName())));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command.tool;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
@ -78,7 +79,7 @@ public class BlockReplacer implements DoubleActionBlockTool {
|
||||
|
||||
if (targetBlock != null) {
|
||||
pattern = targetBlock;
|
||||
player.printInfo(TranslatableComponent.of("worldedit.tool.repl.switched", targetBlock.getBlockType().getRichName()));
|
||||
player.print(Caption.of("worldedit.tool.repl.switched", targetBlock.getBlockType().getRichName()));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -446,7 +446,7 @@ public class BrushTool
|
||||
|
||||
if (target == null) {
|
||||
editSession.cancel();
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.no-block"));
|
||||
player.print(Caption.of("worldedit.tool.no-block"));
|
||||
return true;
|
||||
}
|
||||
BlockBag bag = session.getBlockBag(player);
|
||||
@ -481,7 +481,7 @@ public class BrushTool
|
||||
WorldEdit.getInstance().checkMaxBrushRadius(size);
|
||||
brush.build(editSession, target.toBlockPoint(), current.getMaterial(), size);
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes"));
|
||||
player.print(Caption.of("worldedit.tool.max-block-changes"));
|
||||
} finally {
|
||||
session.remember(editSession);
|
||||
if (bag != null) {
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command.tool;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
@ -79,7 +80,7 @@ public class DistanceWand extends BrushTool implements DoubleActionTraceTool {
|
||||
}
|
||||
|
||||
if (target == null) {
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.no-block"));
|
||||
player.print(Caption.of("worldedit.tool.no-block"));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command.tool;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.object.collection.LocalBlockVectorSet;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
@ -75,7 +76,7 @@ public class FloatingTreeRemover implements BlockTool {
|
||||
final BlockState state = world.getBlock(clicked.toVector().toBlockPoint());
|
||||
|
||||
if (!isTreeBlock(state.getBlockType())) {
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.deltree.not-tree"));
|
||||
player.print(Caption.of("worldedit.tool.deltree.not-tree"));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -83,7 +84,7 @@ public class FloatingTreeRemover implements BlockTool {
|
||||
try {
|
||||
final Set<BlockVector3> blockSet = bfs(world, clicked.toVector().toBlockPoint());
|
||||
if (blockSet == null) {
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.deltree.not-floating"));
|
||||
player.print(Caption.of("worldedit.tool.deltree.not-floating"));
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -94,7 +95,7 @@ public class FloatingTreeRemover implements BlockTool {
|
||||
}
|
||||
}
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes"));
|
||||
player.print(Caption.of("worldedit.tool.max-block-changes"));
|
||||
} finally {
|
||||
session.remember(editSession);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command.tool;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
@ -83,7 +84,7 @@ public class FloodFillTool implements BlockTool {
|
||||
visitor.visit(origin);
|
||||
Operations.completeLegacy(visitor);
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes"));
|
||||
player.print(Caption.of("worldedit.tool.max-block-changes"));
|
||||
} finally {
|
||||
session.remember(editSession);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command.tool;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
@ -121,7 +122,7 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo
|
||||
}
|
||||
|
||||
if (target == null) {
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.no-block"));
|
||||
player.print(Caption.of("worldedit.tool.no-block"));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command.tool;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
@ -43,7 +44,7 @@ public enum NavigationWand implements DoubleActionTraceTool {
|
||||
if (pos != null) {
|
||||
player.findFreePosition(pos);
|
||||
} else {
|
||||
player.printError(TranslatableComponent.of("worldedit.jumpto.none"));
|
||||
player.print(Caption.of("worldedit.jumpto.none"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -59,7 +60,7 @@ public enum NavigationWand implements DoubleActionTraceTool {
|
||||
}
|
||||
|
||||
if (!player.passThroughForwardWall(Math.max(1, maxDist - 10))) {
|
||||
player.printError(TranslatableComponent.of("worldedit.thru.obstructed"));
|
||||
player.print(Caption.of("worldedit.thru.obstructed"));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command.tool;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
@ -61,21 +62,21 @@ public class QueryTool implements BlockTool {
|
||||
builder.append(TextComponent.of("@" + clicked.toVector().toBlockPoint() + ": ", TextColor.BLUE));
|
||||
builder.append(block.getBlockType().getRichName().color(TextColor.YELLOW));
|
||||
builder.append(TextComponent.of(" (" + block + ") ", TextColor.GRAY)
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TranslatableComponent.of("worldedit.tool.info.blockstate.hover"))));
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, Caption.of("worldedit.tool.info.blockstate.hover"))));
|
||||
final int internalId = BlockStateIdAccess.getBlockStateId(block.toImmutableState());
|
||||
if (BlockStateIdAccess.isValidInternalId(internalId)) {
|
||||
builder.append(TextComponent.of(" (" + internalId + ") ", TextColor.DARK_GRAY)
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TranslatableComponent.of("worldedit.tool.info.internalid.hover"))));
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, Caption.of("worldedit.tool.info.internalid.hover"))));
|
||||
}
|
||||
final int[] legacy = LegacyMapper.getInstance().getLegacyFromBlock(block.toImmutableState());
|
||||
if (legacy != null) {
|
||||
builder.append(TextComponent.of(" (" + legacy[0] + ":" + legacy[1] + ") ", TextColor.DARK_GRAY)
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TranslatableComponent.of("worldedit.tool.info.legacy.hover"))));
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, Caption.of("worldedit.tool.info.legacy.hover"))));
|
||||
}
|
||||
|
||||
builder.append(TextComponent.of(" (" + world.getBlockLightLevel(blockPoint) + "/"
|
||||
+ world.getBlockLightLevel(blockPoint.add(0, 1, 0)) + ")", TextColor.WHITE)
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TranslatableComponent.of("worldedit.tool.info.light.hover"))));
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, Caption.of("worldedit.tool.info.light.hover"))));
|
||||
|
||||
player.print(builder.build());
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command.tool;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
@ -57,7 +58,7 @@ public class SinglePickaxe implements BlockTool {
|
||||
editSession.setBlock(blockPoint, BlockTypes.AIR.getDefaultState());
|
||||
session.remember(editSession);
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes"));
|
||||
player.print(Caption.of("worldedit.tool.max-block-changes"));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command.tool;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
@ -63,10 +64,10 @@ public class TreePlanter implements BlockTool {
|
||||
}
|
||||
|
||||
if (!successful) {
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.tree.obstructed"));
|
||||
player.print(Caption.of("worldedit.tool.tree.obstructed"));
|
||||
}
|
||||
} catch (MaxChangedBlocksException e) {
|
||||
player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes"));
|
||||
player.print(Caption.of("worldedit.tool.max-block-changes"));
|
||||
} finally {
|
||||
session.remember(editSession);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.command.util;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Iterables;
|
||||
@ -79,7 +80,7 @@ public class PrintCommandHelp {
|
||||
List<Command> visited = new ArrayList<>();
|
||||
Command currentCommand = detectCommand(manager, commandPath.get(0));
|
||||
if (currentCommand == null) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.help.command-not-found", TextComponent.of(commandPath.get(0))));
|
||||
actor.print(Caption.of("worldedit.help.command-not-found", TextComponent.of(commandPath.get(0))));
|
||||
return;
|
||||
}
|
||||
visited.add(currentCommand);
|
||||
@ -90,7 +91,7 @@ public class PrintCommandHelp {
|
||||
Map<String, Command> subCommands = getSubCommands(currentCommand);
|
||||
|
||||
if (subCommands.isEmpty()) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.help.no-subcommands",
|
||||
actor.print(Caption.of("worldedit.help.no-subcommands",
|
||||
TextComponent.of(toCommandString(visited)), TextComponent.of(subCommand)));
|
||||
// full help for single command
|
||||
CommandUsageBox box = new CommandUsageBox(visited, visited.stream()
|
||||
@ -103,7 +104,7 @@ public class PrintCommandHelp {
|
||||
currentCommand = subCommands.get(subCommand);
|
||||
visited.add(currentCommand);
|
||||
} else {
|
||||
actor.printError(TranslatableComponent.of("worldedit.help.subcommand-not-found",
|
||||
actor.print(Caption.of("worldedit.help.subcommand-not-found",
|
||||
TextComponent.of(subCommand), TextComponent.of(toCommandString(visited))));
|
||||
// list subcommands for currentCommand
|
||||
printCommands(page, getSubCommands(Iterables.getLast(visited)).values().stream(), actor, visited, helpRootCommand);
|
||||
|
@ -14,7 +14,6 @@ import com.sk89q.worldedit.internal.util.Substring;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import org.enginehub.piston.exception.StopExecutionException;
|
||||
import org.enginehub.piston.inject.InjectAnnotation;
|
||||
import org.enginehub.piston.inject.InjectedValueAccess;
|
||||
@ -102,7 +101,7 @@ public @interface Confirm {
|
||||
if (checkExisting(context)) {
|
||||
return true;
|
||||
}
|
||||
actor.print(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.confirm"));
|
||||
actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason.confirm"));
|
||||
return confirm(actor, context);
|
||||
}
|
||||
};
|
||||
|
@ -20,6 +20,7 @@
|
||||
package com.sk89q.worldedit.entity;
|
||||
|
||||
import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.brush.visualization.VirtualWorld;
|
||||
import com.boydti.fawe.object.clipboard.DiskOptimizedClipboard;
|
||||
@ -47,14 +48,13 @@ import com.sk89q.worldedit.util.HandSide;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.util.formatting.text.Component;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.gamemode.GameMode;
|
||||
|
||||
import java.io.File;
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Represents a player.
|
||||
@ -431,12 +431,12 @@ public interface Player extends Entity, Actor {
|
||||
getSession().setClipboard(holder);
|
||||
}
|
||||
} catch (Exception event) {
|
||||
printError(TranslatableComponent.of("====== INVALID CLIPBOARD ======"));
|
||||
printError(TextComponent.of("====== INVALID CLIPBOARD ======"));
|
||||
event.printStackTrace();
|
||||
printError(TranslatableComponent.of("fawe.error.stacktrace"));
|
||||
printError(TranslatableComponent.of("fawe.error.no-failure"));
|
||||
printError(TranslatableComponent.of("File: ", TextComponent.of(file.getName()), TextComponent.of(" (len:"), TextComponent.of(file.length()), TextComponent.of(")")));
|
||||
printError(TranslatableComponent.of("fawe.error.stacktrace"));
|
||||
printError(Caption.of("fawe.error.stacktrace"));
|
||||
printError(Caption.of("fawe.error.no-failure"));
|
||||
printError(Caption.of("File: ", TextComponent.of(file.getName()), TextComponent.of(" (len:"), TextComponent.of(file.length()), TextComponent.of(")")));
|
||||
printError(Caption.of("fawe.error.stacktrace"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.factory;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.factory.parser.mask.AdjacentMaskParser;
|
||||
import com.sk89q.worldedit.extension.factory.parser.mask.AirMaskParser;
|
||||
@ -138,14 +139,14 @@ public final class MaskFactory extends AbstractFactory<Mask> {
|
||||
}
|
||||
}
|
||||
if (match == null) {
|
||||
throw new NoMatchException(TranslatableComponent.of("worldedit.error.no-match", TextComponent.of(component)));
|
||||
throw new NoMatchException(Caption.of("worldedit.error.no-match", TextComponent.of(component)));
|
||||
}
|
||||
masks.add(match);
|
||||
}
|
||||
|
||||
switch (masks.size()) {
|
||||
case 0:
|
||||
throw new NoMatchException(TranslatableComponent.of("worldedit.error.no-match", TextComponent.of(input)));
|
||||
throw new NoMatchException(Caption.of("worldedit.error.no-match", TextComponent.of(input)));
|
||||
case 1:
|
||||
return masks.get(0).optimize();
|
||||
default:
|
||||
|
@ -84,10 +84,10 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
} catch (NotABlockException e) {
|
||||
throw new InputParseException(e.getRichMessage());
|
||||
} catch (WorldEditException e) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.unknown", e.getRichMessage()), e);
|
||||
throw new InputParseException(Caption.of("worldedit.error.unknown", e.getRichMessage()), e);
|
||||
}
|
||||
} else {
|
||||
throw new InputParseException(TranslatableComponent.of(
|
||||
throw new InputParseException(Caption.of(
|
||||
"worldedit.error.parser.player-only",
|
||||
TextComponent.of(handSide == HandSide.MAIN_HAND ? "hand" : "offhand")
|
||||
));
|
||||
@ -181,7 +181,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
String[] parts = parseableData.split("=");
|
||||
if (parts.length != 2) {
|
||||
throw new InputParseException(
|
||||
TranslatableComponent.of("worldedit.error.parser.bad-state-format",
|
||||
Caption.of("worldedit.error.parser.bad-state-format",
|
||||
TextComponent.of(parseableData))
|
||||
);
|
||||
}
|
||||
@ -190,7 +190,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
Property<Object> propertyKey = (Property<Object>) type.getPropertyMap().get(parts[0]);
|
||||
if (propertyKey == null) {
|
||||
if (context.getActor() != null) {
|
||||
throw new NoMatchException(TranslatableComponent.of(
|
||||
throw new NoMatchException(Caption.of(
|
||||
"worldedit.error.parser.unknown-property",
|
||||
TextComponent.of(parts[0]),
|
||||
TextComponent.of(type.getId())
|
||||
@ -201,7 +201,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
if (blockStates.containsKey(propertyKey)) {
|
||||
throw new InputParseException(TranslatableComponent.of(
|
||||
throw new InputParseException(Caption.of(
|
||||
"worldedit.error.parser.duplicate-property",
|
||||
TextComponent.of(parts[0])
|
||||
));
|
||||
@ -210,7 +210,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
try {
|
||||
value = propertyKey.getValueFor(parts[1]);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new NoMatchException(TranslatableComponent.of(
|
||||
throw new NoMatchException(Caption.of(
|
||||
"worldedit.error.parser.unknown-value",
|
||||
TextComponent.of(parts[1]),
|
||||
TextComponent.of(propertyKey.getName())
|
||||
@ -221,7 +221,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
} catch (NoMatchException e) {
|
||||
throw e; // Pass-through
|
||||
} catch (Exception e) {
|
||||
throw new InputParseException(TranslatableComponent.of(
|
||||
throw new InputParseException(Caption.of(
|
||||
"worldedit.error.parser.bad-state-format",
|
||||
TextComponent.of(parseableData)
|
||||
));
|
||||
@ -264,14 +264,14 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
try {
|
||||
String[] split = blockAndExtraData[0].split(":", 2);
|
||||
if (split.length == 0) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.invalid-colon"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.parser.invalid-colon"));
|
||||
} else if (split.length == 1) {
|
||||
state = LegacyMapper.getInstance().getBlockFromLegacy(Integer.parseInt(split[0]));
|
||||
} else if (MathMan.isInteger(split[0])) {
|
||||
int id = Integer.parseInt(split[0]);
|
||||
int data = Integer.parseInt(split[1]);
|
||||
if (data < 0 || data >= 16) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.parser.invalid-data", TextComponent.of(data)));
|
||||
throw new InputParseException(Caption.of("fawe.error.parser.invalid-data", TextComponent.of(data)));
|
||||
}
|
||||
state = LegacyMapper.getInstance().getBlockFromLegacy(id, data);
|
||||
} else {
|
||||
@ -279,7 +279,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
if (type != null) {
|
||||
int data = Integer.parseInt(split[1]);
|
||||
if (data < 0 || data >= 16) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.parser.invalid-data", TextComponent.of(data)));
|
||||
throw new InputParseException(Caption.of("fawe.error.parser.invalid-data", TextComponent.of(data)));
|
||||
}
|
||||
state = LegacyMapper.getInstance().getBlockFromLegacy(type.getLegacyCombinedId() >> 4, data);
|
||||
}
|
||||
@ -298,11 +298,11 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
} else {
|
||||
typeString = blockAndExtraData[0].substring(0, stateStart);
|
||||
if (stateStart + 1 >= blockAndExtraData[0].length()) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.hanging-lbracket", TextComponent.of(stateStart)));
|
||||
throw new InputParseException(Caption.of("worldedit.error.parser.hanging-lbracket", TextComponent.of(stateStart)));
|
||||
}
|
||||
int stateEnd = blockAndExtraData[0].lastIndexOf(']');
|
||||
if (stateEnd < 0) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.missing-rbracket"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.parser.missing-rbracket"));
|
||||
}
|
||||
stateString = blockAndExtraData[0].substring(stateStart + 1, blockAndExtraData[0].length() - 1);
|
||||
}
|
||||
@ -311,7 +311,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
stateProperties = stateString.split(",");
|
||||
}
|
||||
if (typeString.isEmpty()) {
|
||||
throw new InputParseException(TranslatableComponent.of(
|
||||
throw new InputParseException(Caption.of(
|
||||
"worldedit.error.parser.bad-state-format",
|
||||
TextComponent.of(blockAndExtraData[0])
|
||||
));
|
||||
@ -334,25 +334,25 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
try {
|
||||
primaryPosition = context.requireSession().getRegionSelector(world).getVertices().get(index - 1);
|
||||
} catch (IncompleteRegionException e) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.incomplete-region"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.incomplete-region"));
|
||||
}
|
||||
state = world.getBlock(primaryPosition);
|
||||
} else if (typeString.matches("slot[0-9]+")) {
|
||||
int slot = Integer.parseInt(typeString.substring(4)) - 1;
|
||||
Actor actor = context.requireActor();
|
||||
if (!(actor instanceof Player)) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.command.player-only"));
|
||||
throw new InputParseException(Caption.of("worldedit.command.player-only"));
|
||||
}
|
||||
Player player = (Player) actor;
|
||||
BlockBag bag = player.getInventoryBlockBag();
|
||||
if (!(bag instanceof SlottableBlockBag)) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.unsupported"));
|
||||
throw new InputParseException(Caption.of("fawe.error.unsupported"));
|
||||
}
|
||||
SlottableBlockBag slottable = (SlottableBlockBag) bag;
|
||||
BaseItem item = slottable.getItem(slot);
|
||||
|
||||
if (!item.getType().hasBlockType()) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.not-a-block"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.not-a-block"));
|
||||
}
|
||||
state = item.getType().getBlockType().getDefaultState();
|
||||
nbt = item.getNbtData();
|
||||
@ -363,7 +363,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
state = type.getDefaultState();
|
||||
}
|
||||
if (state == null) {
|
||||
throw new NoMatchException(TranslatableComponent.of("fawe.error.invalid-block-type", TextComponent.of(input)));
|
||||
throw new NoMatchException(Caption.of("fawe.error.invalid-block-type", TextComponent.of(input)));
|
||||
}
|
||||
}
|
||||
if (nbt == null) {
|
||||
@ -394,7 +394,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
}
|
||||
// this should be impossible but IntelliJ isn't that smart
|
||||
if (state == null) {
|
||||
throw new NoMatchException(TranslatableComponent.of("fawe.error.invalid-block-type", TextComponent.of(input)));
|
||||
throw new NoMatchException(Caption.of("fawe.error.invalid-block-type", TextComponent.of(input)));
|
||||
}
|
||||
|
||||
if (blockAndExtraData.length > 1 && blockAndExtraData[1].startsWith("{")) {
|
||||
@ -402,7 +402,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
try {
|
||||
nbt = JSON2NBT.getTagFromJson(joined);
|
||||
} catch (NBTException e) {
|
||||
throw new NoMatchException(TranslatableComponent.of(e.getMessage()));
|
||||
throw new NoMatchException(Caption.of(e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -413,7 +413,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
Actor actor = context.requireActor();
|
||||
if (actor != null && !actor.hasPermission("worldedit.anyblock")
|
||||
&& worldEdit.getConfiguration().disallowedBlocks.contains(blockType.getId())) {
|
||||
throw new DisallowedUsageException(TranslatableComponent.of("fawe.error.block.not.allowed", TextComponent.of(input)));
|
||||
throw new DisallowedUsageException(Caption.of("fawe.error.block.not.allowed", TextComponent.of(input)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -436,11 +436,11 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
String mobName = blockAndExtraData[1];
|
||||
EntityType ent = EntityTypes.get(mobName.toLowerCase(Locale.ROOT));
|
||||
if (ent == null) {
|
||||
throw new NoMatchException(TranslatableComponent.of("worldedit.error.unknown-entity", TextComponent.of(mobName)));
|
||||
throw new NoMatchException(Caption.of("worldedit.error.unknown-entity", TextComponent.of(mobName)));
|
||||
}
|
||||
mobName = ent.getId();
|
||||
if (!worldEdit.getPlatformManager().queryCapability(Capability.USER_COMMANDS).isValidMobType(mobName)) {
|
||||
throw new NoMatchException(TranslatableComponent.of("worldedit.error.unknown-mob", TextComponent.of(mobName)));
|
||||
throw new NoMatchException(Caption.of("worldedit.error.unknown-mob", TextComponent.of(mobName)));
|
||||
}
|
||||
return validate(context, new MobSpawnerBlock(state, mobName));
|
||||
} else {
|
||||
@ -465,12 +465,12 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
|
||||
if (context.isRestricted()) {
|
||||
Actor actor = context.requireActor();
|
||||
if (!actor.hasPermission("worldedit.anyblock") && worldEdit.getConfiguration().checkDisallowedBlocks(holder)) {
|
||||
throw new DisallowedUsageException(TranslatableComponent.of("fawe.error.block.not.allowed", TextComponent.of(String.valueOf(holder))));
|
||||
throw new DisallowedUsageException(Caption.of("fawe.error.block.not.allowed", TextComponent.of(String.valueOf(holder))));
|
||||
}
|
||||
CompoundTag nbt = holder.getNbtData();
|
||||
if (nbt != null) {
|
||||
if (!actor.hasPermission("worldedit.anyblock")) {
|
||||
throw new DisallowedUsageException(TranslatableComponent.of("fawe.error.nbt.forbidden"));
|
||||
throw new DisallowedUsageException(Caption.of("fawe.error.nbt.forbidden"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.factory.parser;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.blocks.BaseItem;
|
||||
import com.sk89q.worldedit.blocks.BaseItemStack;
|
||||
@ -58,7 +59,7 @@ public class DefaultItemParser extends InputParser<BaseItem> {
|
||||
String[] split = input.split(":");
|
||||
ItemType type;
|
||||
if (split.length == 0) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.invalid-colon"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.parser.invalid-colon"));
|
||||
} else if (split.length == 1) {
|
||||
type = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(split[0]));
|
||||
} else {
|
||||
@ -85,7 +86,7 @@ public class DefaultItemParser extends InputParser<BaseItem> {
|
||||
}
|
||||
|
||||
if (item == null) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.unknown-item", TextComponent.of(input)));
|
||||
throw new InputParseException(Caption.of("worldedit.error.unknown-item", TextComponent.of(input)));
|
||||
} else {
|
||||
return item;
|
||||
}
|
||||
@ -95,7 +96,7 @@ public class DefaultItemParser extends InputParser<BaseItem> {
|
||||
if (actor instanceof Player) {
|
||||
return ((Player) actor).getItemInHand(handSide);
|
||||
} else {
|
||||
throw new InputParseException(TranslatableComponent.of(
|
||||
throw new InputParseException(Caption.of(
|
||||
"worldedit.error.parser.player-only",
|
||||
TextComponent.of(handSide == HandSide.MAIN_HAND ? "hand" : "offhand")
|
||||
));
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.sk89q.worldedit.extension.factory.parser;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
@ -143,7 +144,7 @@ public abstract class RichParser<E> extends InputParser<E> {
|
||||
arguments.add(input.substring(openIndex + 1));
|
||||
}
|
||||
if (requireClosing && open != 0) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-bracketing", TextComponent.of("'[' or ']'?")));
|
||||
throw new InputParseException(Caption.of("fawe.error.invalid-bracketing", TextComponent.of("'[' or ']'?")));
|
||||
}
|
||||
return arguments.toArray(new String[0]);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.sk89q.worldedit.extension.factory.parser.mask;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.object.mask.AngleMask;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.command.util.SuggestionHelper;
|
||||
@ -40,7 +41,7 @@ public class AngleMaskParser extends RichParser<Mask> {
|
||||
String maxArg = arguments[1];
|
||||
boolean degree = minArg.endsWith("d");
|
||||
if (degree ^ maxArg.endsWith("d")) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.mask.angle"));
|
||||
throw new InputParseException(Caption.of("fawe.error.mask.angle"));
|
||||
}
|
||||
boolean overlay = false;
|
||||
if (arguments.length > 2) {
|
||||
@ -49,7 +50,7 @@ public class AngleMaskParser extends RichParser<Mask> {
|
||||
if (flag.equals("-o")) {
|
||||
overlay = true;
|
||||
} else {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-flag",
|
||||
throw new InputParseException(Caption.of("fawe.error.invalid-flag",
|
||||
TextComponent.of(flag)));
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.factory.parser.mask;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.command.util.SuggestionHelper;
|
||||
@ -74,7 +75,7 @@ public class BiomeMaskParser extends InputParser<Mask> {
|
||||
for (String biomeName : Splitter.on(",").split(input.substring(1))) {
|
||||
BiomeType biome = BiomeType.REGISTRY.get(biomeName);
|
||||
if (biome == null) {
|
||||
throw new NoMatchException(TranslatableComponent.of("worldedit.error.unknown-biome", TextComponent.of(biomeName)));
|
||||
throw new NoMatchException(Caption.of("worldedit.error.unknown-biome", TextComponent.of(biomeName)));
|
||||
}
|
||||
biomes.add(biome);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.factory.parser.mask;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.command.util.SuggestionHelper;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
@ -53,7 +54,7 @@ public class BlockCategoryMaskParser extends InputParser<Mask> {
|
||||
// This means it's a tag mask.
|
||||
BlockCategory category = BlockCategory.REGISTRY.get(input.substring(2).toLowerCase(Locale.ROOT));
|
||||
if (category == null) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.unrecognised-tag", TextComponent.of(input.substring(2)), TextComponent.of("\\")));
|
||||
throw new InputParseException(Caption.of("fawe.error.unrecognised-tag", TextComponent.of(input.substring(2)), TextComponent.of("\\")));
|
||||
} else {
|
||||
return new BlockCategoryMask(context.requireExtent(), category);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.factory.parser.mask;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
@ -58,7 +59,7 @@ public class BlockStateMaskParser extends InputParser<Mask> {
|
||||
Splitter.on(',').omitEmptyStrings().trimResults().withKeyValueSeparator('=').split(states),
|
||||
strict);
|
||||
} catch (Exception e) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-states", TextComponent.of(String.valueOf(e))));
|
||||
throw new InputParseException(Caption.of("fawe.error.invalid-states", TextComponent.of(String.valueOf(e))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.factory.parser.mask;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
@ -68,7 +69,7 @@ public class ExpressionMaskParser extends InputParser<Mask> {
|
||||
}
|
||||
return new ExpressionMask(exp);
|
||||
} catch (ExpressionException e) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.invalid-expression", TextComponent.of(e.getMessage())));
|
||||
throw new InputParseException(Caption.of("worldedit.error.parser.invalid-expression", TextComponent.of(e.getMessage())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.sk89q.worldedit.extension.factory.parser.mask;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.object.mask.ExtremaMask;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.command.util.SuggestionHelper;
|
||||
@ -40,7 +41,7 @@ public class ExtremaMaskParser extends RichParser<Mask> {
|
||||
String maxArg = arguments[1];
|
||||
boolean degree = minArg.endsWith("d");
|
||||
if (degree ^ maxArg.endsWith("d")) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.mask.angle"));
|
||||
throw new InputParseException(Caption.of("fawe.error.mask.angle"));
|
||||
}
|
||||
double min;
|
||||
double max;
|
||||
@ -51,7 +52,7 @@ public class ExtremaMaskParser extends RichParser<Mask> {
|
||||
if (flag.equals("-o")) {
|
||||
overlay = true;
|
||||
} else {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-flag",
|
||||
throw new InputParseException(Caption.of("fawe.error.invalid-flag",
|
||||
TextComponent.of(flag)));
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.factory.parser.mask;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
@ -55,7 +56,7 @@ public class NegateMaskParser extends InputParser<Mask> {
|
||||
if (input.length() > 1) {
|
||||
return Masks.negate(worldEdit.getMaskFactory().parseFromInput(input.substring(1), context));
|
||||
} else {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.negate-nothing"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.parser.negate-nothing"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.sk89q.worldedit.extension.factory.parser.mask;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.object.mask.ROCAngleMask;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.command.util.SuggestionHelper;
|
||||
@ -40,7 +41,7 @@ public class ROCAngleMaskParser extends RichParser<Mask> {
|
||||
String maxArg = arguments[1];
|
||||
boolean degree = minArg.endsWith("d");
|
||||
if (degree ^ maxArg.endsWith("d")) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.mask.angle"));
|
||||
throw new InputParseException(Caption.of("fawe.error.mask.angle"));
|
||||
}
|
||||
double min;
|
||||
double max;
|
||||
@ -51,7 +52,7 @@ public class ROCAngleMaskParser extends RichParser<Mask> {
|
||||
if (flag.equals("-o")) {
|
||||
overlay = true;
|
||||
} else {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-flag",
|
||||
throw new InputParseException(Caption.of("fawe.error.invalid-flag",
|
||||
TextComponent.of(flag)));
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.factory.parser.mask;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
@ -49,7 +50,7 @@ public class RegionMaskParser extends SimpleInputParser<Mask> {
|
||||
try {
|
||||
return new RegionMask(context.requireSession().getSelection(context.requireWorld()).clone());
|
||||
} catch (IncompleteRegionException e) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.incomplete-region"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.incomplete-region"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.sk89q.worldedit.extension.factory.parser.pattern;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.object.pattern.BiomeApplyingPattern;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.factory.parser.RichParser;
|
||||
@ -34,7 +35,7 @@ public class BiomePatternParser extends RichParser<Pattern> {
|
||||
String biomeId = input.substring(1);
|
||||
BiomeType biomeType = BiomeTypes.get(biomeId);
|
||||
if (biomeType == null) {
|
||||
throw new NoMatchException(TranslatableComponent.of("worldedit.error.unknown-biome", TextComponent.of(biomeId)));
|
||||
throw new NoMatchException(Caption.of("worldedit.error.unknown-biome", TextComponent.of(biomeId)));
|
||||
}
|
||||
return new BiomeApplyingPattern(context.requireExtent(), biomeType);
|
||||
} else {
|
||||
@ -63,11 +64,11 @@ public class BiomePatternParser extends RichParser<Pattern> {
|
||||
@Override
|
||||
protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
|
||||
if (arguments.length != 1) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-arguments", TextComponent.of("#biome[<biome>]")));
|
||||
throw new InputParseException(Caption.of("fawe.error.invalid-arguments", TextComponent.of("#biome[<biome>]")));
|
||||
}
|
||||
BiomeType biomeType = BiomeTypes.get(arguments[0]);
|
||||
if (biomeType == null) {
|
||||
throw new NoMatchException(TranslatableComponent.of("worldedit.error.unknown-biome", TextComponent.of(arguments[0])));
|
||||
throw new NoMatchException(Caption.of("worldedit.error.unknown-biome", TextComponent.of(arguments[0])));
|
||||
}
|
||||
return new BiomeApplyingPattern(context.requireExtent(), biomeType);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.factory.parser.pattern;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.command.util.SuggestionHelper;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
@ -60,13 +61,13 @@ public class BlockCategoryPatternParser extends InputParser<Pattern> {
|
||||
|
||||
BlockCategory category = BlockCategory.REGISTRY.get(tag);
|
||||
if (category == null) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.unknown-block-tag", TextComponent.of(tag)));
|
||||
throw new InputParseException(Caption.of("fawe.error.unknown-block-tag", TextComponent.of(tag)));
|
||||
}
|
||||
RandomPattern randomPattern = new RandomPattern();
|
||||
|
||||
Set<BlockType> blocks = category.getAll();
|
||||
if (blocks.isEmpty()) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.block-tag-no-blocks", TextComponent.of(category.getId())));
|
||||
throw new InputParseException(Caption.of("fawe.error.block-tag-no-blocks", TextComponent.of(category.getId())));
|
||||
}
|
||||
|
||||
if (anyState) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.sk89q.worldedit.extension.factory.parser.pattern;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.object.pattern.BufferedPattern;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.factory.parser.RichParser;
|
||||
@ -34,7 +35,7 @@ public class BufferedPatternParser extends RichParser<Pattern> {
|
||||
@Override
|
||||
protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
|
||||
if (arguments.length != 1) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.command.syntax",
|
||||
throw new InputParseException(Caption.of("fawe.error.command.syntax",
|
||||
TextComponent.of(getPrefix() + "[pattern] (e.g. " + getPrefix() + "[stone,dirt])")));
|
||||
}
|
||||
Pattern inner = this.worldEdit.getPatternFactory().parseFromInput(arguments[0], context);
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.factory.parser.pattern;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.EmptyClipboardException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
@ -80,11 +81,11 @@ public class ClipboardPatternParser extends InputParser<Pattern> {
|
||||
String coords = offsetParts[1];
|
||||
if (coords.length() < 7 // min length of `[x,y,z]`
|
||||
|| coords.charAt(0) != '[' || coords.charAt(coords.length() - 1) != ']') {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.clipboard.missing-offset"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.parser.clipboard.missing-offset"));
|
||||
}
|
||||
String[] offsetSplit = coords.substring(1, coords.length() - 1).split(",");
|
||||
if (offsetSplit.length != 3) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.clipboard.missing-coordinates"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.parser.clipboard.missing-coordinates"));
|
||||
}
|
||||
offset = BlockVector3.at(
|
||||
Integer.valueOf(offsetSplit[0]),
|
||||
@ -99,10 +100,10 @@ public class ClipboardPatternParser extends InputParser<Pattern> {
|
||||
Clipboard clipboard = holder.getClipboard();
|
||||
return new ClipboardPattern(clipboard, offset);
|
||||
} catch (EmptyClipboardException e) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.empty-clipboard", TextComponent.of("#clipboard")));
|
||||
throw new InputParseException(Caption.of("fawe.error.empty-clipboard", TextComponent.of("#clipboard")));
|
||||
}
|
||||
} else {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.no-session"));
|
||||
throw new InputParseException(Caption.of("fawe.error.no-session"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.sk89q.worldedit.extension.factory.parser.pattern;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.object.pattern.Linear2DBlockPattern;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
@ -44,7 +45,7 @@ public class Linear2DPatternParser extends RichParser<Pattern> {
|
||||
@Override
|
||||
protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
|
||||
if (arguments.length == 0 || arguments.length > 3) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.command.syntax",
|
||||
throw new InputParseException(Caption.of("fawe.error.command.syntax",
|
||||
TextComponent.of(getPrefix() + "[pattern] (e.g. " + getPrefix() + "[stone,dirt])")));
|
||||
}
|
||||
Pattern inner = this.worldEdit.getPatternFactory().parseFromInput(arguments[0], context);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.sk89q.worldedit.extension.factory.parser.pattern;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.object.pattern.Linear3DBlockPattern;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
@ -45,7 +46,7 @@ public class Linear3DPatternParser extends RichParser<Pattern> {
|
||||
@Override
|
||||
protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
|
||||
if (arguments.length == 0 || arguments.length > 4) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.command.syntax",
|
||||
throw new InputParseException(Caption.of("fawe.error.command.syntax",
|
||||
TextComponent.of(getPrefix() + "[pattern] (e.g. " + getPrefix() + "[stone,dirt])")));
|
||||
}
|
||||
Pattern inner = this.worldEdit.getPatternFactory().parseFromInput(arguments[0], context);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.sk89q.worldedit.extension.factory.parser.pattern;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.object.random.NoiseRandom;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.command.util.SuggestionHelper;
|
||||
@ -49,7 +50,7 @@ public abstract class NoisePatternParser extends RichParser<Pattern> {
|
||||
@Override
|
||||
protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) {
|
||||
if (arguments.length != 2) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.command.syntax",
|
||||
throw new InputParseException(Caption.of("fawe.error.command.syntax",
|
||||
TextComponent.of(getPrefix() + "[scale][pattern] (e.g. " + getPrefix() + "[5][dirt,stone])")));
|
||||
}
|
||||
double scale = parseScale(arguments[0]);
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.factory.parser.pattern;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.util.StringUtil;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
@ -81,7 +82,7 @@ public class RandomPatternParser extends InputParser<Pattern> {
|
||||
String[] p = token.split("%", 2);
|
||||
|
||||
if (p.length < 2) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.missing-random-type", TextComponent.of(input)));
|
||||
throw new InputParseException(Caption.of("worldedit.error.parser.missing-random-type", TextComponent.of(input)));
|
||||
} else {
|
||||
chance = Double.parseDouble(p[0]);
|
||||
innerPattern = worldEdit.getPatternFactory().parseFromInput(p[1], context);
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.factory.parser.pattern;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.command.util.SuggestionHelper;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
@ -85,28 +86,28 @@ public class TypeOrStateApplyingPatternParser extends InputParser<Pattern> {
|
||||
} else {
|
||||
// states given
|
||||
if (!parts[1].endsWith("]")) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.missing-rbracket"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.parser.missing-rbracket"));
|
||||
}
|
||||
final String[] states = parts[1].substring(0, parts[1].length() - 1).split(",");
|
||||
Map<String, String> statesToSet = new HashMap<>();
|
||||
for (String state : states) {
|
||||
if (state.isEmpty()) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.empty-state"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.parser.empty-state"));
|
||||
}
|
||||
String[] propVal = state.split("=", 2);
|
||||
if (propVal.length != 2) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.missing-equals-separator"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.parser.missing-equals-separator"));
|
||||
}
|
||||
final String prop = propVal[0];
|
||||
if (prop.isEmpty()) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.empty-property"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.parser.empty-property"));
|
||||
}
|
||||
final String value = propVal[1];
|
||||
if (value.isEmpty()) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.empty-value"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.parser.empty-value"));
|
||||
}
|
||||
if (statesToSet.put(prop, value) != null) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.duplicate-property", TextComponent.of(prop)));
|
||||
throw new InputParseException(Caption.of("worldedit.error.parser.duplicate-property", TextComponent.of(prop)));
|
||||
}
|
||||
}
|
||||
if (type.isEmpty()) {
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.input;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.extension.factory.MaskFactory;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
@ -157,7 +158,7 @@ public class ParserContext {
|
||||
public Extent requireExtent() throws InputParseException {
|
||||
Extent extent = getExtent();
|
||||
if (extent == null) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.missing-extent"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.missing-extent"));
|
||||
}
|
||||
return extent;
|
||||
}
|
||||
@ -171,7 +172,7 @@ public class ParserContext {
|
||||
public LocalSession requireSession() throws InputParseException {
|
||||
LocalSession session = getSession();
|
||||
if (session == null) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.missing-session"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.missing-session"));
|
||||
}
|
||||
return session;
|
||||
}
|
||||
@ -185,7 +186,7 @@ public class ParserContext {
|
||||
public World requireWorld() throws InputParseException {
|
||||
World world = getWorld();
|
||||
if (world == null) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.missing-world"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.missing-world"));
|
||||
}
|
||||
return world;
|
||||
}
|
||||
@ -199,7 +200,7 @@ public class ParserContext {
|
||||
public Actor requireActor() throws InputParseException {
|
||||
Actor actor = getActor();
|
||||
if (actor == null) {
|
||||
throw new InputParseException(TranslatableComponent.of("worldedit.error.missing-actor"));
|
||||
throw new InputParseException(Caption.of("worldedit.error.missing-actor"));
|
||||
}
|
||||
return actor;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.platform;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.object.exception.FaweException;
|
||||
import com.boydti.fawe.object.task.AsyncNotifyQueue;
|
||||
import com.boydti.fawe.util.TaskManager;
|
||||
@ -71,7 +72,7 @@ public abstract class AbstractNonPlayerActor implements Actor {
|
||||
throwable = throwable.getCause();
|
||||
}
|
||||
if (throwable instanceof WorldEditException) {
|
||||
printError(TranslatableComponent.of(throwable.getLocalizedMessage()));
|
||||
printError(Caption.of(throwable.getLocalizedMessage()));
|
||||
} else {
|
||||
FaweException fe = FaweException.get(throwable);
|
||||
if (fe != null) {
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.platform;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.object.exception.FaweException;
|
||||
import com.boydti.fawe.object.task.AsyncNotifyQueue;
|
||||
import com.boydti.fawe.regions.FaweMaskManager;
|
||||
@ -86,7 +87,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable {
|
||||
throwable = throwable.getCause();
|
||||
}
|
||||
if (throwable instanceof WorldEditException) {
|
||||
printError(TranslatableComponent.of(throwable.getLocalizedMessage()));
|
||||
printError(Caption.of(throwable.getLocalizedMessage()));
|
||||
} else {
|
||||
FaweException fe = FaweException.get(throwable);
|
||||
if (fe != null) {
|
||||
@ -666,13 +667,13 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable {
|
||||
|
||||
@Override
|
||||
public File openFileOpenDialog(String[] extensions) {
|
||||
printError(TranslatableComponent.of("worldedit.platform.no-file-dialog"));
|
||||
printError(Caption.of("worldedit.platform.no-file-dialog"));
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File openFileSaveDialog(String[] extensions) {
|
||||
printError(TranslatableComponent.of("worldedit.platform.no-file-dialog"));
|
||||
printError(Caption.of("worldedit.platform.no-file-dialog"));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -354,7 +354,7 @@ public final class PlatformCommandManager {
|
||||
additionalConfig.accept(manager);
|
||||
|
||||
final List<Command> subCommands = manager.getAllCommands().collect(Collectors.toList());
|
||||
cmd.addPart(SubCommandPart.builder(TranslatableComponent.of("worldedit.argument.action"),
|
||||
cmd.addPart(SubCommandPart.builder(Caption.of("worldedit.argument.action"),
|
||||
TextComponent.of("Sub-command to run."))
|
||||
.withCommands(subCommands)
|
||||
.required()
|
||||
@ -384,7 +384,7 @@ public final class PlatformCommandManager {
|
||||
additionalConfig.accept(manager);
|
||||
|
||||
final List<Command> subCommands = manager.getAllCommands().collect(Collectors.toList());
|
||||
cmd.addPart(SubCommandPart.builder(TranslatableComponent.of("worldedit.argument.action"),
|
||||
cmd.addPart(SubCommandPart.builder(Caption.of("worldedit.argument.action"),
|
||||
TextComponent.of("Sub-command to run."))
|
||||
.withCommands(subCommands)
|
||||
.required()
|
||||
@ -724,16 +724,16 @@ public final class PlatformCommandManager {
|
||||
actor.print(e.getRichMessage());
|
||||
}
|
||||
} catch (FaweException e) {
|
||||
actor.printError(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason", e.getComponent()));
|
||||
actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason", e.getComponent()));
|
||||
} catch (UsageException e) {
|
||||
ImmutableList<Command> cmd = e.getCommands();
|
||||
if (!cmd.isEmpty()) {
|
||||
actor.printError(TranslatableComponent.of("fawe.error.command.syntax", HelpGenerator.create(e.getCommandParseResult()).getFullHelp()));
|
||||
actor.print(Caption.of("fawe.error.command.syntax", HelpGenerator.create(e.getCommandParseResult()).getFullHelp()));
|
||||
}
|
||||
actor.printError(e.getRichMessage());
|
||||
} catch (CommandExecutionException e) {
|
||||
if (e.getCause() instanceof FaweException) {
|
||||
actor.printError(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason", ((FaweException)e.getCause()).getComponent()));
|
||||
actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason", ((FaweException)e.getCause()).getComponent()));
|
||||
} else {
|
||||
handleUnknownException(actor, e.getCause());
|
||||
}
|
||||
@ -741,7 +741,6 @@ public final class PlatformCommandManager {
|
||||
Component msg = e.getRichMessage();
|
||||
if (msg != TextComponent.empty()) {
|
||||
actor.print(TextComponent.builder("")
|
||||
.color(TextColor.RED)
|
||||
.append(e.getRichMessage())
|
||||
.build());
|
||||
List<String> argList = parseArgs(event.getArguments()).map(Substring::getSubstring).collect(Collectors.toList());
|
||||
@ -765,7 +764,7 @@ public final class PlatformCommandManager {
|
||||
int changed = editSession.getBlockChangeCount();
|
||||
double throughput = timeS == 0 ? changed : changed / timeS;
|
||||
if (time > 1000) {
|
||||
actor.printDebug(TranslatableComponent.of(
|
||||
actor.print(Caption.of(
|
||||
"worldedit.command.time-elapsed",
|
||||
TextComponent.of(timeS),
|
||||
TextComponent.of(changed),
|
||||
@ -807,7 +806,7 @@ public final class PlatformCommandManager {
|
||||
store.injectValue(Key.of(Player.class), ValueProvider.constant((Player) actor));
|
||||
} else {
|
||||
store.injectValue(Key.of(Player.class), context -> {
|
||||
throw new CommandException(TranslatableComponent.of("worldedit.command.player-only"), ImmutableList.of());
|
||||
throw new CommandException(Caption.of("worldedit.command.player-only"), ImmutableList.of());
|
||||
});
|
||||
}
|
||||
store.injectValue(Key.of(Arguments.class), ValueProvider.constant(arguments));
|
||||
@ -826,7 +825,7 @@ public final class PlatformCommandManager {
|
||||
}
|
||||
|
||||
private void handleUnknownException(Actor actor, Throwable t) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.command.error.report"));
|
||||
actor.print(Caption.of("worldedit.command.error.report"));
|
||||
actor.print(TextComponent.of(t.getClass().getName() + ": " + t.getMessage()));
|
||||
LOGGER.error("An unexpected error while handling a WorldEdit command", t);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.extension.platform;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.object.brush.visualization.VirtualWorld;
|
||||
import com.boydti.fawe.object.exception.FaweException;
|
||||
@ -407,10 +408,10 @@ public class PlatformManager {
|
||||
public void handleThrowable(Throwable e, Actor actor) {
|
||||
FaweException faweException = FaweException.get(e);
|
||||
if (faweException != null) {
|
||||
actor.print(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason", faweException.getComponent()));
|
||||
actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason", faweException.getComponent()));
|
||||
} else {
|
||||
actor.printError(TranslatableComponent.of("worldedit.command.error.report"));
|
||||
actor.print(TranslatableComponent.of(e.getClass().getName(), TextComponent.of(": "), TextComponent.of(e.getMessage())));
|
||||
actor.print(Caption.of("worldedit.command.error.report"));
|
||||
actor.print(Caption.of(e.getClass().getName(), TextComponent.of(": "), TextComponent.of(e.getMessage())));
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
@ -462,10 +463,10 @@ public class PlatformManager {
|
||||
} catch (Throwable e) {
|
||||
FaweException faweException = FaweException.get(e);
|
||||
if (faweException != null) {
|
||||
player.print(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason", faweException.getComponent()));
|
||||
player.print(Caption.of("fawe.cancel.worldedit.cancel.reason", faweException.getComponent()));
|
||||
} else {
|
||||
player.printError(TranslatableComponent.of("worldedit.command.error.report"));
|
||||
player.print(TranslatableComponent.of(e.getClass().getName() + ": " + e.getMessage()));
|
||||
player.print(Caption.of("worldedit.command.error.report"));
|
||||
player.print(Caption.of(e.getClass().getName() + ": " + e.getMessage()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
} finally {
|
||||
|
@ -116,7 +116,7 @@ public class ConsumeBindings extends Bindings {
|
||||
uuid = Fawe.imp().getUUID(argument);
|
||||
}
|
||||
if (uuid == null) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.player.not.found", TextComponent.of(argument)));
|
||||
throw new InputParseException(Caption.of("fawe.error.player.not.found", TextComponent.of(argument)));
|
||||
}
|
||||
return uuid;
|
||||
}
|
||||
@ -156,7 +156,7 @@ public class ConsumeBindings extends Bindings {
|
||||
try {
|
||||
return getWorldEdit().getBlockFactory().parseFromInput(argument, parserContext);
|
||||
} catch (NoMatchException e) {
|
||||
throw new InputParseException(TranslatableComponent.of(e.getMessage()));
|
||||
throw new InputParseException(Caption.of(e.getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public class ProvideBindings extends Bindings {
|
||||
public Region[] regions(Player player, FaweMaskManager.MaskType type) {
|
||||
Region[] regions = player.getCurrentRegions(type);
|
||||
if (regions == null) {
|
||||
throw new IllegalArgumentException(Caption.toString(TranslatableComponent.of("fawe.error.no.region")));
|
||||
throw new IllegalArgumentException(Caption.toString(Caption.of("fawe.error.no.region")));
|
||||
}
|
||||
return regions;
|
||||
}
|
||||
|
@ -35,8 +35,8 @@ import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@ -58,7 +58,6 @@ import java.util.Map.Entry;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
@ -210,7 +209,7 @@ public class ClipboardFormats {
|
||||
f = player.openFileOpenDialog(extensions);
|
||||
if (f == null || !f.exists()) {
|
||||
if (message) {
|
||||
player.printError(TranslatableComponent.of("worldedit.schematic.load.does-not-exist", TextComponent.of(input)));
|
||||
player.print(Caption.of("worldedit.schematic.load.does-not-exist", TextComponent.of(input)));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ package com.sk89q.worldedit.extent.world;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.function.factory;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
@ -198,8 +199,8 @@ public class Deform implements Contextual<Operation> {
|
||||
|
||||
@Override
|
||||
public Iterable<Component> getStatusMessages() {
|
||||
return ImmutableList.of(TranslatableComponent.of("worldedit.operation.deform.expression",
|
||||
TextComponent.of(expression).color(TextColor.LIGHT_PURPLE)));
|
||||
return ImmutableList.of(Caption.of("worldedit.operation.deform.expression",
|
||||
TextComponent.of(expression)));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.sk89q.worldedit.function.mask;
|
||||
|
||||
import com.boydti.fawe.command.SuggestInputParseException;
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.object.collection.FastBitSet;
|
||||
import com.boydti.fawe.object.string.MutableCharSequence;
|
||||
import com.boydti.fawe.util.StringMan;
|
||||
@ -127,7 +128,7 @@ public class BlockMaskBuilder {
|
||||
}
|
||||
}
|
||||
if (blockTypeList.isEmpty()) {
|
||||
throw new InputParseException(TranslatableComponent.of("fawe.error.no-block-found", TextComponent.of(input)));
|
||||
throw new InputParseException(Caption.of("fawe.error.no-block-found", TextComponent.of(input)));
|
||||
}
|
||||
if (blockTypeList.size() == 1) {
|
||||
type = blockTypeList.get(0);
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.function.operation;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.object.extent.BlockTranslateExtent;
|
||||
import com.boydti.fawe.object.extent.PositionTransformExtent;
|
||||
import com.boydti.fawe.object.function.block.BiomeCopy;
|
||||
@ -425,12 +426,12 @@ public class ForwardExtentCopy implements Operation {
|
||||
@Override
|
||||
public Iterable<Component> getStatusMessages() {
|
||||
return ImmutableList.of(
|
||||
TranslatableComponent.of("worldedit.operation.affected.block",
|
||||
TextComponent.of(affectedBlocks)).color(TextColor.LIGHT_PURPLE),
|
||||
TranslatableComponent.of("worldedit.operation.affected.biome",
|
||||
TextComponent.of(affectedBiomeCols)).color(TextColor.LIGHT_PURPLE),
|
||||
TranslatableComponent.of("worldedit.operation.affected.entity",
|
||||
TextComponent.of(affectedEntities)).color(TextColor.LIGHT_PURPLE)
|
||||
Caption.of("worldedit.operation.affected.block",
|
||||
TextComponent.of(affectedBlocks)),
|
||||
Caption.of("worldedit.operation.affected.biome",
|
||||
TextComponent.of(affectedBiomeCols)),
|
||||
Caption.of("worldedit.operation.affected.entity",
|
||||
TextComponent.of(affectedEntities))
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.function.visitor;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.object.collection.BlockVectorSet;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Sets;
|
||||
@ -281,10 +282,10 @@ public abstract class BreadthFirstSearch implements Operation {
|
||||
|
||||
@Override
|
||||
public Iterable<Component> getStatusMessages() {
|
||||
return ImmutableList.of(TranslatableComponent.of(
|
||||
return ImmutableList.of(Caption.of(
|
||||
"worldedit.operation.affected.block",
|
||||
TextComponent.of(getAffected())
|
||||
).color(TextColor.GRAY));
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.function.visitor;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
@ -82,10 +83,10 @@ public class EntityVisitor implements Operation {
|
||||
|
||||
@Override
|
||||
public Iterable<Component> getStatusMessages() {
|
||||
return ImmutableList.of(TranslatableComponent.of(
|
||||
return ImmutableList.of(Caption.of(
|
||||
"worldedit.operation.affected.entity",
|
||||
TextComponent.of(getAffected())
|
||||
).color(TextColor.GRAY));
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.function.visitor;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.function.FlatRegionFunction;
|
||||
@ -82,10 +83,10 @@ public class FlatRegionVisitor implements Operation {
|
||||
|
||||
@Override
|
||||
public Iterable<Component> getStatusMessages() {
|
||||
return ImmutableList.of(TranslatableComponent.of(
|
||||
return ImmutableList.of(Caption.of(
|
||||
"worldedit.operation.affected.column",
|
||||
TextComponent.of(getAffected())
|
||||
).color(TextColor.GRAY));
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.function.visitor;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.function.RegionFunction;
|
||||
@ -77,10 +78,10 @@ public class RegionVisitor implements Operation {
|
||||
|
||||
@Override
|
||||
public Iterable<Component> getStatusMessages() {
|
||||
return ImmutableList.of(TranslatableComponent.of(
|
||||
return ImmutableList.of(Caption.of(
|
||||
"worldedit.operation.affected.block",
|
||||
TextComponent.of(getAffected())
|
||||
).color(TextColor.LIGHT_PURPLE));
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.internal.command.exception;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.sk89q.worldedit.DisallowedItemException;
|
||||
import com.sk89q.worldedit.EmptyClipboardException;
|
||||
@ -76,15 +77,15 @@ public class WorldEditExceptionConverter extends ExceptionConverterHelper {
|
||||
final Matcher matcher = numberFormat.matcher(e.getMessage());
|
||||
|
||||
if (matcher.matches()) {
|
||||
throw newCommandException(TranslatableComponent.of("worldedit.error.invalid-number.matches", TextComponent.of(matcher.group(1))), e);
|
||||
throw newCommandException(Caption.of("worldedit.error.invalid-number.matches", TextComponent.of(matcher.group(1))), e);
|
||||
} else {
|
||||
throw newCommandException(TranslatableComponent.of("worldedit.error.invalid-number"), e);
|
||||
throw newCommandException(Caption.of("worldedit.error.invalid-number"), e);
|
||||
}
|
||||
}
|
||||
|
||||
@ExceptionMatch
|
||||
public void convert(IncompleteRegionException e) throws CommandException {
|
||||
throw newCommandException(TranslatableComponent.of("worldedit.error.incomplete-region"), e);
|
||||
throw newCommandException(Caption.of("worldedit.error.incomplete-region"), e);
|
||||
}
|
||||
|
||||
@ExceptionMatch
|
||||
@ -94,7 +95,7 @@ public class WorldEditExceptionConverter extends ExceptionConverterHelper {
|
||||
|
||||
@ExceptionMatch
|
||||
public void convert(UnknownItemException e) throws CommandException {
|
||||
throw newCommandException(TranslatableComponent.of("worldedit.error.unknown-block", TextComponent.of(e.getID())), e);
|
||||
throw newCommandException(Caption.of("worldedit.error.unknown-block", TextComponent.of(e.getID())), e);
|
||||
}
|
||||
|
||||
@ExceptionMatch
|
||||
@ -104,18 +105,18 @@ public class WorldEditExceptionConverter extends ExceptionConverterHelper {
|
||||
|
||||
@ExceptionMatch
|
||||
public void convert(DisallowedItemException e) throws CommandException {
|
||||
throw newCommandException(TranslatableComponent.of("worldedit.error.disallowed-block", TextComponent.of(e.getID())), e);
|
||||
throw newCommandException(Caption.of("worldedit.error.disallowed-block", TextComponent.of(e.getID())), e);
|
||||
}
|
||||
|
||||
@ExceptionMatch
|
||||
public void convert(MaxChangedBlocksException e) throws CommandException {
|
||||
throw newCommandException(TranslatableComponent.of("worldedit.error.max-changes", TextComponent.of(e.getBlockLimit())), e);
|
||||
throw newCommandException(Caption.of("worldedit.error.max-changes", TextComponent.of(e.getBlockLimit())), e);
|
||||
}
|
||||
|
||||
@ExceptionMatch
|
||||
public void convert(MaxBrushRadiusException e) throws CommandException {
|
||||
throw newCommandException(
|
||||
TranslatableComponent.of("worldedit.error.max-brush-radius", TextComponent.of(worldEdit.getConfiguration().maxBrushRadius)),
|
||||
Caption.of("worldedit.error.max-brush-radius", TextComponent.of(worldEdit.getConfiguration().maxBrushRadius)),
|
||||
e
|
||||
);
|
||||
}
|
||||
@ -123,7 +124,7 @@ public class WorldEditExceptionConverter extends ExceptionConverterHelper {
|
||||
@ExceptionMatch
|
||||
public void convert(MaxRadiusException e) throws CommandException {
|
||||
throw newCommandException(
|
||||
TranslatableComponent.of("worldedit.error.max-radius", TextComponent.of(worldEdit.getConfiguration().maxRadius)),
|
||||
Caption.of("worldedit.error.max-radius", TextComponent.of(worldEdit.getConfiguration().maxRadius)),
|
||||
e
|
||||
);
|
||||
}
|
||||
@ -150,13 +151,13 @@ public class WorldEditExceptionConverter extends ExceptionConverterHelper {
|
||||
|
||||
@ExceptionMatch
|
||||
public void convert(EmptyClipboardException e) throws CommandException {
|
||||
throw newCommandException(TranslatableComponent.of("worldedit.error.empty-clipboard"), e);
|
||||
throw newCommandException(Caption.of("worldedit.error.empty-clipboard"), e);
|
||||
}
|
||||
|
||||
@ExceptionMatch
|
||||
public void convert(InvalidFilenameException e) throws CommandException {
|
||||
throw newCommandException(
|
||||
TranslatableComponent.of("worldedit.error.invalid-filename", TextComponent.of(e.getFilename()), e.getRichMessage()),
|
||||
Caption.of("worldedit.error.invalid-filename", TextComponent.of(e.getFilename()), e.getRichMessage()),
|
||||
e
|
||||
);
|
||||
}
|
||||
@ -164,7 +165,7 @@ public class WorldEditExceptionConverter extends ExceptionConverterHelper {
|
||||
@ExceptionMatch
|
||||
public void convert(FilenameResolutionException e) throws CommandException {
|
||||
throw newCommandException(
|
||||
TranslatableComponent.of("worldedit.error.file-resolution", TextComponent.of(e.getFilename()), e.getRichMessage()),
|
||||
Caption.of("worldedit.error.file-resolution", TextComponent.of(e.getFilename()), e.getRichMessage()),
|
||||
e
|
||||
);
|
||||
}
|
||||
@ -172,14 +173,14 @@ public class WorldEditExceptionConverter extends ExceptionConverterHelper {
|
||||
@ExceptionMatch
|
||||
public void convert(InvalidToolBindException e) throws CommandException {
|
||||
throw newCommandException(
|
||||
TranslatableComponent.of("worldedit.tool.error.cannot-bind", e.getItemType().getRichName(), e.getRichMessage()),
|
||||
Caption.of("worldedit.tool.error.cannot-bind", e.getItemType().getRichName(), e.getRichMessage()),
|
||||
e
|
||||
);
|
||||
}
|
||||
|
||||
@ExceptionMatch
|
||||
public void convert(FileSelectionAbortedException e) throws CommandException {
|
||||
throw newCommandException(TranslatableComponent.of("worldedit.error.file-aborted"), e);
|
||||
throw newCommandException(Caption.of("worldedit.error.file-aborted"), e);
|
||||
}
|
||||
|
||||
@ExceptionMatch
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.internal.registry;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.NoMatchException;
|
||||
@ -81,7 +82,7 @@ public abstract class AbstractFactory<E> {
|
||||
}
|
||||
}
|
||||
|
||||
throw new NoMatchException(TranslatableComponent.of("worldedit.error.no-match", TextComponent.of(input)));
|
||||
throw new NoMatchException(Caption.of("worldedit.error.no-match", TextComponent.of(input)));
|
||||
}
|
||||
|
||||
public List<String> getSuggestions(String input) {
|
||||
|
@ -2,7 +2,6 @@ package com.sk89q.worldedit.math;
|
||||
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
package com.sk89q.worldedit.math.interpolation;
|
||||
|
||||
import com.sk89q.worldedit.math.MutableBlockVector3;
|
||||
import com.sk89q.worldedit.math.MutableVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
|
||||
|
@ -24,6 +24,7 @@ import com.boydti.fawe.beta.IChunk;
|
||||
import com.boydti.fawe.beta.IChunkGet;
|
||||
import com.boydti.fawe.beta.IChunkSet;
|
||||
import com.boydti.fawe.beta.implementation.filter.block.ChunkFilterBlock;
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
@ -234,7 +235,7 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion {
|
||||
}
|
||||
|
||||
if ((diff.getBlockX() & 1) + (diff.getBlockZ() & 1) != 0) {
|
||||
throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.cylinder.error.even-horizontal"));
|
||||
throw new RegionOperationException(Caption.of("worldedit.selection.cylinder.error.even-horizontal"));
|
||||
}
|
||||
|
||||
return diff.divide(2).floor();
|
||||
|
@ -25,6 +25,7 @@ import com.boydti.fawe.beta.IChunk;
|
||||
import com.boydti.fawe.beta.IChunkGet;
|
||||
import com.boydti.fawe.beta.IChunkSet;
|
||||
import com.boydti.fawe.beta.implementation.filter.block.ChunkFilterBlock;
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.boydti.fawe.util.MathMan;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
@ -126,7 +127,7 @@ public class EllipsoidRegion extends AbstractRegion {
|
||||
BlockVector3 diff = BlockVector3.ZERO.add(changes);
|
||||
|
||||
if ((diff.getBlockX() & 1) + (diff.getBlockY() & 1) + (diff.getBlockZ() & 1) != 0) {
|
||||
throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.ellipsoid.error.even-horizontal"));
|
||||
throw new RegionOperationException(Caption.of("worldedit.selection.ellipsoid.error.even-horizontal"));
|
||||
}
|
||||
|
||||
return diff.divide(2).floor();
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.regions;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
@ -75,17 +76,17 @@ public class NullRegion implements Region {
|
||||
|
||||
@Override
|
||||
public void expand(BlockVector3... changes) throws RegionOperationException {
|
||||
throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.null.error.immutable"));
|
||||
throw new RegionOperationException(Caption.of("worldedit.selection.null.error.immutable"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contract(BlockVector3... changes) throws RegionOperationException {
|
||||
throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.null.error.immutable"));
|
||||
throw new RegionOperationException(Caption.of("worldedit.selection.null.error.immutable"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shift(BlockVector3 change) throws RegionOperationException {
|
||||
throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.null.error.immutable"));
|
||||
throw new RegionOperationException(Caption.of("worldedit.selection.null.error.immutable"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.regions;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.iterator.FlatRegion3DIterator;
|
||||
@ -246,7 +247,7 @@ public class Polygonal2DRegion extends AbstractRegion implements FlatRegion {
|
||||
public void expand(BlockVector3... changes) throws RegionOperationException {
|
||||
for (BlockVector3 change : changes) {
|
||||
if (change.getBlockX() != 0 || change.getBlockZ() != 0) {
|
||||
throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.polygon2d.error.expand-only-vertical"));
|
||||
throw new RegionOperationException(Caption.of("worldedit.selection.polygon2d.error.expand-only-vertical"));
|
||||
}
|
||||
int changeY = change.getBlockY();
|
||||
if (changeY > 0) {
|
||||
@ -262,7 +263,7 @@ public class Polygonal2DRegion extends AbstractRegion implements FlatRegion {
|
||||
public void contract(BlockVector3... changes) throws RegionOperationException {
|
||||
for (BlockVector3 change : changes) {
|
||||
if (change.getBlockX() != 0 || change.getBlockZ() != 0) {
|
||||
throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.polygon2d.error.contract-only-vertical"));
|
||||
throw new RegionOperationException(Caption.of("worldedit.selection.polygon2d.error.contract-only-vertical"));
|
||||
}
|
||||
int changeY = change.getBlockY();
|
||||
if (changeY > 0) {
|
||||
|
@ -22,6 +22,7 @@ package com.sk89q.worldedit.regions;
|
||||
import com.boydti.fawe.beta.IChunk;
|
||||
import com.boydti.fawe.beta.IChunkGet;
|
||||
import com.boydti.fawe.beta.IChunkSet;
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.google.common.collect.Iterators;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
@ -118,13 +119,13 @@ public class RegionIntersection extends AbstractRegion {
|
||||
@Override
|
||||
public void expand(BlockVector3... changes) throws RegionOperationException {
|
||||
checkNotNull(changes);
|
||||
throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.intersection.error.cannot-expand"));
|
||||
throw new RegionOperationException(Caption.of("worldedit.selection.intersection.error.cannot-expand"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contract(BlockVector3... changes) throws RegionOperationException {
|
||||
checkNotNull(changes);
|
||||
throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.intersection.error.cannot-contract"));
|
||||
throw new RegionOperationException(Caption.of("worldedit.selection.intersection.error.cannot-contract"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.regions;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
@ -134,17 +135,17 @@ public class TransformRegion extends AbstractRegion {
|
||||
|
||||
@Override
|
||||
public void expand(BlockVector3... changes) throws RegionOperationException {
|
||||
throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.transform.error.cannot-expand"));
|
||||
throw new RegionOperationException(Caption.of("worldedit.selection.transform.error.cannot-expand"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contract(BlockVector3... changes) throws RegionOperationException {
|
||||
throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.transform.error.cannot-contract"));
|
||||
throw new RegionOperationException(Caption.of("worldedit.selection.transform.error.cannot-contract"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shift(BlockVector3 change) throws RegionOperationException {
|
||||
throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.transform.error.cannot-change"));
|
||||
throw new RegionOperationException(Caption.of("worldedit.selection.transform.error.cannot-change"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.selector;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
@ -192,8 +193,8 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion
|
||||
public List<Component> getSelectionInfoLines() {
|
||||
List<Component> ret = new ArrayList<>();
|
||||
|
||||
ret.add(TranslatableComponent.of("worldedit.selection.convex.info.vertices", TextComponent.of(region.getVertices().size())));
|
||||
ret.add(TranslatableComponent.of("worldedit.selection.convex.info.triangles", TextComponent.of(region.getTriangles().size())));
|
||||
ret.add(Caption.of("worldedit.selection.convex.info.vertices", TextComponent.of(region.getVertices().size())));
|
||||
ret.add(Caption.of("worldedit.selection.convex.info.triangles", TextComponent.of(region.getTriangles().size())));
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -206,7 +207,7 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion
|
||||
|
||||
session.describeCUI(player);
|
||||
|
||||
player.printInfo(TranslatableComponent.of("worldedit.selection.convex.explain.primary", TextComponent.of(pos.toString())));
|
||||
player.print(Caption.of("worldedit.selection.convex.explain.primary", TextComponent.of(pos.toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -217,7 +218,7 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion
|
||||
|
||||
session.describeCUI(player);
|
||||
|
||||
player.printInfo(TranslatableComponent.of("worldedit.selection.convex.explain.secondary", TextComponent.of(pos.toString())));
|
||||
player.print(Caption.of("worldedit.selection.convex.explain.secondary", TextComponent.of(pos.toString())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.selector;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
@ -159,13 +160,13 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion {
|
||||
checkNotNull(pos);
|
||||
|
||||
if (position1 != null && position2 != null) {
|
||||
player.printInfo(TranslatableComponent.of(
|
||||
player.print(Caption.of(
|
||||
"worldedit.selection.cuboid.explain.primary-area",
|
||||
TextComponent.of(position1.toString()),
|
||||
TextComponent.of(region.getVolume())
|
||||
));
|
||||
} else if (position1 != null) {
|
||||
player.printInfo(TranslatableComponent.of("worldedit.selection.cuboid.explain.primary", TextComponent.of(position1.toString())));
|
||||
player.print(Caption.of("worldedit.selection.cuboid.explain.primary", TextComponent.of(position1.toString())));
|
||||
}
|
||||
|
||||
session.dispatchCUIEvent(player, new SelectionPointEvent(0, pos, getVolume()));
|
||||
@ -178,13 +179,13 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion {
|
||||
checkNotNull(pos);
|
||||
|
||||
if (position1 != null && position2 != null) {
|
||||
player.printInfo(TranslatableComponent.of(
|
||||
player.print(Caption.of(
|
||||
"worldedit.selection.cuboid.explain.secondary-area",
|
||||
TextComponent.of(position2.toString()),
|
||||
TextComponent.of(region.getVolume())
|
||||
));
|
||||
} else if (position2 != null) {
|
||||
player.printInfo(TranslatableComponent.of("worldedit.selection.cuboid.explain.secondary", TextComponent.of(position2.toString())));
|
||||
player.print(Caption.of("worldedit.selection.cuboid.explain.secondary", TextComponent.of(position2.toString())));
|
||||
}
|
||||
|
||||
session.dispatchCUIEvent(player, new SelectionPointEvent(1, pos, getVolume()));
|
||||
@ -258,13 +259,13 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion {
|
||||
final List<Component> lines = new ArrayList<>();
|
||||
|
||||
if (position1 != null) {
|
||||
lines.add(TranslatableComponent.of("worldedit.selection.cuboid.info.pos1", TextComponent.of(position1.toString())
|
||||
lines.add(Caption.of("worldedit.selection.cuboid.info.pos1", TextComponent.of(position1.toString())
|
||||
.clickEvent(ClickEvent.of(ClickEvent.Action.COPY_TO_CLIPBOARD, position1.toParserString()))
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to copy")))));
|
||||
}
|
||||
|
||||
if (position2 != null) {
|
||||
lines.add(TranslatableComponent.of("worldedit.selection.cuboid.info.pos2", TextComponent.of(position2.toString())
|
||||
lines.add(Caption.of("worldedit.selection.cuboid.info.pos2", TextComponent.of(position2.toString())
|
||||
.clickEvent(ClickEvent.of(ClickEvent.Action.COPY_TO_CLIPBOARD, position2.toParserString()))
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to copy")))));
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.selector;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
@ -175,7 +176,7 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion {
|
||||
|
||||
@Override
|
||||
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||
player.printInfo(TranslatableComponent.of("worldedit.selection.cylinder.explain.primary", TextComponent.of(pos.toString())));
|
||||
player.print(Caption.of("worldedit.selection.cylinder.explain.primary", TextComponent.of(pos.toString())));
|
||||
|
||||
session.describeCUI(player);
|
||||
}
|
||||
@ -185,14 +186,14 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion {
|
||||
Vector3 center = region.getCenter();
|
||||
|
||||
if (!center.equals(Vector3.ZERO)) {
|
||||
player.printInfo(TranslatableComponent.of(
|
||||
player.print(Caption.of(
|
||||
"worldedit.selection.cylinder.explain.secondary",
|
||||
TextComponent.of(NUMBER_FORMAT.format(region.getRadius().getX())),
|
||||
TextComponent.of(NUMBER_FORMAT.format(region.getRadius().getZ())),
|
||||
TextComponent.of(region.getVolume())
|
||||
));
|
||||
} else {
|
||||
player.printError(TranslatableComponent.of("worldedit.selection.cylinder.explain.secondary-missing"));
|
||||
player.print(Caption.of("worldedit.selection.cylinder.explain.secondary-missing"));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -252,12 +253,12 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion {
|
||||
|
||||
if (!region.getCenter().equals(Vector3.ZERO)) {
|
||||
Vector3 center = region.getCenter();
|
||||
lines.add(TranslatableComponent.of("worldedit.selection.cylinder.info.center", TextComponent.of(center.toString())
|
||||
lines.add(Caption.of("worldedit.selection.cylinder.info.center", TextComponent.of(center.toString())
|
||||
.clickEvent(ClickEvent.of(ClickEvent.Action.COPY_TO_CLIPBOARD, center.toParserString()))
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to copy")))));
|
||||
}
|
||||
if (!region.getRadius().equals(Vector2.ZERO)) {
|
||||
lines.add(TranslatableComponent.of("worldedit.selection.cylinder.info.radius", TextComponent.of(region.getRadius().toString())));
|
||||
lines.add(Caption.of("worldedit.selection.cylinder.info.radius", TextComponent.of(region.getRadius().toString())));
|
||||
}
|
||||
|
||||
return lines;
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.selector;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
@ -151,13 +152,13 @@ public class EllipsoidRegionSelector implements RegionSelector, CUIRegion {
|
||||
@Override
|
||||
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||
if (isDefined()) {
|
||||
player.printInfo(TranslatableComponent.of(
|
||||
player.print(Caption.of(
|
||||
"worldedit.selection.ellipsoid.explain.primary-area",
|
||||
TextComponent.of(region.getCenter().toString()),
|
||||
TextComponent.of(region.getVolume())
|
||||
));
|
||||
} else {
|
||||
player.printInfo(TranslatableComponent.of(
|
||||
player.print(Caption.of(
|
||||
"worldedit.selection.ellipsoid.explain.primary",
|
||||
TextComponent.of(region.getCenter().toString())
|
||||
));
|
||||
@ -169,13 +170,13 @@ public class EllipsoidRegionSelector implements RegionSelector, CUIRegion {
|
||||
@Override
|
||||
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||
if (isDefined()) {
|
||||
player.printInfo(TranslatableComponent.of(
|
||||
player.print(Caption.of(
|
||||
"worldedit.selection.ellipsoid.explain.secondary-area",
|
||||
TextComponent.of(region.getRadius().toString()),
|
||||
TextComponent.of(region.getVolume())
|
||||
));
|
||||
} else {
|
||||
player.printInfo(TranslatableComponent.of(
|
||||
player.print(Caption.of(
|
||||
"worldedit.selection.ellipsoid.explain.secondary",
|
||||
TextComponent.of(region.getRadius().toString())
|
||||
));
|
||||
@ -229,14 +230,14 @@ public class EllipsoidRegionSelector implements RegionSelector, CUIRegion {
|
||||
|
||||
final Vector3 center = region.getCenter();
|
||||
if (center.lengthSq() > 0) {
|
||||
lines.add(TranslatableComponent.of("worldedit.selection.ellipsoid.info.center", TextComponent.of(center.toString())
|
||||
lines.add(Caption.of("worldedit.selection.ellipsoid.info.center", TextComponent.of(center.toString())
|
||||
.clickEvent(ClickEvent.of(ClickEvent.Action.COPY_TO_CLIPBOARD, center.toParserString()))
|
||||
.hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to copy")))));
|
||||
}
|
||||
|
||||
final Vector3 radius = region.getRadius();
|
||||
if (radius.lengthSq() > 0) {
|
||||
lines.add(TranslatableComponent.of("worldedit.selection.ellipsoid.info.radius", TextComponent.of(radius.toString())));
|
||||
lines.add(Caption.of("worldedit.selection.ellipsoid.info.radius", TextComponent.of(radius.toString())));
|
||||
}
|
||||
|
||||
return lines;
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.selector;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
@ -131,7 +132,7 @@ public class ExtendingCuboidRegionSelector extends CuboidRegionSelector {
|
||||
|
||||
@Override
|
||||
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||
player.printInfo(TranslatableComponent.of(
|
||||
player.print(Caption.of(
|
||||
"worldedit.selection.extend.explain.primary",
|
||||
TextComponent.of(pos.toString()),
|
||||
TextComponent.of(region.getVolume())
|
||||
@ -142,7 +143,7 @@ public class ExtendingCuboidRegionSelector extends CuboidRegionSelector {
|
||||
|
||||
@Override
|
||||
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||
player.printInfo(TranslatableComponent.of(
|
||||
player.print(Caption.of(
|
||||
"worldedit.selection.extend.explain.secondary",
|
||||
TextComponent.of(pos.toString()),
|
||||
TextComponent.of(region.getVolume())
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.selector;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
@ -170,7 +171,7 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion {
|
||||
|
||||
@Override
|
||||
public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||
player.printInfo(TranslatableComponent.of("worldedit.selection.polygon2d.explain.primary", TextComponent.of(pos.toString())));
|
||||
player.print(Caption.of("worldedit.selection.polygon2d.explain.primary", TextComponent.of(pos.toString())));
|
||||
|
||||
session.dispatchCUIEvent(player, new SelectionShapeEvent(getTypeID()));
|
||||
session.dispatchCUIEvent(player, new SelectionPoint2DEvent(0, pos, getVolume()));
|
||||
@ -179,7 +180,7 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion {
|
||||
|
||||
@Override
|
||||
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||
player.printInfo(TranslatableComponent.of(
|
||||
player.print(Caption.of(
|
||||
"worldedit.selection.polygon2d.explain.secondary",
|
||||
TextComponent.of(region.size()),
|
||||
TextComponent.of(pos.toString())
|
||||
@ -242,7 +243,7 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion {
|
||||
|
||||
@Override
|
||||
public List<Component> getSelectionInfoLines() {
|
||||
return Collections.singletonList(TranslatableComponent.of("worldedit.selection.polygon2d.info", TextComponent.of(region.size())));
|
||||
return Collections.singletonList(Caption.of("worldedit.selection.polygon2d.info", TextComponent.of(region.size())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.regions.selector;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
@ -90,13 +91,13 @@ public class SphereRegionSelector extends EllipsoidRegionSelector {
|
||||
@Override
|
||||
public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) {
|
||||
if (isDefined()) {
|
||||
player.printInfo(TranslatableComponent.of(
|
||||
player.print(Caption.of(
|
||||
"worldedit.selection.sphere.explain.secondary-defined",
|
||||
TextComponent.of(region.getRadius().getX()),
|
||||
TextComponent.of(region.getVolume())
|
||||
));
|
||||
} else {
|
||||
player.printInfo(TranslatableComponent.of("worldedit.selection.sphere.explain.secondary", TextComponent.of(region.getRadius().getX())));
|
||||
player.print(Caption.of("worldedit.selection.sphere.explain.secondary", TextComponent.of(region.getRadius().getX())));
|
||||
}
|
||||
|
||||
session.describeCUI(player);
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package com.sk89q.worldedit.scripting;
|
||||
|
||||
import com.boydti.fawe.config.Caption;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
@ -149,7 +150,7 @@ public class CraftScriptContext extends CraftScriptEnvironment {
|
||||
public void checkArgs(int min, int max, String usage)
|
||||
throws InsufficientArgumentsException {
|
||||
if (args.length <= min || (max != -1 && args.length - 1 > max)) {
|
||||
throw new InsufficientArgumentsException(TranslatableComponent.of("worldedit.error.incorrect-usage", TextComponent.of(usage)));
|
||||
throw new InsufficientArgumentsException(Caption.of("worldedit.error.incorrect-usage", TextComponent.of(usage)));
|
||||
}
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user