3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-10-01 19:30:06 +02:00

Finalize Captions

Follow up to a9d1202ce1
Dieser Commit ist enthalten in:
NotMyFault 2021-04-05 19:54:49 +02:00
Ursprung a9d1202ce1
Commit 5e534ff9e2
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 158F5701A6AAD00C
135 geänderte Dateien mit 671 neuen und 622 gelöschten Zeilen

Datei anzeigen

@ -2,7 +2,6 @@ package com.boydti.fawe.bukkit.adapter;
import com.boydti.fawe.FAWEPlatformAdapterImpl; import com.boydti.fawe.FAWEPlatformAdapterImpl;
import com.boydti.fawe.beta.IChunkGet; import com.boydti.fawe.beta.IChunkGet;
import com.boydti.fawe.beta.implementation.chunk.ChunkHolder;
import com.boydti.fawe.config.Settings; import com.boydti.fawe.config.Settings;
import com.sk89q.worldedit.bukkit.WorldEditPlugin; import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;

Datei anzeigen

@ -1,6 +1,5 @@
package com.boydti.fawe.bukkit.filter; package com.boydti.fawe.bukkit.filter;
import com.boydti.fawe.object.RunnableVal;
import com.boydti.fawe.regions.general.CuboidRegionFilter; import com.boydti.fawe.regions.general.CuboidRegionFilter;
import com.boydti.fawe.util.TaskManager; import com.boydti.fawe.util.TaskManager;
import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector2;

Datei anzeigen

@ -3,7 +3,6 @@ package com.boydti.fawe.bukkit.preloader;
import com.boydti.fawe.Fawe; import com.boydti.fawe.Fawe;
import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.Region;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.World; import org.bukkit.World;
@ -19,7 +18,6 @@ import org.jetbrains.annotations.Nullable;
import java.io.File; import java.io.File;
import java.io.InputStream; import java.io.InputStream;
import java.lang.ref.PhantomReference;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;

Datei anzeigen

@ -1,7 +1,6 @@
package com.boydti.fawe.bukkit.regions; package com.boydti.fawe.bukkit.regions;
import com.boydti.fawe.regions.FaweMaskManager; import com.boydti.fawe.regions.FaweMaskManager;
import org.bukkit.entity.Player;
import org.bukkit.permissions.Permissible; import org.bukkit.permissions.Permissible;
public abstract class BukkitMaskManager extends FaweMaskManager { public abstract class BukkitMaskManager extends FaweMaskManager {

Datei anzeigen

@ -7,7 +7,6 @@ import com.sk89q.jnbt.CompoundTag;
import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.BaseItemStack;
import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemType;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import javax.annotation.Nullable; import javax.annotation.Nullable;

Datei anzeigen

@ -21,8 +21,6 @@ package com.sk89q.worldedit.bukkit;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.math.BlockVector3;
import org.bukkit.BlockChangeDelegate; import org.bukkit.BlockChangeDelegate;
import org.bukkit.block.data.BlockData; import org.bukkit.block.data.BlockData;

Datei anzeigen

@ -82,7 +82,6 @@ import java.nio.file.Paths;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Optional; import java.util.Optional;
import java.util.logging.Level;
import static com.boydti.fawe.bukkit.util.JavaVersionCheck.checkJvm; import static com.boydti.fawe.bukkit.util.JavaVersionCheck.checkJvm;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;

Datei anzeigen

@ -19,8 +19,8 @@
package com.sk89q.worldedit.bukkit; package com.sk89q.worldedit.bukkit;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
/** /**
* Thrown if the world has been unloaded. * Thrown if the world has been unloaded.
@ -31,6 +31,6 @@ class WorldUnloadedException extends WorldEditException {
* Create a new instance. * Create a new instance.
*/ */
WorldUnloadedException() { WorldUnloadedException() {
super(TranslatableComponent.of("worldedit.error.world-unloaded")); super(Caption.of("worldedit.error.world-unloaded"));
} }
} }

Datei anzeigen

@ -12,7 +12,6 @@ import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.registry.state.Property;
import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.Direction;
import com.sk89q.worldedit.util.SideEffectSet;
import com.sk89q.worldedit.world.DataFixer; import com.sk89q.worldedit.world.DataFixer;
import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BaseBlock;

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.cli; package com.sk89q.worldedit.cli;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.cli.data.FileRegistries; import com.sk89q.worldedit.cli.data.FileRegistries;
import com.sk89q.worldedit.cli.schematic.ClipboardWorld; import com.sk89q.worldedit.cli.schematic.ClipboardWorld;
@ -33,7 +34,6 @@ import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader; import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
import com.sk89q.worldedit.internal.util.LogManagerCompat; import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.registry.state.Property;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockCategory; import com.sk89q.worldedit.world.block.BlockCategory;
import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockState;
@ -238,13 +238,13 @@ public class CLIWorldEdit {
while (scanner.hasNextLine()) { while (scanner.hasNextLine()) {
String line = scanner.nextLine(); String line = scanner.nextLine();
if (line.equals("stop")) { if (line.equals("stop")) {
commandSender.printInfo(TranslatableComponent.of("worldedit.cli.stopping")); commandSender.print(Caption.of("worldedit.cli.stopping"));
break; break;
} }
CommandEvent event = new CommandEvent(commandSender, line); CommandEvent event = new CommandEvent(commandSender, line);
WorldEdit.getInstance().getEventBus().post(event); WorldEdit.getInstance().getEventBus().post(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
commandSender.printError(TranslatableComponent.of("worldedit.cli.unknown-command")); commandSender.print(Caption.of("worldedit.cli.unknown-command"));
} else { } else {
saveAllWorlds(false); saveAllWorlds(false);
} }

Datei anzeigen

@ -4,6 +4,7 @@ import com.boydti.fawe.beta.IChunkSet;
import com.boydti.fawe.beta.Trimable; import com.boydti.fawe.beta.Trimable;
import com.boydti.fawe.beta.implementation.queue.Pool; import com.boydti.fawe.beta.implementation.queue.Pool;
import com.boydti.fawe.beta.implementation.queue.QueuePool; import com.boydti.fawe.beta.implementation.queue.QueuePool;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.config.Settings; import com.boydti.fawe.config.Settings;
import com.boydti.fawe.object.collection.BitArray; import com.boydti.fawe.object.collection.BitArray;
import com.boydti.fawe.object.collection.BitArrayUnstretched; import com.boydti.fawe.object.collection.BitArrayUnstretched;
@ -143,15 +144,15 @@ public enum FaweCache implements Trimable {
*/ */
public static final FaweChunkLoadException CHUNK = new FaweChunkLoadException(); public static final FaweChunkLoadException CHUNK = new FaweChunkLoadException();
public static final FaweBlockBagException BLOCK_BAG = new FaweBlockBagException(); public static final FaweBlockBagException BLOCK_BAG = new FaweBlockBagException();
public static final FaweException MANUAL = new FaweException(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.manual")); public static final FaweException MANUAL = new FaweException(Caption.of("fawe.cancel.worldedit.cancel.reason.manual"));
public static final FaweException NO_REGION = new FaweException(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.no.region")); public static final FaweException NO_REGION = new FaweException(Caption.of("fawe.cancel.worldedit.cancel.reason.no.region"));
public static final FaweException OUTSIDE_REGION = new FaweException(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.outside.region")); public static final FaweException OUTSIDE_REGION = new FaweException(Caption.of("fawe.cancel.worldedit.cancel.reason.outside.region"));
public static final FaweException MAX_CHECKS = new FaweException(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.max.checks")); public static final FaweException MAX_CHECKS = new FaweException(Caption.of("fawe.cancel.worldedit.cancel.reason.max.checks"));
public static final FaweException MAX_CHANGES = new FaweException(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.max.changes")); public static final FaweException MAX_CHANGES = new FaweException(Caption.of("fawe.cancel.worldedit.cancel.reason.max.changes"));
public static final FaweException LOW_MEMORY = new FaweException(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.low.memory")); public static final FaweException LOW_MEMORY = new FaweException(Caption.of("fawe.cancel.worldedit.cancel.reason.low.memory"));
public static final FaweException MAX_ENTITIES = new FaweException(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.max.entities")); public static final FaweException MAX_ENTITIES = new FaweException(Caption.of("fawe.cancel.worldedit.cancel.reason.max.entities"));
public static final FaweException MAX_TILES = new FaweException(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.max.tiles")); public static final FaweException MAX_TILES = new FaweException(Caption.of("fawe.cancel.worldedit.cancel.reason.max.tiles"));
public static final FaweException MAX_ITERATIONS = new FaweException(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.max.iterations")); public static final FaweException MAX_ITERATIONS = new FaweException(Caption.of("fawe.cancel.worldedit.cancel.reason.max.iterations"));
/* /*
thread cache thread cache

Datei anzeigen

@ -69,7 +69,7 @@ public class CatenaryBrush implements Brush, ResettableTool {
e.printStackTrace(); e.printStackTrace();
} }
if (!visual) { if (!visual) {
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.line.secondary")); player.print(Caption.of("fawe.worldedit.brush.brush.line.secondary"));
if (!select) { if (!select) {
pos1 = null; pos1 = null;
return; return;

Datei anzeigen

@ -45,7 +45,7 @@ public class CopyPastaBrush implements Brush, ResettableTool {
@Override @Override
public boolean reset() { public boolean reset() {
session.setClipboard(null); session.setClipboard(null);
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.reset")); player.print(Caption.of("fawe.worldedit.brush.brush.reset"));
return true; return true;
} }

Datei anzeigen

@ -1,5 +1,6 @@
package com.boydti.fawe.object.brush; package com.boydti.fawe.object.brush;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.brush.heightmap.HeightMap; import com.boydti.fawe.object.brush.heightmap.HeightMap;
import com.boydti.fawe.object.brush.heightmap.RotatableHeightMap; import com.boydti.fawe.object.brush.heightmap.RotatableHeightMap;
import com.boydti.fawe.object.brush.heightmap.ScalableHeightMap; import com.boydti.fawe.object.brush.heightmap.ScalableHeightMap;
@ -44,7 +45,7 @@ public class HeightBrush implements Brush {
try { try {
heightMap = ScalableHeightMap.fromPNG(stream); heightMap = ScalableHeightMap.fromPNG(stream);
} catch (IOException e) { } catch (IOException e) {
throw new FaweException(TranslatableComponent.of("fawe.worldedit.brush.brush.height.invalid")); throw new FaweException(Caption.of("fawe.worldedit.brush.brush.height.invalid"));
} }
} else if (clipboard != null) { } else if (clipboard != null) {
heightMap = ScalableHeightMap.fromClipboard(clipboard); heightMap = ScalableHeightMap.fromClipboard(clipboard);

Datei anzeigen

@ -34,7 +34,7 @@ public class LineBrush implements Brush, ResettableTool {
} }
editSession.drawLine(pattern, pos1, position, size, !shell, flat); editSession.drawLine(pattern, pos1, position, size, !shell, flat);
if (!visual) { if (!visual) {
editSession.getPlayer().print(TranslatableComponent.of("fawe.worldedit.brush.brush.line.secondary")); editSession.getPlayer().print(Caption.of("fawe.worldedit.brush.brush.line.secondary"));
if (!select) { if (!select) {
pos1 = null; pos1 = null;
} else { } else {

Datei anzeigen

@ -1,6 +1,7 @@
package com.boydti.fawe.object.brush; package com.boydti.fawe.object.brush;
import com.boydti.fawe.FaweCache; import com.boydti.fawe.FaweCache;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.brush.visualization.VisualExtent; import com.boydti.fawe.object.brush.visualization.VisualExtent;
import com.boydti.fawe.object.mask.IdMask; import com.boydti.fawe.object.mask.IdMask;
import com.boydti.fawe.object.visitor.DFSRecursiveVisitor; import com.boydti.fawe.object.visitor.DFSRecursiveVisitor;
@ -16,7 +17,6 @@ import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.MutableVector3; import com.sk89q.worldedit.math.MutableVector3;
import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.math.interpolation.Node; import com.sk89q.worldedit.math.interpolation.Node;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
@ -93,13 +93,13 @@ public class SplineBrush implements Brush, ResettableTool {
points.add(position); points.add(position);
} }
this.positionSets.add(points); this.positionSets.add(points);
player.print(TranslatableComponent.of("fawe.worldedit.brush.spline.primary.2")); player.print(Caption.of("fawe.worldedit.brush.spline.primary.2"));
if (!visualization) { if (!visualization) {
return; return;
} }
} }
if (positionSets.size() < 2) { if (positionSets.size() < 2) {
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.spline.secondary.error")); player.print(Caption.of("fawe.worldedit.brush.brush.spline.secondary.error"));
return; return;
} }
List<Vector3> centroids = new ArrayList<>(); List<Vector3> centroids = new ArrayList<>();
@ -131,7 +131,7 @@ public class SplineBrush implements Brush, ResettableTool {
} }
editSession.drawSpline(pattern, currentSpline, 0, 0, 0, 10, 0, true); editSession.drawSpline(pattern, currentSpline, 0, 0, 0, 10, 0, true);
} }
player.print(TranslatableComponent.of("fawe.worldedit.brush.spline.secondary")); player.print(Caption.of("fawe.worldedit.brush.spline.secondary"));
if (visualization) { if (visualization) {
numSplines = originalSize; numSplines = originalSize;
positionSets.remove(positionSets.size() - 1); positionSets.remove(positionSets.size() - 1);

Datei anzeigen

@ -1,5 +1,6 @@
package com.boydti.fawe.object.brush; package com.boydti.fawe.object.brush;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.brush.visualization.VisualExtent; import com.boydti.fawe.object.brush.visualization.VisualExtent;
import com.boydti.fawe.object.collection.LocalBlockVectorSet; import com.boydti.fawe.object.collection.LocalBlockVectorSet;
import com.boydti.fawe.util.MathMan; import com.boydti.fawe.util.MathMan;
@ -43,7 +44,7 @@ public class SurfaceSpline implements Brush {
return; return;
} }
path.add(BlockVector3.at(pos.getBlockX(), max, pos.getBlockZ())); path.add(BlockVector3.at(pos.getBlockX(), max, pos.getBlockZ()));
editSession.getPlayer().printInfo(TranslatableComponent.of("fawe.worldedit.brush.spline.primary.2")); editSession.getPlayer().print(Caption.of("fawe.worldedit.brush.spline.primary.2"));
if (!vis) { if (!vis) {
return; return;
} }
@ -107,6 +108,6 @@ public class SurfaceSpline implements Brush {
path.clear(); path.clear();
} }
} }
editSession.getPlayer().printInfo(TranslatableComponent.of("fawe.worldedit.brush.spline.secondary")); editSession.getPlayer().print(Caption.of("fawe.worldedit.brush.spline.secondary"));
} }
} }

Datei anzeigen

@ -1,5 +1,6 @@
package com.boydti.fawe.object.brush.sweep; package com.boydti.fawe.object.brush.sweep;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.brush.ResettableTool; import com.boydti.fawe.object.brush.ResettableTool;
import com.boydti.fawe.object.brush.visualization.VisualExtent; import com.boydti.fawe.object.brush.visualization.VisualExtent;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
@ -18,7 +19,6 @@ import com.sk89q.worldedit.math.interpolation.Node;
import com.sk89q.worldedit.math.interpolation.ReparametrisingInterpolation; import com.sk89q.worldedit.math.interpolation.ReparametrisingInterpolation;
import com.sk89q.worldedit.math.transform.AffineTransform; import com.sk89q.worldedit.math.transform.AffineTransform;
import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.session.ClipboardHolder;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -53,13 +53,13 @@ public class SweepBrush implements Brush, ResettableTool {
return; return;
} }
if (newPos) { if (newPos) {
player.print(TranslatableComponent.of("fawe.worldedit.brush.spline.primary.2")); player.print(Caption.of("fawe.worldedit.brush.spline.primary.2"));
positions.add(position); positions.add(position);
return; return;
} }
if (positions.size() < 2) { if (positions.size() < 2) {
player.printError(TranslatableComponent.of("fawe.worldedit.brush.brush.spline.secondary.error")); player.print(Caption.of("fawe.worldedit.brush.brush.spline.secondary.error"));
return; return;
} }
@ -111,7 +111,7 @@ public class SweepBrush implements Brush, ResettableTool {
break; break;
} }
} }
player.print(TranslatableComponent.of("fawe.worldedit.brush.spline.secondary")); player.print(Caption.of("fawe.worldedit.brush.spline.secondary"));
reset(); reset();
} }

Datei anzeigen

@ -1,9 +1,9 @@
package com.boydti.fawe.object.exception; package com.boydti.fawe.object.exception;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Caption;
public class FaweBlockBagException extends FaweException { public class FaweBlockBagException extends FaweException {
public FaweBlockBagException() { public FaweBlockBagException() {
super(TranslatableComponent.of("fawe.error.worldedit.some.fails.blockbag")); super(Caption.of("fawe.error.worldedit.some.fails.blockbag"));
} }
} }

Datei anzeigen

@ -1,9 +1,9 @@
package com.boydti.fawe.object.exception; package com.boydti.fawe.object.exception;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Caption;
public class FaweChunkLoadException extends FaweException { public class FaweChunkLoadException extends FaweException {
public FaweChunkLoadException() { public FaweChunkLoadException() {
super(TranslatableComponent.of("fawe.cancel.worldedit.failed.load.chunk")); super(Caption.of("fawe.cancel.worldedit.failed.load.chunk"));
} }
} }

Datei anzeigen

@ -1,13 +1,13 @@
package com.boydti.fawe.object.extent; package com.boydti.fawe.object.extent;
import com.boydti.fawe.FaweCache; import com.boydti.fawe.FaweCache;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.util.MemUtil; import com.boydti.fawe.util.MemUtil;
import com.boydti.fawe.util.Permission; import com.boydti.fawe.util.Permission;
import com.boydti.fawe.util.WEManager; import com.boydti.fawe.util.WEManager;
import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.extent.PassthroughExtent; import com.sk89q.worldedit.extent.PassthroughExtent;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
public class MemoryCheckingExtent extends PassthroughExtent { public class MemoryCheckingExtent extends PassthroughExtent {
@ -22,10 +22,10 @@ public class MemoryCheckingExtent extends PassthroughExtent {
public Extent getExtent() { public Extent getExtent() {
if (MemUtil.isMemoryLimited()) { if (MemUtil.isMemoryLimited()) {
if (this.player != null) { if (this.player != null) {
player.print(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason", player.print(Caption.of("fawe.cancel.worldedit.cancel.reason",
TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.low.memory"))); Caption.of("fawe.cancel.worldedit.cancel.reason.low.memory")));
if (Permission.hasPermission(this.player, "worldedit.fast")) { if (Permission.hasPermission(this.player, "worldedit.fast")) {
this.player.print(TranslatableComponent.of("fawe.info.worldedit.oom.admin")); this.player.print(Caption.of("fawe.info.worldedit.oom.admin"));
} }
} }
WEManager.IMP.cancelEdit(this, FaweCache.LOW_MEMORY); WEManager.IMP.cancelEdit(this, FaweCache.LOW_MEMORY);

Datei anzeigen

@ -7,7 +7,6 @@ import com.boydti.fawe.util.TaskManager;
import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import java.util.function.BiConsumer; import java.util.function.BiConsumer;
@ -104,7 +103,7 @@ public class DefaultProgressTracker implements BiConsumer<DefaultProgressTracker
} }
public void doneTask() { public void doneTask() {
sendTile(TextComponent.empty(), TranslatableComponent.of("fawe.progress.progress.finished")); sendTile(TextComponent.empty(), Caption.of("fawe.progress.progress.finished"));
} }
public void sendTask() { public void sendTask() {

Datei anzeigen

@ -1,5 +1,6 @@
package com.boydti.fawe.object.regions; package com.boydti.fawe.object.regions;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.collection.BlockVectorSet; import com.boydti.fawe.object.collection.BlockVectorSet;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.Extent;
@ -9,7 +10,6 @@ import com.sk89q.worldedit.function.visitor.RecursiveVisitor;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.AbstractRegion; import com.sk89q.worldedit.regions.AbstractRegion;
import com.sk89q.worldedit.regions.RegionOperationException; import com.sk89q.worldedit.regions.RegionOperationException;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -106,12 +106,12 @@ public class FuzzyRegion extends AbstractRegion {
@Override @Override
public void expand(BlockVector3... changes) throws RegionOperationException { public void expand(BlockVector3... changes) throws RegionOperationException {
throw new RegionOperationException(TranslatableComponent.of("fawe.error.selection-expand")); throw new RegionOperationException(Caption.of("fawe.error.selection-expand"));
} }
@Override @Override
public void contract(BlockVector3... changes) throws RegionOperationException { public void contract(BlockVector3... changes) throws RegionOperationException {
throw new RegionOperationException(TranslatableComponent.of("fawe.error.selection-contract")); throw new RegionOperationException(Caption.of("fawe.error.selection-contract"));
} }
@Override @Override
@ -121,7 +121,7 @@ public class FuzzyRegion extends AbstractRegion {
@Override @Override
public void shift(BlockVector3 change) throws RegionOperationException { public void shift(BlockVector3 change) throws RegionOperationException {
throw new RegionOperationException(TranslatableComponent.of("fawe.error.selection-shift")); throw new RegionOperationException(Caption.of("fawe.error.selection-shift"));
} }
public void setExtent(EditSession extent) { public void setExtent(EditSession extent) {

Datei anzeigen

@ -1,5 +1,6 @@
package com.boydti.fawe.object.visitor; package com.boydti.fawe.object.visitor;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.IntTriple; import com.boydti.fawe.object.IntTriple;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.WorldEditException;
@ -9,8 +10,6 @@ import com.sk89q.worldedit.function.operation.RunContext;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TextComponent; 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 java.util.ArrayDeque; import java.util.ArrayDeque;
import java.util.ArrayList; import java.util.ArrayList;
@ -144,10 +143,10 @@ public abstract class DFSVisitor implements Operation {
} }
public Iterable<Component> getStatusMessages() { public Iterable<Component> getStatusMessages() {
return Lists.newArrayList(TranslatableComponent.of( return Lists.newArrayList(Caption.of(
"fawe.worldedit.visitor.visitor.block", "fawe.worldedit.visitor.visitor.block",
TextComponent.of(getAffected()) TextComponent.of(getAffected())
).color(TextColor.GRAY)); ));
} }
public int getAffected() { public int getAffected() {

Datei anzeigen

@ -10,6 +10,7 @@ import com.boydti.fawe.beta.implementation.lighting.RelightProcessor;
import com.boydti.fawe.beta.implementation.lighting.Relighter; import com.boydti.fawe.beta.implementation.lighting.Relighter;
import com.boydti.fawe.beta.implementation.processors.LimitExtent; import com.boydti.fawe.beta.implementation.processors.LimitExtent;
import com.boydti.fawe.beta.implementation.queue.ParallelQueueExtent; import com.boydti.fawe.beta.implementation.queue.ParallelQueueExtent;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.config.Settings; import com.boydti.fawe.config.Settings;
import com.boydti.fawe.logging.rollback.RollbackOptimizedHistory; import com.boydti.fawe.logging.rollback.RollbackOptimizedHistory;
import com.boydti.fawe.object.FaweLimit; import com.boydti.fawe.object.FaweLimit;
@ -40,6 +41,7 @@ import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.Identifiable; import com.sk89q.worldedit.util.Identifiable;
import com.sk89q.worldedit.util.eventbus.EventBus; 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.TranslatableComponent;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -240,11 +242,11 @@ public class EditSessionBuilder {
} }
if (Settings.IMP.EXTENT.DEBUG) { if (Settings.IMP.EXTENT.DEBUG) {
if (event.getActor() != null) { if (event.getActor() != null) {
event.getActor().printDebug(TranslatableComponent.of("Potentially unsafe extent blocked: " + toReturn.getClass().getName())); event.getActor().printDebug(TextComponent.of("Potentially unsafe extent blocked: " + toReturn.getClass().getName()));
event.getActor().printDebug(TranslatableComponent.of(" - For area restrictions, it is recommended to use the FaweAPI")); event.getActor().printDebug(TextComponent.of(" - For area restrictions, it is recommended to use the FaweAPI"));
event.getActor().printDebug(TranslatableComponent.of(" - For block logging, it is recommended to use BlocksHub")); event.getActor().printDebug(TextComponent.of(" - For block logging, it is recommended to use BlocksHub"));
event.getActor().printDebug(TranslatableComponent.of(" - To allow this plugin add it to the FAWE `allowed-plugins` list")); event.getActor().printDebug(TextComponent.of(" - To allow this plugin add it to the FAWE `allowed-plugins` list"));
event.getActor().printDebug(TranslatableComponent.of(" - To hide this message set `debug` to false in the FAWE config.yml")); event.getActor().printDebug(TextComponent.of(" - To hide this message set `debug` to false in the FAWE config.yml"));
} else { } else {
LOGGER.debug("Potentially unsafe extent blocked: " + toReturn.getClass().getName()); LOGGER.debug("Potentially unsafe extent blocked: " + toReturn.getClass().getName());
LOGGER.debug(" - For area restrictions, it is recommended to use the FaweAPI"); LOGGER.debug(" - For area restrictions, it is recommended to use the FaweAPI");
@ -300,7 +302,7 @@ public class EditSessionBuilder {
if (checkMemory) { if (checkMemory) {
if (MemUtil.isMemoryLimitedSlow()) { if (MemUtil.isMemoryLimitedSlow()) {
if (Permission.hasPermission(player, "worldedit.fast")) { if (Permission.hasPermission(player, "worldedit.fast")) {
player.print(TranslatableComponent.of("fawe.info.worldedit.oom.admin")); player.print(Caption.of("fawe.info.worldedit.oom.admin"));
} }
throw FaweCache.LOW_MEMORY; throw FaweCache.LOW_MEMORY;
} }

Datei anzeigen

@ -1,6 +1,7 @@
package com.boydti.fawe.util; package com.boydti.fawe.util;
import com.boydti.fawe.Fawe; import com.boydti.fawe.Fawe;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.config.Settings; import com.boydti.fawe.config.Settings;
import com.boydti.fawe.object.FaweInputStream; import com.boydti.fawe.object.FaweInputStream;
import com.boydti.fawe.object.FaweOutputStream; import com.boydti.fawe.object.FaweOutputStream;
@ -880,7 +881,7 @@ public class MainUtil {
long age = now - file.lastModified(); long age = now - file.lastModified();
if (age > timeDiff) { if (age > timeDiff) {
pool.submit(file::delete); pool.submit(file::delete);
Component msg = TranslatableComponent.of("worldedit.schematic.delete.deleted"); Component msg = Caption.of("worldedit.schematic.delete.deleted");
if (printDebug) { if (printDebug) {
LOGGER.debug(msg.toString()); LOGGER.debug(msg.toString());
} }

Datei anzeigen

@ -1,5 +1,6 @@
package com.boydti.fawe.util; package com.boydti.fawe.util;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.config.Settings; import com.boydti.fawe.config.Settings;
import com.boydti.fawe.object.RegionWrapper; import com.boydti.fawe.object.RegionWrapper;
import com.boydti.fawe.object.exception.FaweException; import com.boydti.fawe.object.exception.FaweException;
@ -89,7 +90,7 @@ public class WEManager {
backupRegions.add(region); backupRegions.add(region);
} }
} else { } else {
player.printDebug(TextComponent.of("Invalid Mask")); player.print(Caption.of("Invalid Mask"));
removed = true; removed = true;
iterator.remove(); iterator.remove();
} }

Datei anzeigen

@ -1,6 +1,7 @@
package com.boydti.fawe.util.image; package com.boydti.fawe.util.image;
import com.boydti.fawe.Fawe; import com.boydti.fawe.Fawe;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.config.Settings; import com.boydti.fawe.config.Settings;
import com.boydti.fawe.util.MainUtil; import com.boydti.fawe.util.MainUtil;
import com.boydti.fawe.util.MathMan; import com.boydti.fawe.util.MathMan;
@ -175,7 +176,7 @@ public class ImageUtil {
try { try {
return MainUtil.readImage(getInputStream(uri)); return MainUtil.readImage(getInputStream(uri));
} catch (IOException e) { } catch (IOException e) {
throw new InputParseException(TranslatableComponent.of(e.getMessage())); throw new InputParseException(Caption.of(e.getMessage()));
} }
} }
@ -188,7 +189,7 @@ public class ImageUtil {
} }
return new URL(uriStr).openStream(); return new URL(uriStr).openStream();
} catch (IOException e) { } catch (IOException e) {
throw new InputParseException(TranslatableComponent.of(e.getMessage())); throw new InputParseException(Caption.of(e.getMessage()));
} }
} }
@ -211,9 +212,9 @@ public class ImageUtil {
Settings.IMP.PATHS.HEIGHTMAP), arg); Settings.IMP.PATHS.HEIGHTMAP), arg);
return MainUtil.readImage(file); return MainUtil.readImage(file);
} }
throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-image", TextComponent.of(arg))); throw new InputParseException(Caption.of("fawe.error.invalid-image", TextComponent.of(arg)));
} catch (IOException e) { } catch (IOException e) {
throw new InputParseException(TranslatableComponent.of(e.getMessage())); throw new InputParseException(Caption.of(e.getMessage()));
} }
} }
@ -230,16 +231,16 @@ public class ImageUtil {
File file = MainUtil.getFile(MainUtil.getFile(Fawe.imp().getDirectory(), File file = MainUtil.getFile(MainUtil.getFile(Fawe.imp().getDirectory(),
Settings.IMP.PATHS.HEIGHTMAP), arg); Settings.IMP.PATHS.HEIGHTMAP), arg);
if (!file.exists()) { if (!file.exists()) {
throw new InputParseException(TranslatableComponent.of("fawe.error.file-not-found", TextComponent.of(String.valueOf(file)))); throw new InputParseException(Caption.of("fawe.error.file-not-found", TextComponent.of(String.valueOf(file))));
} }
if (file.isDirectory()) { if (file.isDirectory()) {
throw new InputParseException(TranslatableComponent.of("fawe.error.file-is-invalid-directory", TextComponent.of(String.valueOf(file)))); throw new InputParseException(Caption.of("fawe.error.file-is-invalid-directory", TextComponent.of(String.valueOf(file))));
} }
return file.toURI(); return file.toURI();
} }
throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-image", TextComponent.of(arg))); throw new InputParseException(Caption.of("fawe.error.invalid-image", TextComponent.of(arg)));
} catch (IOException | URISyntaxException e) { } catch (IOException | URISyntaxException e) {
throw new InputParseException(TranslatableComponent.of(e.getMessage())); throw new InputParseException(Caption.of(e.getMessage()));
} }
} }
} }

Datei anzeigen

@ -1086,9 +1086,9 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
if (used.MAX_CHANGES > 0 || used.MAX_ENTITIES > 0) { if (used.MAX_CHANGES > 0 || used.MAX_ENTITIES > 0) {
player.print(Caption.of("fawe.error.worldedit.some.fails", used.MAX_FAILS)); player.print(Caption.of("fawe.error.worldedit.some.fails", used.MAX_FAILS));
} else if (new ExtentTraverser<>(getExtent()).findAndGet(FaweRegionExtent.class) != null) { } 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 { } 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) { if (wnaMode) {
@ -1112,7 +1112,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
} }
} }
} catch (Throwable e) { } catch (Throwable e) {
player.printError(TranslatableComponent.of("fawe.error.lighting")); player.print(Caption.of("fawe.error.lighting"));
e.printStackTrace(); e.printStackTrace();
} }
// Enqueue it // Enqueue it

Datei anzeigen

@ -19,7 +19,7 @@
package com.sk89q.worldedit; 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. * 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 class MissingWorldException extends WorldEditException {
public MissingWorldException() { public MissingWorldException() {
super(TranslatableComponent.of("worldedit.error.missing-world")); super(Caption.of("worldedit.error.missing-world"));
} }
} }

Datei anzeigen

@ -19,8 +19,8 @@
package com.sk89q.worldedit; 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.TextComponent;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemType;
/** /**
@ -32,7 +32,7 @@ public class NotABlockException extends WorldEditException {
* Create a new instance. * Create a new instance.
*/ */
public NotABlockException() { 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 @Deprecated
public NotABlockException(String input) { 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 @Deprecated
public NotABlockException(int input) { 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 * @param input the input that was used
*/ */
public NotABlockException(ItemType input) { 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()));
} }
} }

Datei anzeigen

@ -19,8 +19,8 @@
package com.sk89q.worldedit; 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.TextComponent;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
/** /**
* Thrown when an unknown direction is specified or detected. * 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 * @param dir the input that was tried
*/ */
public UnknownDirectionException(String dir) { 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; this.dir = dir;
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit; package com.sk89q.worldedit;
import com.boydti.fawe.config.Caption;
import com.google.common.base.Throwables; import com.google.common.base.Throwables;
import com.google.common.collect.HashMultimap; import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableList; 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.concurrency.LazyReference;
import com.sk89q.worldedit.util.eventbus.EventBus; import com.sk89q.worldedit.util.eventbus.EventBus;
import com.sk89q.worldedit.util.formatting.text.TextComponent; 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.TextColor;
import com.sk89q.worldedit.util.io.file.FileSelectionAbortedException; import com.sk89q.worldedit.util.io.file.FileSelectionAbortedException;
import com.sk89q.worldedit.util.io.file.FilenameException; import com.sk89q.worldedit.util.io.file.FilenameException;
@ -315,7 +315,7 @@ public final class WorldEdit {
} }
if (f == null) { if (f == null) {
throw new FileSelectionAbortedException(TranslatableComponent.of("worldedit.error.no-file-selected")); throw new FileSelectionAbortedException(Caption.of("worldedit.error.no-file-selected"));
} }
} else { } else {
List<String> exts = extensions == null ? ImmutableList.of(defaultExt) : Lists.asList(defaultExt, extensions); 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); boolean isSym = existingParent != null && !existingParent.toRealPath().equals(existingParent);
if (!inDir || (!getConfiguration().allowSymlinks && isSym)) { 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(); return filePath.toFile();
} catch (IOException e) { } 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()); result = getSafeFileWithExtension(dir, filename, iter.next());
} }
if (result == null) { 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; return result;
} }
@ -717,7 +717,7 @@ public final class WorldEdit {
String ext = filename.substring(index + 1); String ext = filename.substring(index + 1);
if (!ext.equalsIgnoreCase("js")) { if (!ext.equalsIgnoreCase("js")) {
player.printError(TranslatableComponent.of("worldedit.script.unsupported")); player.print(Caption.of("worldedit.script.unsupported"));
return; return;
} }
@ -730,7 +730,7 @@ public final class WorldEdit {
file = WorldEdit.class.getResourceAsStream("craftscripts/" + filename); file = WorldEdit.class.getResourceAsStream("craftscripts/" + filename);
if (file == null) { 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; return;
} }
} else { } else {
@ -743,7 +743,7 @@ public final class WorldEdit {
in.close(); in.close();
script = new String(data, 0, data.length, StandardCharsets.UTF_8); script = new String(data, 0, data.length, StandardCharsets.UTF_8);
} catch (IOException e) { } 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; return;
} }
@ -756,7 +756,7 @@ public final class WorldEdit {
try { try {
engine = new RhinoCraftScriptEngine(); engine = new RhinoCraftScriptEngine();
} catch (NoClassDefFoundError ignored) { } catch (NoClassDefFoundError ignored) {
player.printError(TranslatableComponent.of("worldedit.script.no-script-engine")); player.print(Caption.of("worldedit.script.no-script-engine"));
return; return;
} }
@ -772,13 +772,13 @@ public final class WorldEdit {
} catch (ScriptException e) { } catch (ScriptException e) {
// non-exceptional return check // non-exceptional return check
if (!(Throwables.getRootCause(e) instanceof ReturnException)) { 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); logger.warn("Failed to execute script", e);
} }
} catch (NumberFormatException | WorldEditException e) { } catch (NumberFormatException | WorldEditException e) {
throw e; throw e;
} catch (Throwable 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))); TextColor.WHITE)));
logger.warn("Failed to execute script", e); logger.warn("Failed to execute script", e);
} finally { } finally {

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command; package com.sk89q.worldedit.command;
import com.boydti.fawe.config.Caption;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.sk89q.worldedit.LocalSession; 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.regions.factory.RegionFactory;
import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.util.TreeGenerator;
import com.sk89q.worldedit.util.formatting.text.TextComponent; 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.TextColor;
import com.sk89q.worldedit.util.formatting.text.format.TextDecoration; import com.sk89q.worldedit.util.formatting.text.format.TextDecoration;
import org.enginehub.piston.CommandManager; import org.enginehub.piston.CommandManager;
@ -62,19 +62,19 @@ import static org.enginehub.piston.part.CommandParts.arg;
@CommandContainer(superTypes = CommandPermissionsConditionGenerator.Registration.class) @CommandContainer(superTypes = CommandPermissionsConditionGenerator.Registration.class)
public class ApplyBrushCommands { 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()) .defaultsTo(ImmutableList.of())
.ofTypes(ImmutableList.of(Key.of(RegionFactory.class))) .ofTypes(ImmutableList.of(Key.of(RegionFactory.class)))
.build(); .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")) .defaultsTo(ImmutableList.of("5"))
.ofTypes(ImmutableList.of(Key.of(double.class))) .ofTypes(ImmutableList.of(Key.of(double.class)))
.build(); .build();
public static void register(CommandManagerService service, CommandManager commandManager, CommandRegistrationHandler registration) { public static void register(CommandManagerService service, CommandManager commandManager, CommandRegistrationHandler registration) {
commandManager.register("apply", builder -> { 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); builder.action(org.enginehub.piston.Command.Action.NULL_ACTION);
CommandManager manager = service.newCommandManager(); CommandManager manager = service.newCommandManager();
@ -86,7 +86,7 @@ public class ApplyBrushCommands {
builder.condition(new PermissionCondition(ImmutableSet.of("worldedit.brush.apply"))); builder.condition(new PermissionCondition(ImmutableSet.of("worldedit.brush.apply")));
builder.addParts(REGION_FACTORY, RADIUS); 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())) .withCommands(manager.getAllCommands().collect(Collectors.toList()))
.required() .required()
.build()); .build());
@ -126,7 +126,7 @@ public class ApplyBrushCommands {
@Direction(includeDiagonals = true) @Direction(includeDiagonals = true)
com.sk89q.worldedit.util.Direction direction) throws WorldEditException { com.sk89q.worldedit.util.Direction direction) throws WorldEditException {
player.print(TextComponent.builder().append("WARNING: ", TextColor.RED, TextDecoration.BOLD) 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)); setApplyBrush(parameters, player, localSession, new ItemUseFactory(item, direction));
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command; package com.sk89q.worldedit.command;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.WorldEdit; 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.component.TextUtils;
import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TextComponent; 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.util.formatting.text.event.HoverEvent;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.biome.BiomeType;
@ -124,7 +124,7 @@ public class BiomeCommands {
if (useLineOfSight) { if (useLineOfSight) {
Location blockPosition = player.getBlockTrace(300); Location blockPosition = player.getBlockTrace(300);
if (blockPosition == null) { if (blockPosition == null) {
player.printError(TranslatableComponent.of("worldedit.raytrace.noblock")); player.print(Caption.of("worldedit.raytrace.noblock"));
return; return;
} }
@ -153,7 +153,7 @@ public class BiomeCommands {
HoverEvent.showText(TextComponent.of(biome.getId())) HoverEvent.showText(TextComponent.of(biome.getId()))
) )
).collect(Collectors.toList()); ).collect(Collectors.toList());
player.printInfo(TranslatableComponent.of(messageKey, TextUtils.join(components, TextComponent.of(", ")))); player.print(Caption.of(messageKey, TextUtils.join(components, TextComponent.of(", "))));
} }
@Command( @Command(
@ -185,7 +185,7 @@ public class BiomeCommands {
RegionVisitor visitor = new RegionVisitor(region, replace); RegionVisitor visitor = new RegionVisitor(region, replace);
Operations.completeLegacy(visitor); Operations.completeLegacy(visitor);
player.printInfo(TranslatableComponent.of( player.print(Caption.of(
"worldedit.setbiome.changed", "worldedit.setbiome.changed",
TextComponent.of(visitor.getAffected()) TextComponent.of(visitor.getAffected())
)); ));

Datei anzeigen

@ -106,7 +106,6 @@ import com.sk89q.worldedit.util.HandSide;
import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.util.TreeGenerator;
import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TextComponent; 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.ClickEvent;
import com.sk89q.worldedit.util.formatting.text.format.TextColor; import com.sk89q.worldedit.util.formatting.text.format.TextColor;
import com.sk89q.worldedit.world.block.BlockID; import com.sk89q.worldedit.world.block.BlockID;
@ -315,7 +314,7 @@ public class BrushCommands {
public void sweepBrush(Player player, InjectedValueAccess context, public void sweepBrush(Player player, InjectedValueAccess context,
@Arg(desc = "int", def = "-1") @Arg(desc = "int", def = "-1")
int copies) throws WorldEditException { 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)); set(context, new SweepBrush(copies));
} }
@ -428,7 +427,7 @@ public class BrushCommands {
case BlockID.SAND: case BlockID.SAND:
case BlockID.GRAVEL: case BlockID.GRAVEL:
player.print( player.print(
TranslatableComponent.of("fawe.worldedit.brush.brush.try.other")); Caption.of("fawe.worldedit.brush.brush.try.other"));
falling = true; falling = true;
break; break;
default: default:
@ -1111,7 +1110,7 @@ public class BrushCommands {
} }
player.print(Caption.of("fawe.worldedit.schematic.schematic.saved", name)); player.print(Caption.of("fawe.worldedit.schematic.schematic.saved", name));
} else { } 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)); player.print(Caption.of("fawe.worldedit.brush.brush.equipped", name));
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); 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.setFill(null);
tool.setBrush(new OperationFactoryBrush(factory, shape, session), permission); 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); ToolCommands.sendUnbindInstruction(player, UNBIND_COMMAND_COMPONENT);
} }
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command; package com.sk89q.worldedit.command;
import com.boydti.fawe.config.Caption;
import com.google.gson.JsonIOException; import com.google.gson.JsonIOException;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
@ -86,9 +87,9 @@ public class ChunkCommands {
int chunkZ = (int) Math.floor(pos.getBlockZ() / 16.0); int chunkZ = (int) Math.floor(pos.getBlockZ() / 16.0);
final BlockVector2 chunkPos = BlockVector2.at(chunkX, chunkZ); final BlockVector2 chunkPos = BlockVector2.at(chunkX, chunkZ);
player.printInfo(TranslatableComponent.of("worldedit.chunkinfo.chunk", TextComponent.of(chunkX), TextComponent.of(chunkZ))); player.print(Caption.of("worldedit.chunkinfo.chunk", TextComponent.of(chunkX), TextComponent.of(chunkZ)));
player.printInfo(TranslatableComponent.of("worldedit.chunkinfo.old-filename", TextComponent.of(LegacyChunkStore.getFilename(chunkPos)))); player.print(Caption.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.mcregion-filename", TextComponent.of(McRegionChunkStore.getFilename(chunkPos))));
} }
@Command( @Command(
@ -101,7 +102,7 @@ public class ChunkCommands {
@ArgFlag(name = 'p', desc = "Page number.", def = "1") int page) throws WorldEditException { @ArgFlag(name = 'p', desc = "Page number.", def = "1") int page) throws WorldEditException {
final Region region = session.getSelection(world); 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)); actor.print(new ChunkListPaginationBox(region).create(page));
} }

Datei anzeigen

@ -77,7 +77,6 @@ import com.sk89q.worldedit.regions.selector.CuboidRegionSelector;
import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.session.ClipboardHolder;
import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TextComponent; 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.ClickEvent;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import org.enginehub.piston.annotation.Command; 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)); 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(); FaweLimit limit = actor.getLimit();
if (volume >= limit.MAX_CHECKS) { 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); session.setClipboard(null);
ReadOnlyClipboard lazyClipboard = ReadOnlyClipboard.of(region, !skipEntities, copyBiomes); ReadOnlyClipboard lazyClipboard = ReadOnlyClipboard.of(region, !skipEntities, copyBiomes);
@ -224,7 +223,7 @@ public class ClipboardCommands {
ReadOnlyClipboard lazyClipboard = new WorldCutClipboard(editSession, region, !skipEntities, copyBiomes); ReadOnlyClipboard lazyClipboard = new WorldCutClipboard(editSession, region, !skipEntities, copyBiomes);
clipboard.setOrigin(session.getPlacementPosition(actor)); clipboard.setOrigin(session.getPlacementPosition(actor));
session.setClipboard(new ClipboardHolder(lazyClipboard)); 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( @Command(
@ -289,7 +288,7 @@ public class ClipboardCommands {
session.setClipboard(new ClipboardHolder(clipboard)); session.setClipboard(new ClipboardHolder(clipboard));
if (!actor.hasPermission("fawe.tips")) { 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); copy.getStatusMessages().forEach(actor::print);
} }
@ -384,7 +383,7 @@ public class ClipboardCommands {
} }
} }
if (url == null) { if (url == null) {
player.printError(TranslatableComponent.of("fawe.web.generating.link.failed")); player.print(Caption.of("fawe.web.generating.link.failed"));
} else { } else {
String urlText = url.toString(); String urlText = url.toString();
if (Settings.IMP.WEB.SHORTEN_URLS) { if (Settings.IMP.WEB.SHORTEN_URLS) {
@ -459,9 +458,9 @@ public class ClipboardCommands {
} }
if (onlySelect) { if (onlySelect) {
actor.printInfo(TranslatableComponent.of("worldedit.paste.selected")); actor.print(Caption.of("worldedit.paste.selected"));
} else { } 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); messages.forEach(actor::print);
} }
@ -474,7 +473,7 @@ public class ClipboardCommands {
PasteEvent event = new PasteEvent(player, clipboard, uri, editSession, to); PasteEvent event = new PasteEvent(player, clipboard, uri, editSession, to);
WorldEdit.getInstance().getEventBus().post(event); WorldEdit.getInstance().getEventBus().post(event);
if (event.isCancelled()) { 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)); actor.print(Caption.of("fawe.worldedit.paste.command.paste", to));
if (!actor.hasPermission("fawe.tips")) { 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.rotateX(-rotateX);
transform = transform.rotateZ(-rotateZ); transform = transform.rotateZ(-rotateZ);
holder.setTransform(transform.combine(holder.getTransform())); holder.setTransform(transform.combine(holder.getTransform()));
actor.printInfo(TranslatableComponent.of("worldedit.rotate.rotated")); actor.print(Caption.of("worldedit.rotate.rotated"));
} }
@Command( @Command(
@ -556,7 +555,7 @@ public class ClipboardCommands {
AffineTransform transform = new AffineTransform(); AffineTransform transform = new AffineTransform();
transform = transform.scale(direction.abs().multiply(-2).add(1, 1, 1).toVector3()); transform = transform.scale(direction.abs().multiply(-2).add(1, 1, 1).toVector3());
holder.setTransform(transform.combine(holder.getTransform())); holder.setTransform(transform.combine(holder.getTransform()));
actor.printInfo(TranslatableComponent.of("worldedit.flip.flipped")); actor.print(Caption.of("worldedit.flip.flipped"));
} }
@Command( @Command(
@ -567,7 +566,7 @@ public class ClipboardCommands {
@CommandPermissions("worldedit.clipboard.clear") @CommandPermissions("worldedit.clipboard.clear")
public void clearClipboard(Actor actor, LocalSession session) throws WorldEditException { public void clearClipboard(Actor actor, LocalSession session) throws WorldEditException {
session.setClipboard(null); session.setClipboard(null);
actor.printInfo(TranslatableComponent.of("worldedit.clearclipboard.cleared")); actor.print(Caption.of("worldedit.clearclipboard.cleared"));
} }
private void saveDiskClipboard(Clipboard clipboard) { private void saveDiskClipboard(Clipboard clipboard) {

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command; package com.sk89q.worldedit.command;
import com.boydti.fawe.config.Caption;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.IncompleteRegionException;
import com.sk89q.worldedit.LocalSession; 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.Region;
import com.sk89q.worldedit.regions.RegionOperationException; import com.sk89q.worldedit.regions.RegionOperationException;
import com.sk89q.worldedit.util.formatting.text.TextComponent; 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.World;
import org.enginehub.piston.Command; import org.enginehub.piston.Command;
import org.enginehub.piston.CommandManager; import org.enginehub.piston.CommandManager;
@ -73,7 +73,7 @@ public class ExpandCommands {
command.condition(new PermissionCondition(ImmutableSet.of("worldedit.selection.expand"))); command.condition(new PermissionCondition(ImmutableSet.of("worldedit.selection.expand")));
command.addPart(SubCommandPart.builder( command.addPart(SubCommandPart.builder(
TranslatableComponent.of("vert"), Caption.of("vert"),
TextComponent.of("Vertical expansion sub-command") TextComponent.of("Vertical expansion sub-command")
) )
.withCommands(ImmutableSet.of(createVertCommand(commandManager))) .withCommands(ImmutableSet.of(createVertCommand(commandManager)))
@ -88,7 +88,7 @@ public class ExpandCommands {
private static Command createVertCommand(CommandManager commandManager) { private static Command createVertCommand(CommandManager commandManager) {
return commandManager.newCommand("vert") return commandManager.newCommand("vert")
.description(TranslatableComponent.of("worldedit.expand.description.vert")) .description(Caption.of("worldedit.expand.description.vert"))
.action(parameters -> { .action(parameters -> {
expandVert( expandVert(
requireIV(Key.of(LocalSession.class), "localSession", parameters), requireIV(Key.of(LocalSession.class), "localSession", parameters),
@ -112,7 +112,7 @@ public class ExpandCommands {
session.getRegionSelector(world).explainRegionAdjust(actor, session); session.getRegionSelector(world).explainRegionAdjust(actor, session);
long changeSize = newSize - oldSize; long changeSize = newSize - oldSize;
actor.printInfo( actor.printInfo(
TranslatableComponent.of("worldedit.expand.expanded.vert", TextComponent.of(changeSize)) Caption.of("worldedit.expand.expanded.vert", TextComponent.of(changeSize))
); );
} catch (RegionOperationException e) { } catch (RegionOperationException e) {
actor.printError(TextComponent.of(e.getMessage())); actor.printError(TextComponent.of(e.getMessage()));
@ -151,7 +151,7 @@ public class ExpandCommands {
session.getRegionSelector(world).explainRegionAdjust(actor, session); session.getRegionSelector(world).explainRegionAdjust(actor, session);
long changeSize = newSize - oldSize; long changeSize = newSize - oldSize;
actor.printInfo(TranslatableComponent.of("worldedit.expand.expanded", TextComponent.of(changeSize))); actor.print(Caption.of("worldedit.expand.expanded", TextComponent.of(changeSize)));
} }
} }

Datei anzeigen

@ -172,7 +172,7 @@ public class GeneralCommands {
limit = limit == null ? config.defaultChangeLimit : Math.max(-1, limit); limit = limit == null ? config.defaultChangeLimit : Math.max(-1, limit);
if (!mayDisable && config.maxChangeLimit > -1) { if (!mayDisable && config.maxChangeLimit > -1) {
if (limit > config.maxChangeLimit) { 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; return;
} }
} }
@ -199,7 +199,7 @@ public class GeneralCommands {
limit = limit == null ? config.calculationTimeout : Math.max(-1, limit); limit = limit == null ? config.calculationTimeout : Math.max(-1, limit);
if (!mayDisable && config.maxCalculationTimeout > -1) { if (!mayDisable && config.maxCalculationTimeout > -1) {
if (limit > config.maxCalculationTimeout) { 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; return;
} }
} }
@ -223,16 +223,16 @@ public class GeneralCommands {
Boolean fastMode) { Boolean fastMode) {
boolean hasFastMode = session.hasFastMode(); boolean hasFastMode = session.hasFastMode();
if (fastMode != null && fastMode == 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; return;
} }
if (hasFastMode) { if (hasFastMode) {
session.setFastMode(false); session.setFastMode(false);
actor.printInfo(TranslatableComponent.of("worldedit.fast.disabled")); actor.print(Caption.of("worldedit.fast.disabled"));
} else { } else {
session.setFastMode(true); 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); SideEffect.State currentState = session.getSideEffectSet().getState(sideEffect);
if (newState != null && newState == currentState) { if (newState != null && newState == currentState) {
if (!showInfoBox) { if (!showInfoBox) {
actor.printError(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.perf.sideeffect.already-set", "worldedit.perf.sideeffect.already-set",
TranslatableComponent.of(sideEffect.getDisplayName()), TranslatableComponent.of(sideEffect.getDisplayName()),
TranslatableComponent.of(newState.getDisplayName()) TranslatableComponent.of(newState.getDisplayName())
@ -266,14 +266,14 @@ public class GeneralCommands {
if (newState != null) { if (newState != null) {
session.setSideEffectSet(session.getSideEffectSet().with(sideEffect, newState)); session.setSideEffectSet(session.getSideEffectSet().with(sideEffect, newState));
if (!showInfoBox) { if (!showInfoBox) {
actor.printInfo(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.perf.sideeffect.set", "worldedit.perf.sideeffect.set",
TranslatableComponent.of(sideEffect.getDisplayName()), TranslatableComponent.of(sideEffect.getDisplayName()),
TranslatableComponent.of(newState.getDisplayName()) TranslatableComponent.of(newState.getDisplayName())
)); ));
} }
} else { } else {
actor.printInfo(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.perf.sideeffect.get", "worldedit.perf.sideeffect.get",
TranslatableComponent.of(sideEffect.getDisplayName()), TranslatableComponent.of(sideEffect.getDisplayName()),
TranslatableComponent.of(currentState.getDisplayName()) TranslatableComponent.of(currentState.getDisplayName())
@ -286,7 +286,7 @@ public class GeneralCommands {
} }
session.setSideEffectSet(applier); session.setSideEffectSet(applier);
if (!showInfoBox) { if (!showInfoBox) {
actor.printInfo(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.perf.sideeffect.set-all", "worldedit.perf.sideeffect.set-all",
TranslatableComponent.of(newState.getDisplayName()) TranslatableComponent.of(newState.getDisplayName())
)); ));
@ -308,10 +308,10 @@ public class GeneralCommands {
@Arg(desc = "The reorder mode", def = "") @Arg(desc = "The reorder mode", def = "")
EditSession.ReorderMode reorderMode) { EditSession.ReorderMode reorderMode) {
if (reorderMode == null) { 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 { } else {
session.setReorderMode(reorderMode); 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(); boolean useServerCui = session.shouldUseServerCUI();
if (drawSelection != null && drawSelection == useServerCui) { 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; return;
} }
if (useServerCui) { if (useServerCui) {
session.setUseServerCUI(false); session.setUseServerCUI(false);
session.updateServerCUI(player); session.updateServerCUI(player);
player.printInfo(TranslatableComponent.of("worldedit.drawsel.disabled")); player.print(Caption.of("worldedit.drawsel.disabled"));
} else { } else {
session.setUseServerCUI(true); session.setUseServerCUI(true);
session.updateServerCUI(player); 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) { @Arg(desc = "The world override", def = "") World world) {
session.setWorldOverride(world); session.setWorldOverride(world);
if (world == null) { if (world == null) {
actor.printInfo(TranslatableComponent.of("worldedit.world.remove")); actor.print(Caption.of("worldedit.world.remove"));
} else { } 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 = "") @Arg(desc = "The mode to set the watchdog hook to", def = "")
HookMode hookMode) { HookMode hookMode) {
if (WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getWatchdog() == null) { 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; return;
} }
boolean previousMode = session.isTickingWatchdog(); boolean previousMode = session.isTickingWatchdog();
if (hookMode != null && (hookMode == HookMode.ACTIVE) == previousMode) { 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; return;
} }
session.setTickingWatchdog(!previousMode); 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( @Command(
@ -392,10 +392,10 @@ public class GeneralCommands {
Mask mask) { Mask mask) {
if (mask == null) { if (mask == null) {
session.setMask(null); session.setMask(null);
actor.printInfo(TranslatableComponent.of("worldedit.gmask.disabled")); actor.print(Caption.of("worldedit.gmask.disabled"));
} else { } else {
session.setMask(mask); 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") @CommandPermissions("worldedit.toggleplace")
public void togglePlace(Player player, LocalSession session) { public void togglePlace(Player player, LocalSession session) {
if (session.togglePlacementPosition()) { if (session.togglePlacementPosition()) {
player.printInfo(TranslatableComponent.of("worldedit.toggleplace.pos1")); player.print(Caption.of("worldedit.toggleplace.pos1"));
} else { } 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) { List<String> query) {
String search = String.join(" ", query); String search = String.join(" ", query);
if (search.length() <= 2) { if (search.length() <= 2) {
actor.printError(TranslatableComponent.of("worldedit.searchitem.too-short")); actor.print(Caption.of("worldedit.searchitem.too-short"));
return; return;
} }
if (blocksOnly && itemsOnly) { if (blocksOnly && itemsOnly) {
actor.printError(TranslatableComponent.of("worldedit.searchitem.either-b-or-i")); actor.print(Caption.of("worldedit.searchitem.either-b-or-i"));
return; return;
} }

Datei anzeigen

@ -49,7 +49,6 @@ import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.util.TreeGenerator.TreeType;
import com.sk89q.worldedit.util.formatting.text.TextComponent; 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.biome.BiomeType;
import com.sk89q.worldedit.world.block.BlockType; import com.sk89q.worldedit.world.block.BlockType;
import org.enginehub.piston.annotation.Command; import org.enginehub.piston.annotation.Command;
@ -239,7 +238,7 @@ public class GenerationCommands {
break; break;
default: default:
actor.printError(TranslatableComponent.of("worldedit.cyl.invalid-radius")); actor.print(Caption.of("worldedit.cyl.invalid-radius"));
return 0; return 0;
} }
@ -249,7 +248,7 @@ public class GenerationCommands {
BlockVector3 pos = session.getPlacementPosition(actor); BlockVector3 pos = session.getPlacementPosition(actor);
int affected = editSession.makeCylinder(pos, pattern, radiusX, radiusZ, height, !hollow); 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; return affected;
} }
@ -301,7 +300,7 @@ public class GenerationCommands {
break; break;
default: default:
actor.printError(TranslatableComponent.of("worldedit.sphere.invalid-radius")); actor.print(Caption.of("worldedit.sphere.invalid-radius"));
return 0; return 0;
} }
@ -317,7 +316,7 @@ public class GenerationCommands {
if (actor instanceof Player) { if (actor instanceof Player) {
((Player) actor).findFreePosition(); ((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; return affected;
} }
@ -339,7 +338,7 @@ public class GenerationCommands {
worldEdit.checkMaxRadius(size); worldEdit.checkMaxRadius(size);
density /= 100; density /= 100;
int affected = editSession.makeForest(session.getPlacementPosition(actor), size, density, type); 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; return affected;
} }
@ -358,7 +357,7 @@ public class GenerationCommands {
checkCommandArgument(0 <= density && density <= 100, "Density must be between 0 and 100"); checkCommandArgument(0 <= density && density <= 100, "Density must be between 0 and 100");
worldEdit.checkMaxRadius(size); worldEdit.checkMaxRadius(size);
int affected = editSession.makePumpkinPatches(session.getPlacementPosition(actor), size, density); 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; return affected;
} }
@ -395,7 +394,7 @@ public class GenerationCommands {
if (actor instanceof Player) { if (actor instanceof Player) {
((Player) actor).findFreePosition(); ((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; return affected;
} }
@ -463,7 +462,7 @@ public class GenerationCommands {
if (actor instanceof Player) { if (actor instanceof Player) {
((Player) actor).findFreePosition(); ((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; return affected;
} catch (ExpressionException e) { } catch (ExpressionException e) {
actor.printError(TextComponent.of(e.getMessage())); actor.printError(TextComponent.of(e.getMessage()));
@ -532,7 +531,7 @@ public class GenerationCommands {
final Vector3 unit1 = unit; final Vector3 unit1 = unit;
try { try {
final int affected = editSession.makeBiomeShape(region, zero, unit1, target, String.join(" ", expression), hollow, session.getTimeout()); 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; return affected;
} catch (ExpressionException e) { } catch (ExpressionException e) {
actor.printError(TextComponent.of(e.getMessage())); actor.printError(TextComponent.of(e.getMessage()));

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command; package com.sk89q.worldedit.command;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.WorldEdit; 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.extension.platform.Actor;
import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.extent.inventory.BlockBag;
import com.sk89q.worldedit.util.formatting.text.TextComponent; 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.Command;
import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.CommandContainer;
import org.enginehub.piston.annotation.param.Arg; import org.enginehub.piston.annotation.param.Arg;
@ -69,14 +69,14 @@ public class HistoryCommands {
times = Math.max(1, times); times = Math.max(1, times);
LocalSession undoSession = session; LocalSession undoSession = session;
if (session.hasFastMode()) { if (session.hasFastMode()) {
actor.print(TranslatableComponent.of("fawe.worldedit.history.command.undo.disabled")); actor.print(Caption.of("fawe.worldedit.history.command.undo.disabled"));
return; return;
} }
if (playerName != null) { if (playerName != null) {
actor.checkPermission("worldedit.history.undo.other"); actor.checkPermission("worldedit.history.undo.other");
undoSession = worldEdit.getSessionManager().findByName(playerName); undoSession = worldEdit.getSessionManager().findByName(playerName);
if (undoSession == null) { 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; return;
} }
} }
@ -92,9 +92,9 @@ public class HistoryCommands {
} }
} }
if (timesUndone > 0) { if (timesUndone > 0) {
actor.printInfo(TranslatableComponent.of("worldedit.undo.undone", TextComponent.of(timesUndone))); actor.print(Caption.of("worldedit.undo.undone", TextComponent.of(timesUndone)));
} else { } 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"); actor.checkPermission("worldedit.history.redo.other");
redoSession = worldEdit.getSessionManager().findByName(playerName); redoSession = worldEdit.getSessionManager().findByName(playerName);
if (redoSession == null) { 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; return;
} }
} }
@ -131,9 +131,9 @@ public class HistoryCommands {
} }
} }
if (timesRedone > 0) { if (timesRedone > 0) {
actor.printInfo(TranslatableComponent.of("worldedit.redo.redone", TextComponent.of(timesRedone))); actor.print(Caption.of("worldedit.redo.redone", TextComponent.of(timesRedone)));
} else { } 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") @CommandPermissions("worldedit.history.clear")
public void clearHistory(Actor actor, LocalSession session) { public void clearHistory(Actor actor, LocalSession session) {
session.clearHistory(); session.clearHistory();
actor.printInfo(TranslatableComponent.of("worldedit.clearhistory.cleared")); actor.print(Caption.of("worldedit.clearhistory.cleared"));
} }
} }

Datei anzeigen

@ -221,7 +221,7 @@ public class HistorySubCommands {
Integer index) throws WorldEditException, ExecutionException, InterruptedException { Integer index) throws WorldEditException, ExecutionException, InterruptedException {
RollbackOptimizedHistory edit = database.getEdit(other, index).get(); RollbackOptimizedHistory edit = database.getEdit(other, index).get();
if (edit == null) { if (edit == null) {
player.print(TranslatableComponent.of("fawe.worldedit.schematic.schematic.none")); player.print(Caption.of("fawe.worldedit.schematic.schematic.none"));
return; return;
} }
Location origin = player.getLocation(); Location origin = player.getLocation();
@ -341,10 +341,10 @@ public class HistorySubCommands {
return; return;
} }
if (other == null && radius == 0 && timeDiff == 0) { 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(radius > 0, Caption.of("fawe.error.radius-too-small"));
checkCommandArgument(timeDiff > 0, TranslatableComponent.of("fawe.error.time-too-less")); checkCommandArgument(timeDiff > 0, Caption.of("fawe.error.time-too-less"));
Location origin = player.getLocation(); Location origin = player.getLocation();
String pageCommand = "/" + arguments.get().replaceAll("-p [0-9]+", "").trim(); String pageCommand = "/" + arguments.get().replaceAll("-p [0-9]+", "").trim();

Datei anzeigen

@ -21,6 +21,7 @@
package com.sk89q.worldedit.command; package com.sk89q.worldedit.command;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
@ -67,7 +68,7 @@ class LegacySnapshotCommands {
if (!snapshots.isEmpty()) { if (!snapshots.isEmpty()) {
actor.print(new SnapshotListBox(world.getName(), snapshots).create(page)); actor.print(new SnapshotListBox(world.getName(), snapshots).create(page));
} else { } 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! // Okay, let's toss some debugging information!
File dir = config.snapshotRepo.getDirectory(); File dir = config.snapshotRepo.getDirectory();
@ -82,7 +83,7 @@ class LegacySnapshotCommands {
} }
} }
} catch (MissingWorldException ex) { } 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) { if (snapshot != null) {
session.setSnapshot(null); session.setSnapshot(null);
actor.printInfo(TranslatableComponent.of("worldedit.snapshot.use.newest")); actor.print(Caption.of("worldedit.snapshot.use.newest"));
} else { } else {
actor.printError(TranslatableComponent.of("worldedit.restore.none-found")); actor.print(Caption.of("worldedit.restore.none-found"));
} }
} catch (MissingWorldException ex) { } catch (MissingWorldException ex) {
actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world")); actor.print(Caption.of("worldedit.restore.none-for-world"));
} }
} else { } else {
try { try {
session.setSnapshot(config.snapshotRepo.getSnapshot(name)); 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) { } 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(); LocalConfiguration config = we.getConfiguration();
if (index < 1) { if (index < 1) {
actor.printError(TranslatableComponent.of("worldedit.snapshot.index-above-0")); actor.print(Caption.of("worldedit.snapshot.index-above-0"));
return; return;
} }
try { try {
List<Snapshot> snapshots = config.snapshotRepo.getSnapshots(true, world.getName()); List<Snapshot> snapshots = config.snapshotRepo.getSnapshots(true, world.getName());
if (snapshots.size() < index) { 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; return;
} }
Snapshot snapshot = snapshots.get(index - 1); Snapshot snapshot = snapshots.get(index - 1);
if (snapshot == null) { if (snapshot == null) {
actor.printError(TranslatableComponent.of("worldedit.restore.not-available")); actor.print(Caption.of("worldedit.restore.not-available"));
return; return;
} }
session.setSnapshot(snapshot); 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) { } 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()); Snapshot snapshot = config.snapshotRepo.getSnapshotBefore(date, world.getName());
if (snapshot == null) { if (snapshot == null) {
actor.printError(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.snapshot.none-before", "worldedit.snapshot.none-before",
TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date))) TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date)))
); );
} else { } else {
session.setSnapshot(snapshot); 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) { } 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 { try {
Snapshot snapshot = config.snapshotRepo.getSnapshotAfter(date, world.getName()); Snapshot snapshot = config.snapshotRepo.getSnapshotAfter(date, world.getName());
if (snapshot == null) { if (snapshot == null) {
actor.printError(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.snapshot.none-after", "worldedit.snapshot.none-after",
TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date))) TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date)))
); );
} else { } else {
session.setSnapshot(snapshot); 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) { } catch (MissingWorldException ex) {
actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world")); actor.print(Caption.of("worldedit.restore.none-for-world"));
} }
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command; package com.sk89q.worldedit.command;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
@ -58,7 +59,7 @@ class LegacySnapshotUtilCommands {
try { try {
snapshot = config.snapshotRepo.getSnapshot(snapshotName); snapshot = config.snapshotRepo.getSnapshot(snapshotName);
} catch (InvalidSnapshotException e) { } catch (InvalidSnapshotException e) {
actor.printError(TranslatableComponent.of("worldedit.restore.not-available")); actor.print(Caption.of("worldedit.restore.not-available"));
return; return;
} }
} else { } else {
@ -71,7 +72,7 @@ class LegacySnapshotUtilCommands {
snapshot = config.snapshotRepo.getDefaultSnapshot(world.getName()); snapshot = config.snapshotRepo.getDefaultSnapshot(world.getName());
if (snapshot == null) { 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! // Okay, let's toss some debugging information!
File dir = config.snapshotRepo.getDirectory(); File dir = config.snapshotRepo.getDirectory();
@ -88,7 +89,7 @@ class LegacySnapshotUtilCommands {
return; return;
} }
} catch (MissingWorldException ex) { } catch (MissingWorldException ex) {
actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world")); actor.print(Caption.of("worldedit.restore.none-for-world"));
return; return;
} }
} }
@ -98,9 +99,9 @@ class LegacySnapshotUtilCommands {
// Load chunk store // Load chunk store
try { try {
chunkStore = snapshot.getChunkStore(); 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) { } 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; return;
} }
@ -114,15 +115,15 @@ class LegacySnapshotUtilCommands {
if (restore.hadTotalFailure()) { if (restore.hadTotalFailure()) {
String error = restore.getLastErrorMessage(); String error = restore.getLastErrorMessage();
if (!restore.getMissingChunks().isEmpty()) { 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) { } else if (error != null) {
actor.printError(TranslatableComponent.of("worldedit.restore.block-place-failed")); actor.print(Caption.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-error", TextComponent.of(error)));
} else { } else {
actor.printError(TranslatableComponent.of("worldedit.restore.chunk-load-failed")); actor.print(Caption.of("worldedit.restore.chunk-load-failed"));
} }
} else { } else {
actor.printInfo(TranslatableComponent.of("worldedit.restore.restored", actor.print(Caption.of("worldedit.restore.restored",
TextComponent.of(restore.getMissingChunks().size()), TextComponent.of(restore.getMissingChunks().size()),
TextComponent.of(restore.getErrorChunks().size()))); TextComponent.of(restore.getErrorChunks().size())));
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command; package com.sk89q.worldedit.command;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.WorldEditException;
@ -63,7 +64,7 @@ public class NavigationCommands {
@CommandPermissions("worldedit.navigation.unstuck") @CommandPermissions("worldedit.navigation.unstuck")
public void unstuck(Player player) throws WorldEditException { public void unstuck(Player player) throws WorldEditException {
player.findFreePosition(); player.findFreePosition();
player.printInfo(TranslatableComponent.of("worldedit.unstuck.moved")); player.print(Caption.of("worldedit.unstuck.moved"));
} }
@Command( @Command(
@ -83,9 +84,9 @@ public class NavigationCommands {
} }
} }
if (ascentLevels == 0) { if (ascentLevels == 0) {
player.printError(TranslatableComponent.of("worldedit.ascend.obstructed")); player.print(Caption.of("worldedit.ascend.obstructed"));
} else { } 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) { if (descentLevels == 0) {
player.printError(TranslatableComponent.of("worldedit.descend.obstructed")); player.print(Caption.of("worldedit.descend.obstructed"));
} else { } 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); boolean alwaysGlass = getAlwaysGlass(forceFlight, forceGlass);
if (player.ascendToCeiling(clearance, alwaysGlass)) { if (player.ascendToCeiling(clearance, alwaysGlass)) {
player.printInfo(TranslatableComponent.of("worldedit.ceil.moved")); player.print(Caption.of("worldedit.ceil.moved"));
} else { } 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") @CommandPermissions("worldedit.navigation.thru.command")
public void thru(Player player) throws WorldEditException { public void thru(Player player) throws WorldEditException {
if (player.passThroughForwardWall(6)) { if (player.passThroughForwardWall(6)) {
player.printInfo(TranslatableComponent.of("worldedit.thru.moved")); player.print(Caption.of("worldedit.thru.moved"));
} else { } 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) { if (pos != null) {
player.findFreePosition(pos); player.findFreePosition(pos);
player.printInfo(TranslatableComponent.of("worldedit.jumpto.moved")); player.print(Caption.of("worldedit.jumpto.moved"));
} else { } 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 forceGlass) throws WorldEditException {
boolean alwaysGlass = getAlwaysGlass(forceFlight, forceGlass); boolean alwaysGlass = getAlwaysGlass(forceFlight, forceGlass);
if (player.ascendUpwards(distance, alwaysGlass)) { if (player.ascendUpwards(distance, alwaysGlass)) {
player.printInfo(TranslatableComponent.of("worldedit.up.moved")); player.print(Caption.of("worldedit.up.moved"));
} else { } else {
player.printError(TranslatableComponent.of("worldedit.up.obstructed")); player.print(Caption.of("worldedit.up.obstructed"));
} }
} }

Datei anzeigen

@ -112,7 +112,7 @@ public class RegionCommands {
Pattern pattern) { Pattern pattern) {
int affected = editSession.setBlocks(region, pattern); int affected = editSession.setBlocks(region, pattern);
if (affected != 0) { if (affected != 0) {
actor.printInfo(TranslatableComponent.of("worldedit.set.done")); actor.print(Caption.of("worldedit.set.done"));
} }
return affected; return affected;
} }
@ -194,14 +194,14 @@ public class RegionCommands {
public void nbtinfo(Player player, EditSession editSession) { public void nbtinfo(Player player, EditSession editSession) {
Location pos = player.getBlockTrace(128); Location pos = player.getBlockTrace(128);
if (pos == null) { if (pos == null) {
player.printError(TranslatableComponent.of("fawe.navigation.no.block")); player.print(Caption.of("fawe.navigation.no.block"));
return; return;
} }
CompoundTag nbt = editSession.getFullBlock(pos.toBlockPoint()).getNbtData(); CompoundTag nbt = editSession.getFullBlock(pos.toBlockPoint()).getNbtData();
if (nbt != null) { if (nbt != null) {
player.print(TextComponent.of(nbt.getValue().toString())); player.print(TextComponent.of(nbt.getValue().toString()));
} else { } 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") @Switch(name = 'h', desc = "Generate only a shell")
boolean shell) throws WorldEditException { boolean shell) throws WorldEditException {
if (!(region instanceof CuboidRegion)) { if (!(region instanceof CuboidRegion)) {
actor.printError(TranslatableComponent.of("worldedit.line.cuboid-only")); actor.print(Caption.of("worldedit.line.cuboid-only"));
return 0; return 0;
} }
checkCommandArgument(thickness >= 0, "Thickness must be >= 0"); checkCommandArgument(thickness >= 0, "Thickness must be >= 0");
@ -250,7 +250,7 @@ public class RegionCommands {
BlockVector3 pos2 = cuboidregion.getPos2(); BlockVector3 pos2 = cuboidregion.getPos2();
int blocksChanged = editSession.drawLine(pattern, pos1, pos2, thickness, !shell); 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; return blocksChanged;
} }
@ -271,7 +271,7 @@ public class RegionCommands {
@Switch(name = 'h', desc = "Generate only a shell") @Switch(name = 'h', desc = "Generate only a shell")
boolean shell) throws WorldEditException { boolean shell) throws WorldEditException {
if (!(region instanceof ConvexPolyhedralRegion)) { if (!(region instanceof ConvexPolyhedralRegion)) {
actor.printError(TranslatableComponent.of("worldedit.curve.invalid-type")); actor.print(Caption.of("worldedit.curve.invalid-type"));
return 0; return 0;
} }
checkCommandArgument(thickness >= 0, "Thickness must be >= 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); 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; return blocksChanged;
} }
@ -305,7 +305,7 @@ public class RegionCommands {
((AbstractExtentMask) from).setExtent(editSession); ((AbstractExtentMask) from).setExtent(editSession);
} }
int affected = editSession.replaceBlocks(region, from, to); 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; return affected;
} }
@ -320,7 +320,7 @@ public class RegionCommands {
@Arg(desc = "The pattern of blocks to overlay") @Arg(desc = "The pattern of blocks to overlay")
Pattern pattern) throws WorldEditException { Pattern pattern) throws WorldEditException {
int affected = editSession.overlayCuboidBlocks(region, pattern); 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; return affected;
} }
@ -360,7 +360,7 @@ public class RegionCommands {
@Arg(desc = "The pattern of blocks to set") @Arg(desc = "The pattern of blocks to set")
Pattern pattern) throws WorldEditException { Pattern pattern) throws WorldEditException {
int affected = editSession.center(region, pattern); 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; return affected;
} }
@ -373,7 +373,7 @@ public class RegionCommands {
@Confirm(Confirm.Processor.REGION) @Confirm(Confirm.Processor.REGION)
public int naturalize(Actor actor, EditSession editSession, @Selection Region region) throws WorldEditException { public int naturalize(Actor actor, EditSession editSession, @Selection Region region) throws WorldEditException {
int affected = editSession.naturalizeCuboidBlocks(region); 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; return affected;
} }
@ -388,7 +388,7 @@ public class RegionCommands {
@Arg(desc = "The pattern of blocks to set") @Arg(desc = "The pattern of blocks to set")
Pattern pattern) throws WorldEditException { Pattern pattern) throws WorldEditException {
int affected = editSession.makeWalls(region, pattern); 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; return affected;
} }
@ -404,7 +404,7 @@ public class RegionCommands {
@Arg(desc = "The pattern of blocks to set") @Arg(desc = "The pattern of blocks to set")
Pattern pattern) throws WorldEditException { Pattern pattern) throws WorldEditException {
int affected = editSession.makeCuboidFaces(region, pattern); 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; return affected;
} }
@ -435,7 +435,7 @@ public class RegionCommands {
HeightMap heightMap = new HeightMap(editSession, region, mask, snow); HeightMap heightMap = new HeightMap(editSession, region, mask, snow);
HeightMapFilter filter = new HeightMapFilter(new GaussianKernel(5, 1.0)); HeightMapFilter filter = new HeightMapFilter(new GaussianKernel(5, 1.0));
affected = heightMap.applyFilter(filter, iterations); 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) { } catch (Throwable e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
@ -451,9 +451,9 @@ public class RegionCommands {
@CommandPermissions("fawe.admin") @CommandPermissions("fawe.admin")
public void wea(Actor actor) throws WorldEditException { public void wea(Actor actor) throws WorldEditException {
if (actor.togglePermission("fawe.bypass")) { if (actor.togglePermission("fawe.bypass")) {
actor.print(TranslatableComponent.of("fawe.info.worldedit.bypassed")); actor.print(Caption.of("fawe.info.worldedit.bypassed"));
} else { } 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; 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; return affected;
} }
@ -628,7 +628,7 @@ public class RegionCommands {
try { try {
session.setMask(null); session.setMask(null);
session.setSourceMask(null); session.setSourceMask(null);
actor.printInfo(TranslatableComponent.of("fawe.regen.time")); actor.print(Caption.of("fawe.regen.time"));
RegenOptions options = RegenOptions.builder() RegenOptions options = RegenOptions.builder()
.seed(seed) .seed(seed)
.regenBiomes(regenBiomes) .regenBiomes(regenBiomes)
@ -640,9 +640,9 @@ public class RegionCommands {
session.setSourceMask(mask); session.setSourceMask(mask);
} }
if (success) { if (success) {
actor.printInfo(TranslatableComponent.of("worldedit.regen.regenerated")); actor.print(Caption.of("worldedit.regen.regenerated"));
} else { } 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) { if (actor instanceof Player) {
((Player) actor).findFreePosition(); ((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; return affected;
} catch (ExpressionException e) { } catch (ExpressionException e) {
actor.printError(TextComponent.of(e.getMessage())); actor.printError(TextComponent.of(e.getMessage()));
@ -735,7 +735,7 @@ public class RegionCommands {
Mask finalMask = mask == null ? new SolidBlockMask(editSession) : mask; Mask finalMask = mask == null ? new SolidBlockMask(editSession) : mask;
int affected = editSession.hollowOutRegion(region, thickness, pattern, finalMask); 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; return affected;
} }
@ -753,7 +753,7 @@ public class RegionCommands {
double density) throws WorldEditException { double density) throws WorldEditException {
checkCommandArgument(0 <= density && density <= 100, "Density must be in [0, 100]"); checkCommandArgument(0 <= density && density <= 100, "Density must be in [0, 100]");
int affected = editSession.makeForest(region, density / 100, type); 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; return affected;
} }
@ -776,7 +776,7 @@ public class RegionCommands {
Operations.completeLegacy(visitor); Operations.completeLegacy(visitor);
int affected = ground.getAffected(); 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; return affected;
} }

Datei anzeigen

@ -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.component.TextComponentProducer;
import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TextComponent; 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.ClickEvent;
import com.sk89q.worldedit.util.formatting.text.event.HoverEvent; import com.sk89q.worldedit.util.formatting.text.event.HoverEvent;
import com.sk89q.worldedit.util.formatting.text.format.TextColor; import com.sk89q.worldedit.util.formatting.text.format.TextColor;
@ -176,7 +175,7 @@ public class SchematicCommands {
@CommandPermissions({"worldedit.clipboard.clear", "worldedit.schematic.clear"}) @CommandPermissions({"worldedit.clipboard.clear", "worldedit.schematic.clear"})
public void clear(Player player, LocalSession session) throws WorldEditException { public void clear(Player player, LocalSession session) throws WorldEditException {
session.setClipboard(null); session.setClipboard(null);
player.print(TranslatableComponent.of("fawe.worldedit.clipboard.clipboard.cleared")); player.print(Caption.of("fawe.worldedit.clipboard.clipboard.cleared"));
} }
@Command( @Command(
@ -208,7 +207,7 @@ public class SchematicCommands {
} else { } else {
session.setClipboard(null); session.setClipboard(null);
} }
player.print(TranslatableComponent.of("fawe.worldedit.clipboard.clipboard.cleared")); player.print(Caption.of("fawe.worldedit.clipboard.clipboard.cleared"));
return; return;
} }
} }
@ -262,7 +261,7 @@ public class SchematicCommands {
} }
file = actor.openFileOpenDialog(extensions); file = actor.openFileOpenDialog(extensions);
if (file == null || !file.exists()) { 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; return;
} }
} else { } else {
@ -291,7 +290,7 @@ public class SchematicCommands {
if (format == null) { if (format == null) {
format = ClipboardFormats.findByFile(file); format = ClipboardFormats.findByFile(file);
if (format == null) { 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; return;
} }
} }
@ -339,7 +338,7 @@ public class SchematicCommands {
ClipboardFormat format = ClipboardFormats.findByAlias(formatName); ClipboardFormat format = ClipboardFormats.findByAlias(formatName);
if (format == null) { 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; return;
} }
@ -370,7 +369,7 @@ public class SchematicCommands {
} }
} }
if (!allowOverwrite) { if (!allowOverwrite) {
actor.printError(TranslatableComponent.of("worldedit.schematic.save.already-exists")); actor.print(Caption.of("worldedit.schematic.save.already-exists"));
return; return;
} }
} }
@ -379,7 +378,7 @@ public class SchematicCommands {
File parent = f.getParentFile(); File parent = f.getParentFile();
if (parent != null && !parent.exists()) { if (parent != null && !parent.exists()) {
if (!parent.mkdirs()) { if (!parent.mkdirs()) {
throw new StopExecutionException(TranslatableComponent.of( throw new StopExecutionException(Caption.of(
"worldedit.schematic.save.failed-directory")); "worldedit.schematic.save.failed-directory"));
} }
} }
@ -389,7 +388,7 @@ public class SchematicCommands {
SchematicSaveTask task = new SchematicSaveTask(actor, f, dir, format, holder, overwrite); SchematicSaveTask task = new SchematicSaveTask(actor, f, dir, format, holder, overwrite);
AsyncCommandBuilder.wrap(task, actor) AsyncCommandBuilder.wrap(task, actor)
.registerWithSupervisor(worldEdit.getSupervisor(), "Saving schematic " + filename) .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) .onSuccess(filename + " saved" + (overwrite ? " (overwriting previous file)." : "."), null)
.onFailure("Failed to save schematic", worldEdit.getPlatformManager().getPlatformCommandManager().getExceptionConverter()) .onFailure("Failed to save schematic", worldEdit.getPlatformManager().getPlatformCommandManager().getExceptionConverter())
.buildAndExec(worldEdit.getExecutorService()); .buildAndExec(worldEdit.getExecutorService());
@ -417,7 +416,7 @@ public class SchematicCommands {
ClipboardHolder clipboard = session.getClipboard(); ClipboardHolder clipboard = session.getClipboard();
List<File> sources = getFiles(clipboard); List<File> sources = getFiles(clipboard);
if (sources.isEmpty()) { if (sources.isEmpty()) {
player.printError(TranslatableComponent.of("fawe.worldedit.schematic.schematic.none")); player.print(Caption.of("fawe.worldedit.schematic.schematic.none"));
return; return;
} }
if (!destDir.exists() && !destDir.mkdirs()) { if (!destDir.exists() && !destDir.mkdirs()) {
@ -470,7 +469,7 @@ public class SchematicCommands {
) )
@CommandPermissions("worldedit.schematic.formats") @CommandPermissions("worldedit.schematic.formats")
public void formats(Actor actor) { public void formats(Actor actor) {
actor.printInfo(TranslatableComponent.of("worldedit.schematic.formats.title")); actor.print(Caption.of("worldedit.schematic.formats.title"));
StringBuilder builder; StringBuilder builder;
boolean first = true; boolean first = true;
for (ClipboardFormat format : ClipboardFormats.getAll()) { for (ClipboardFormat format : ClipboardFormats.getAll()) {
@ -654,12 +653,12 @@ public class SchematicCommands {
} }
if (files.isEmpty()) { 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; return;
} }
for (File f : files) { for (File f : files) {
if (!MainUtil.isInSubDirectory(working, f) || !f.exists()) { 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; continue;
} }
if (Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS && !MainUtil.isInSubDirectory(dir, f) && !actor.hasPermission("worldedit.schematic.delete.other")) { 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; continue;
} }
if (!deleteFile(f)) { 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; continue;
} }
actor.print(Caption.of("worldedit.schematic.delete.deleted", filename)); actor.print(Caption.of("worldedit.schematic.delete.deleted", filename));
@ -862,7 +861,7 @@ public class SchematicCommands {
} }
LOGGER.info(actor.getName() + " saved " + file.getCanonicalPath()); LOGGER.info(actor.getName() + " saved " + file.getCanonicalPath());
} else { } else {
actor.printError(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.manual")); actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason.manual"));
} }
} }
return null; return null;

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command; package com.sk89q.worldedit.command;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.WorldEditException; 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.CommandPermissionsConditionGenerator;
import com.sk89q.worldedit.command.util.Logging; import com.sk89q.worldedit.command.util.Logging;
import com.sk89q.worldedit.entity.Player; 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.Command;
import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.CommandContainer;
import org.enginehub.piston.annotation.param.Arg; import org.enginehub.piston.annotation.param.Arg;
@ -70,7 +70,7 @@ public class ScriptingCommands {
@Arg(desc = "Arguments to the CraftScript", def = "", variable = true) @Arg(desc = "Arguments to the CraftScript", def = "", variable = true)
List<String> args) throws WorldEditException { List<String> args) throws WorldEditException {
if (!player.hasPermission("worldedit.scripting.execute." + filename)) { if (!player.hasPermission("worldedit.scripting.execute." + filename)) {
player.printError(TranslatableComponent.of("worldedit.execute.script-permissions")); player.print(Caption.of("worldedit.execute.script-permissions"));
return; return;
} }
@ -97,12 +97,12 @@ public class ScriptingCommands {
String lastScript = session.getLastScript(); String lastScript = session.getLastScript();
if (!player.hasPermission("worldedit.scripting.execute." + lastScript)) { if (!player.hasPermission("worldedit.scripting.execute." + lastScript)) {
player.printError(TranslatableComponent.of("worldedit.execute.script-permissions")); player.print(Caption.of("worldedit.execute.script-permissions"));
return; return;
} }
if (lastScript == null) { if (lastScript == null) {
player.printError(TranslatableComponent.of("worldedit.executelast.no-script")); player.print(Caption.of("worldedit.executelast.no-script"));
return; return;
} }

Datei anzeigen

@ -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.component.TextComponentProducer;
import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TextComponent; 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.ClickEvent;
import com.sk89q.worldedit.util.formatting.text.event.HoverEvent; import com.sk89q.worldedit.util.formatting.text.event.HoverEvent;
import com.sk89q.worldedit.util.formatting.text.format.TextColor; import com.sk89q.worldedit.util.formatting.text.format.TextColor;
@ -124,12 +123,12 @@ public class SelectionCommands {
} else if (actor instanceof Locatable) { } else if (actor instanceof Locatable) {
pos = ((Locatable) actor).getBlockLocation().clampY(0, world.getMaxY()); pos = ((Locatable) actor).getBlockLocation().clampY(0, world.getMaxY());
} else { } else {
actor.printError(TranslatableComponent.of("worldedit.pos.console-require-coords")); actor.print(Caption.of("worldedit.pos.console-require-coords"));
return; return;
} }
if (!session.getRegionSelector(world).selectPrimary(pos.toVector().toBlockPoint(), ActorSelectorLimits.forActor(actor))) { 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; return;
} }
@ -153,12 +152,12 @@ public class SelectionCommands {
} else if (actor instanceof Locatable) { } else if (actor instanceof Locatable) {
pos = ((Locatable) actor).getBlockLocation().clampY(0, world.getMaxY()); pos = ((Locatable) actor).getBlockLocation().clampY(0, world.getMaxY());
} else { } else {
actor.printError(TranslatableComponent.of("worldedit.pos.console-require-coords")); actor.print(Caption.of("worldedit.pos.console-require-coords"));
return; return;
} }
if (!session.getRegionSelector(world).selectSecondary(pos.toVector().toBlockPoint(), ActorSelectorLimits.forActor(actor))) { 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; return;
} }
@ -177,14 +176,14 @@ public class SelectionCommands {
if (pos != null) { if (pos != null) {
if (!session.getRegionSelector(player.getWorld()).selectPrimary(pos.toVector().toBlockPoint(), ActorSelectorLimits.forActor(player))) { 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; return;
} }
session.getRegionSelector(player.getWorld()) session.getRegionSelector(player.getWorld())
.explainPrimarySelection(player, session, pos.toBlockPoint()); .explainPrimarySelection(player, session, pos.toBlockPoint());
} else { } 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 (pos != null) {
if (!session.getRegionSelector(player.getWorld()).selectSecondary(pos.toVector().toBlockPoint(), ActorSelectorLimits.forActor(player))) { 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; return;
} }
session.getRegionSelector(player.getWorld()) session.getRegionSelector(player.getWorld())
.explainSecondarySelection(player, session, pos.toBlockPoint()); .explainSecondarySelection(player, session, pos.toBlockPoint());
} else { } 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); min = BlockVector3.at(min2D.getBlockX() * 16, 0, min2D.getBlockZ() * 16);
max = BlockVector3.at(max2D.getBlockX() * 16 + 15, world.getMaxY(), max2D.getBlockZ() * 16 + 15); 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", "worldedit.chunk.selected-multiple",
TextComponent.of(min2D.getBlockX()), TextComponent.of(min2D.getBlockX()),
TextComponent.of(min2D.getBlockZ()), TextComponent.of(min2D.getBlockZ()),
@ -261,7 +260,7 @@ public class SelectionCommands {
min = BlockVector3.at(min2D.getBlockX() * 16, 0, min2D.getBlockZ() * 16); min = BlockVector3.at(min2D.getBlockX() * 16, 0, min2D.getBlockZ() * 16);
max = min.add(15, world.getMaxY(), 15); 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()))); TextComponent.of(min2D.getBlockZ())));
} }
@ -293,16 +292,16 @@ public class SelectionCommands {
} }
ItemType itemType = ItemTypes.parse(wandId); ItemType itemType = ItemTypes.parse(wandId);
if (itemType == null) { if (itemType == null) {
player.printError(TranslatableComponent.of("worldedit.wand.invalid")); player.print(Caption.of("worldedit.wand.invalid"));
return; return;
} }
player.giveItem(new BaseItemStack(itemType, 1)); player.giveItem(new BaseItemStack(itemType, 1));
if (navWand) { if (navWand) {
session.setTool(itemType, NavigationWand.INSTANCE); session.setTool(itemType, NavigationWand.INSTANCE);
player.printInfo(TranslatableComponent.of("worldedit.wand.navwand.info")); player.print(Caption.of("worldedit.wand.navwand.info"));
} else { } else {
session.setTool(itemType, SelectionWand.INSTANCE); 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") @CommandPermissions("worldedit.wand.toggle")
public void toggleWand(Player player) { public void toggleWand(Player player) {
player.printInfo( player.printInfo(
TranslatableComponent.of( Caption.of(
"worldedit.wand.selwand.now.tool", "worldedit.wand.selwand.now.tool",
TextComponent.of("/tool none", TextColor.AQUA).clickEvent( TextComponent.of("/tool none", TextColor.AQUA).clickEvent(
ClickEvent.of(ClickEvent.Action.RUN_COMMAND, "/tool none")), ClickEvent.of(ClickEvent.Action.RUN_COMMAND, "/tool none")),
@ -357,7 +356,7 @@ public class SelectionCommands {
session.getRegionSelector(world).explainRegionAdjust(actor, session); 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) { } catch (RegionOperationException e) {
actor.printError(TextComponent.of(e.getMessage())); actor.printError(TextComponent.of(e.getMessage()));
} }
@ -386,7 +385,7 @@ public class SelectionCommands {
session.getRegionSelector(world).explainRegionAdjust(actor, session); session.getRegionSelector(world).explainRegionAdjust(actor, session);
actor.printInfo(TranslatableComponent.of("worldedit.shift.shifted")); actor.print(Caption.of("worldedit.shift.shifted"));
} catch (RegionOperationException e) { } catch (RegionOperationException e) {
actor.printError(TextComponent.of(e.getMessage())); actor.printError(TextComponent.of(e.getMessage()));
} }
@ -409,7 +408,7 @@ public class SelectionCommands {
region.expand(getChangesForEachDir(amount, onlyHorizontal, onlyVertical)); region.expand(getChangesForEachDir(amount, onlyHorizontal, onlyVertical));
session.getRegionSelector(world).learnChanges(); session.getRegionSelector(world).learnChanges();
session.getRegionSelector(world).explainRegionAdjust(actor, session); session.getRegionSelector(world).explainRegionAdjust(actor, session);
actor.printInfo(TranslatableComponent.of("worldedit.outset.outset")); actor.print(Caption.of("worldedit.outset.outset"));
} }
@Command( @Command(
@ -429,7 +428,7 @@ public class SelectionCommands {
region.contract(getChangesForEachDir(amount, onlyHorizontal, onlyVertical)); region.contract(getChangesForEachDir(amount, onlyHorizontal, onlyVertical));
session.getRegionSelector(world).learnChanges(); session.getRegionSelector(world).learnChanges();
session.getRegionSelector(world).explainRegionAdjust(actor, session); 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) { private BlockVector3[] getChangesForEachDir(int amount, boolean onlyHorizontal, boolean onlyVertical) {
@ -485,14 +484,14 @@ public class SelectionCommands {
String originStr = origin.getBlockX() + "," + origin.getBlockY() + "," + origin.getBlockZ(); String originStr = origin.getBlockX() + "," + origin.getBlockY() + "," + origin.getBlockZ();
long numBlocks = ((long) size.getBlockX() * size.getBlockY() * size.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++; index++;
} }
return; return;
} else { } else {
region = session.getSelection(world); 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()) { for (Component line : session.getRegionSelector(world).getSelectionInfoLines()) {
actor.printInfo(line); actor.printInfo(line);
@ -502,9 +501,9 @@ public class SelectionCommands {
.subtract(region.getMinimumPoint()) .subtract(region.getMinimumPoint())
.add(1, 1, 1); .add(1, 1, 1);
actor.printInfo(TranslatableComponent.of("worldedit.size.size", TextComponent.of(size.toString()))); actor.print(Caption.of("worldedit.size.size", TextComponent.of(size.toString())));
actor.printInfo(TranslatableComponent.of("worldedit.size.distance", TextComponent.of(region.getMaximumPoint().distance(region.getMinimumPoint())))); actor.print(Caption.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.blocks", TextComponent.of(region.getVolume())));
} }
@Command( @Command(
@ -516,7 +515,7 @@ public class SelectionCommands {
@Arg(desc = "The mask of blocks to match") @Arg(desc = "The mask of blocks to match")
Mask mask) throws WorldEditException { Mask mask) throws WorldEditException {
int count = editSession.countBlocks(session.getSelection(world), mask); 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; return count;
} }
@ -551,13 +550,13 @@ public class SelectionCommands {
} else { } else {
distribution = session.getLastDistribution(); distribution = session.getLastDistribution();
if (distribution == null) { if (distribution == null) {
actor.printError(TranslatableComponent.of("worldedit.distr.no-previous")); actor.print(Caption.of("worldedit.distr.no-previous"));
return; return;
} }
} }
if (distribution.isEmpty()) { // *Should* always be false if (distribution.isEmpty()) { // *Should* always be false
actor.printError(TranslatableComponent.of("worldedit.distr.no-blocks")); actor.print(Caption.of("worldedit.distr.no-blocks"));
return; return;
} }
@ -582,7 +581,7 @@ public class SelectionCommands {
if (selector == null) { if (selector == null) {
session.getRegionSelector(world).clear(); session.getRegionSelector(world).clear();
session.dispatchCUISelection(actor); session.dispatchCUISelection(actor);
actor.printInfo(TranslatableComponent.of("worldedit.select.cleared")); actor.print(Caption.of("worldedit.select.cleared"));
return; return;
} }
@ -592,54 +591,54 @@ public class SelectionCommands {
switch (selector) { switch (selector) {
case CUBOID: case CUBOID:
newSelector = new CuboidRegionSelector(oldSelector); newSelector = new CuboidRegionSelector(oldSelector);
actor.printInfo(TranslatableComponent.of("worldedit.select.cuboid.message")); actor.print(Caption.of("worldedit.select.cuboid.message"));
break; break;
case EXTEND: case EXTEND:
newSelector = new ExtendingCuboidRegionSelector(oldSelector); newSelector = new ExtendingCuboidRegionSelector(oldSelector);
actor.printInfo(TranslatableComponent.of("worldedit.select.extend.message")); actor.print(Caption.of("worldedit.select.extend.message"));
break; break;
case POLY: { case POLY: {
newSelector = new Polygonal2DRegionSelector(oldSelector); 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(); 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; break;
} }
case ELLIPSOID: case ELLIPSOID:
newSelector = new EllipsoidRegionSelector(oldSelector); newSelector = new EllipsoidRegionSelector(oldSelector);
actor.printInfo(TranslatableComponent.of("worldedit.select.ellipsoid.message")); actor.print(Caption.of("worldedit.select.ellipsoid.message"));
break; break;
case SPHERE: case SPHERE:
newSelector = new SphereRegionSelector(oldSelector); newSelector = new SphereRegionSelector(oldSelector);
actor.printInfo(TranslatableComponent.of("worldedit.select.sphere.message")); actor.print(Caption.of("worldedit.select.sphere.message"));
break; break;
case CYL: case CYL:
newSelector = new CylinderRegionSelector(oldSelector); newSelector = new CylinderRegionSelector(oldSelector);
actor.printInfo(TranslatableComponent.of("worldedit.select.cyl.message")); actor.print(Caption.of("worldedit.select.cyl.message"));
break; break;
case CONVEX: case CONVEX:
case HULL: case HULL:
case POLYHEDRON: { case POLYHEDRON: {
newSelector = new ConvexPolyhedralRegionSelector(oldSelector); 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(); 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; break;
} }
case POLYHEDRAL: case POLYHEDRAL:
newSelector = new PolyhedralRegionSelector(world); 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(); Optional<Integer> limit = ActorSelectorLimits.forActor(actor).getPolyhedronVertexLimit();
limit.ifPresent(integer -> actor.print(Caption.of("fawe.selection.sel.max", integer))); 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; break;
case FUZZY: case FUZZY:
case MAGIC: case MAGIC:
Mask maskOpt = new IdMask(world); Mask maskOpt = new IdMask(world);
//TODO Make FuzzyRegionSelector accept actors //TODO Make FuzzyRegionSelector accept actors
newSelector = new FuzzyRegionSelector((Player) actor, world, maskOpt); newSelector = new FuzzyRegionSelector((Player) actor, world, maskOpt);
actor.print(TranslatableComponent.of("fawe.selection.sel.fuzzy")); actor.print(Caption.of("fawe.selection.sel.fuzzy"));
actor.print(TranslatableComponent.of("fawe.selection.sel.list")); actor.print(Caption.of("fawe.selection.sel.list"));
break; break;
case LIST: case LIST:
default: default:
@ -648,13 +647,13 @@ public class SelectionCommands {
TextComponentProducer contents = box.getContents(); TextComponentProducer contents = box.getContents();
contents.append(SubtleFormat.wrap("Select one of the modes below:")).newline(); contents.append(SubtleFormat.wrap("Select one of the modes below:")).newline();
box.appendCommand("cuboid", TranslatableComponent.of("worldedit.select.cuboid.description"), "//sel cuboid"); box.appendCommand("cuboid", Caption.of("worldedit.select.cuboid.description"), "//sel cuboid");
box.appendCommand("extend", TranslatableComponent.of("worldedit.select.extend.description"), "//sel extend"); box.appendCommand("extend", Caption.of("worldedit.select.extend.description"), "//sel extend");
box.appendCommand("poly", TranslatableComponent.of("worldedit.select.poly.description"), "//sel poly"); box.appendCommand("poly", Caption.of("worldedit.select.poly.description"), "//sel poly");
box.appendCommand("ellipsoid", TranslatableComponent.of("worldedit.select.ellipsoid.description"), "//sel ellipsoid"); box.appendCommand("ellipsoid", Caption.of("worldedit.select.ellipsoid.description"), "//sel ellipsoid");
box.appendCommand("sphere", TranslatableComponent.of("worldedit.select.sphere.description"), "//sel sphere"); box.appendCommand("sphere", Caption.of("worldedit.select.sphere.description"), "//sel sphere");
box.appendCommand("cyl", TranslatableComponent.of("worldedit.select.cyl.description"), "//sel cyl"); box.appendCommand("cyl", Caption.of("worldedit.select.cyl.description"), "//sel cyl");
box.appendCommand("convex", TranslatableComponent.of("worldedit.select.convex.description"), "//sel convex"); box.appendCommand("convex", Caption.of("worldedit.select.convex.description"), "//sel convex");
box.appendCommand("polyhedral", "Select a hollow polyhedral", "//sel polyhedral"); box.appendCommand("polyhedral", "Select a hollow polyhedral", "//sel polyhedral");
box.appendCommand("fuzzy[=<mask>]", "Select all connected blocks (magic wand)", "//sel fuzzy[=<mask>]"); box.appendCommand("fuzzy[=<mask>]", "Select all connected blocks (magic wand)", "//sel fuzzy[=<mask>]");
@ -673,7 +672,7 @@ public class SelectionCommands {
if (found != null) { if (found != null) {
session.setDefaultRegionSelector(found); 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 { } else {
throw new RuntimeException("Something unexpected happened. Please report this."); throw new RuntimeException("Something unexpected happened. Please report this.");
} }
@ -740,7 +739,7 @@ public class SelectionCommands {
@Override @Override
public Component create(int page) throws InvalidComponentException { 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()); .append(TextComponent.newline());
return super.create(page); return super.create(page);
} }

Datei anzeigen

@ -21,6 +21,7 @@
package com.sk89q.worldedit.command; package com.sk89q.worldedit.command;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
@ -74,7 +75,7 @@ public class SnapshotCommands {
static void checkSnapshotsConfigured(LocalConfiguration localConfiguration) { static void checkSnapshotsConfigured(LocalConfiguration localConfiguration) {
if (!localConfiguration.snapshotsConfigured) { if (!localConfiguration.snapshotsConfigured) {
throw new StopExecutionException(TranslatableComponent.of( throw new StopExecutionException(Caption.of(
"worldedit.restore.not-configured" "worldedit.restore.not-configured"
)); ));
} }
@ -120,7 +121,7 @@ public class SnapshotCommands {
if (!snapshots.isEmpty()) { if (!snapshots.isEmpty()) {
actor.print(new SnapshotListBox(world.getName(), snapshots).create(page)); actor.print(new SnapshotListBox(world.getName(), snapshots).create(page));
} else { } else {
actor.printError(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.restore.none-for-specific-world", "worldedit.restore.none-for-specific-world",
TextComponent.of(world.getName()) TextComponent.of(world.getName())
)); ));
@ -169,9 +170,9 @@ public class SnapshotCommands {
session.getSnapshotExperimental().close(); session.getSnapshotExperimental().close();
} }
session.setSnapshot(null); session.setSnapshot(null);
actor.printInfo(TranslatableComponent.of("worldedit.snapshot.use.newest")); actor.print(Caption.of("worldedit.snapshot.use.newest"));
} else { } else {
actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world")); actor.print(Caption.of("worldedit.restore.none-for-world"));
} }
} else { } else {
URI uri = resolveSnapshotName(config, name); URI uri = resolveSnapshotName(config, name);
@ -181,11 +182,11 @@ public class SnapshotCommands {
session.getSnapshotExperimental().close(); session.getSnapshotExperimental().close();
} }
session.setSnapshotExperimental(snapshot.get()); session.setSnapshotExperimental(snapshot.get());
actor.printInfo(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.snapshot.use", TextComponent.of(name) "worldedit.snapshot.use", TextComponent.of(name)
)); ));
} else { } 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) { if (index < 1) {
actor.printError(TranslatableComponent.of("worldedit.snapshot.index-above-0")); actor.print(Caption.of("worldedit.snapshot.index-above-0"));
return; return;
} }
@ -218,7 +219,7 @@ public class SnapshotCommands {
.collect(toList()); .collect(toList());
} }
if (snapshots.size() < index) { if (snapshots.size() < index) {
actor.printError(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.snapshot.index-oob", "worldedit.snapshot.index-oob",
TextComponent.of(snapshots.size()) TextComponent.of(snapshots.size())
)); ));
@ -226,14 +227,14 @@ public class SnapshotCommands {
} }
Snapshot snapshot = snapshots.get(index - 1); Snapshot snapshot = snapshots.get(index - 1);
if (snapshot == null) { if (snapshot == null) {
actor.printError(TranslatableComponent.of("worldedit.restore.not-available")); actor.print(Caption.of("worldedit.restore.not-available"));
return; return;
} }
if (session.getSnapshotExperimental() != null) { if (session.getSnapshotExperimental() != null) {
session.getSnapshotExperimental().close(); session.getSnapshotExperimental().close();
} }
session.setSnapshotExperimental(snapshot); session.setSnapshotExperimental(snapshot);
actor.printInfo(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.snapshot.use", "worldedit.snapshot.use",
TextComponent.of(snapshot.getInfo().getDisplayName()) TextComponent.of(snapshot.getInfo().getDisplayName())
)); ));
@ -263,7 +264,7 @@ public class SnapshotCommands {
} }
if (snapshot == null) { if (snapshot == null) {
actor.printError(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.snapshot.none-before", "worldedit.snapshot.none-before",
TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date))) TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date)))
); );
@ -272,7 +273,7 @@ public class SnapshotCommands {
session.getSnapshotExperimental().close(); session.getSnapshotExperimental().close();
} }
session.setSnapshotExperimental(snapshot); session.setSnapshotExperimental(snapshot);
actor.printInfo(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.snapshot.use", "worldedit.snapshot.use",
TextComponent.of(snapshot.getInfo().getDisplayName()) TextComponent.of(snapshot.getInfo().getDisplayName())
)); ));
@ -302,7 +303,7 @@ public class SnapshotCommands {
.findFirst().orElse(null); .findFirst().orElse(null);
} }
if (snapshot == null) { if (snapshot == null) {
actor.printError(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.snapshot.none-after", "worldedit.snapshot.none-after",
TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date))) TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date)))
); );
@ -311,7 +312,7 @@ public class SnapshotCommands {
session.getSnapshotExperimental().close(); session.getSnapshotExperimental().close();
} }
session.setSnapshotExperimental(snapshot); session.setSnapshotExperimental(snapshot);
actor.printInfo(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.snapshot.use", "worldedit.snapshot.use",
TextComponent.of(snapshot.getInfo().getDisplayName()) TextComponent.of(snapshot.getInfo().getDisplayName())
)); ));

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command; package com.sk89q.worldedit.command;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; 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.extension.platform.Actor;
import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.formatting.text.TextComponent; 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.World;
import com.sk89q.worldedit.world.snapshot.experimental.Snapshot; import com.sk89q.worldedit.world.snapshot.experimental.Snapshot;
import com.sk89q.worldedit.world.snapshot.experimental.SnapshotRestore; import com.sk89q.worldedit.world.snapshot.experimental.SnapshotRestore;
@ -83,7 +83,7 @@ public class SnapshotUtilCommands {
URI uri = resolveSnapshotName(config, snapshotName); URI uri = resolveSnapshotName(config, snapshotName);
Optional<Snapshot> snapOpt = config.snapshotDatabase.getSnapshot(uri); Optional<Snapshot> snapOpt = config.snapshotDatabase.getSnapshot(uri);
if (!snapOpt.isPresent()) { if (!snapOpt.isPresent()) {
actor.printError(TranslatableComponent.of("worldedit.restore.not-available")); actor.print(Caption.of("worldedit.restore.not-available"));
return; return;
} }
snapshot = snapOpt.get(); snapshot = snapOpt.get();
@ -100,14 +100,14 @@ public class SnapshotUtilCommands {
} }
if (snapshot == null) { if (snapshot == null) {
actor.printError(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.restore.none-for-specific-world", "worldedit.restore.none-for-specific-world",
TextComponent.of(world.getName()) TextComponent.of(world.getName())
)); ));
return; return;
} }
} }
actor.printInfo(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.restore.loaded", "worldedit.restore.loaded",
TextComponent.of(snapshot.getInfo().getDisplayName()) TextComponent.of(snapshot.getInfo().getDisplayName())
)); ));
@ -122,15 +122,15 @@ public class SnapshotUtilCommands {
if (restore.hadTotalFailure()) { if (restore.hadTotalFailure()) {
String error = restore.getLastErrorMessage(); String error = restore.getLastErrorMessage();
if (!restore.getMissingChunks().isEmpty()) { 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) { } else if (error != null) {
actor.printError(TranslatableComponent.of("worldedit.restore.block-place-failed")); actor.print(Caption.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-error", TextComponent.of(error)));
} else { } else {
actor.printError(TranslatableComponent.of("worldedit.restore.chunk-load-failed")); actor.print(Caption.of("worldedit.restore.chunk-load-failed"));
} }
} else { } else {
actor.printInfo(TranslatableComponent.of("worldedit.restore.restored", actor.print(Caption.of("worldedit.restore.restored",
TextComponent.of(restore.getMissingChunks().size()), TextComponent.of(restore.getMissingChunks().size()),
TextComponent.of(restore.getErrorChunks().size()))); TextComponent.of(restore.getErrorChunks().size())));
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command; package com.sk89q.worldedit.command;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
@ -51,7 +52,7 @@ public class SuperPickaxeCommands {
public void single(Player player, LocalSession session) throws WorldEditException { public void single(Player player, LocalSession session) throws WorldEditException {
session.setSuperPickaxe(new SinglePickaxe()); session.setSuperPickaxe(new SinglePickaxe());
session.enableSuperPickAxe(); session.enableSuperPickAxe();
player.printInfo(TranslatableComponent.of("worldedit.tool.superpickaxe.mode.single")); player.print(Caption.of("worldedit.tool.superpickaxe.mode.single"));
} }
@Command( @Command(
@ -66,12 +67,12 @@ public class SuperPickaxeCommands {
LocalConfiguration config = we.getConfiguration(); LocalConfiguration config = we.getConfiguration();
if (range > config.maxSuperPickaxeSize) { 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; return;
} }
session.setSuperPickaxe(new AreaPickaxe(range)); session.setSuperPickaxe(new AreaPickaxe(range));
session.enableSuperPickAxe(); session.enableSuperPickAxe();
player.printInfo(TranslatableComponent.of("worldedit.tool.superpickaxe.mode.area")); player.print(Caption.of("worldedit.tool.superpickaxe.mode.area"));
} }
@Command( @Command(
@ -87,12 +88,12 @@ public class SuperPickaxeCommands {
LocalConfiguration config = we.getConfiguration(); LocalConfiguration config = we.getConfiguration();
if (range > config.maxSuperPickaxeSize) { 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; return;
} }
session.setSuperPickaxe(new RecursivePickaxe(range)); session.setSuperPickaxe(new RecursivePickaxe(range));
session.enableSuperPickAxe(); session.enableSuperPickAxe();
player.printInfo(TranslatableComponent.of("worldedit.tool.superpickaxe.mode.recursive")); player.print(Caption.of("worldedit.tool.superpickaxe.mode.recursive"));
} }
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command; package com.sk89q.worldedit.command;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.brush.InspectBrush; import com.boydti.fawe.object.brush.InspectBrush;
import com.google.common.collect.Collections2; import com.google.common.collect.Collections2;
import com.sk89q.worldedit.LocalConfiguration; 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.TreeGenerator;
import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TextComponent; 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.ClickEvent;
import com.sk89q.worldedit.util.formatting.text.format.TextColor; import com.sk89q.worldedit.util.formatting.text.format.TextColor;
import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockStateHolder;
@ -120,7 +120,7 @@ public class ToolCommands {
.collect(Collectors.toSet()); .collect(Collectors.toSet());
commandManager.register("tool", command -> { commandManager.register("tool", command -> {
command.addPart(SubCommandPart.builder( command.addPart(SubCommandPart.builder(
TranslatableComponent.of("tool"), Caption.of("tool"),
TextComponent.of("The tool to bind") TextComponent.of("The tool to bind")
) )
.withCommands(nonGlobalCommands) .withCommands(nonGlobalCommands)
@ -145,18 +145,18 @@ public class ToolCommands {
throws InvalidToolBindException { throws InvalidToolBindException {
isBrush = session.getTool(player) instanceof BrushTool; isBrush = session.getTool(player) instanceof BrushTool;
session.setTool(player.getItemInHand(HandSide.MAIN_HAND).getType(), null); 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) { 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, private static void setTool(Player player, LocalSession session, Tool tool,
String translationKey) throws InvalidToolBindException { String translationKey) throws InvalidToolBindException {
BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND);
session.setTool(itemStack.getType(), tool); session.setTool(itemStack.getType(), tool);
player.printInfo(TranslatableComponent.of(translationKey, itemStack.getRichName())); player.print(Caption.of(translationKey, itemStack.getRichName()));
sendUnbindInstruction(player, UNBIND_COMMAND_COMPONENT); sendUnbindInstruction(player, UNBIND_COMMAND_COMPONENT);
} }
@ -278,7 +278,7 @@ public class ToolCommands {
LocalConfiguration config = we.getConfiguration(); LocalConfiguration config = we.getConfiguration();
if (range > config.maxSuperPickaxeSize) { 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; return;
} }
setTool(player, session, new FloodFillTool(range, pattern), "worldedit.tool.floodfill.equip"); setTool(player, session, new FloodFillTool(range, pattern), "worldedit.tool.floodfill.equip");
@ -328,6 +328,6 @@ public class ToolCommands {
} else { } else {
secondaryName = TextComponent.of("pattern"); secondaryName = TextComponent.of("pattern");
} }
player.printInfo(TranslatableComponent.of("worldedit.tool.lrbuild.set", primaryName, secondaryName)); player.print(Caption.of("worldedit.tool.lrbuild.set", primaryName, secondaryName));
} }
} }

Datei anzeigen

@ -43,7 +43,6 @@ import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.internal.command.CommandArgParser; import com.sk89q.worldedit.internal.command.CommandArgParser;
import com.sk89q.worldedit.util.HandSide; 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.Command;
import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.CommandContainer;
import org.enginehub.piston.annotation.param.Arg; import org.enginehub.piston.annotation.param.Arg;
@ -77,11 +76,11 @@ public class ToolUtilCommands {
Mask maskOpt, Arguments arguments) throws WorldEditException { Mask maskOpt, Arguments arguments) throws WorldEditException {
BrushTool tool = session.getBrushTool(player, false); BrushTool tool = session.getBrushTool(player, false);
if (tool == null) { if (tool == null) {
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none")); player.print(Caption.of("fawe.worldedit.brush.brush.none"));
return; return;
} }
if (maskOpt == null) { if (maskOpt == null) {
player.printInfo(TranslatableComponent.of("worldedit.tool.mask.disabled")); player.print(Caption.of("worldedit.tool.mask.disabled"));
tool.setMask(null); tool.setMask(null);
} else { } else {
BrushSettings settings = offHand ? tool.getOffHand() : tool.getContext(); BrushSettings settings = offHand ? tool.getOffHand() : tool.getContext();
@ -90,7 +89,7 @@ public class ToolUtilCommands {
settings.addSetting(BrushSettings.SettingType.MASK, lastArg); settings.addSetting(BrushSettings.SettingType.MASK, lastArg);
settings.setMask(maskOpt); settings.setMask(maskOpt);
tool.update(); 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 { boolean offHand, Arguments arguments) throws WorldEditException {
BrushTool tool = session.getBrushTool(player, false); BrushTool tool = session.getBrushTool(player, false);
if (tool == null) { if (tool == null) {
player.printInfo(TranslatableComponent.of("fawe.worldedit.brush.brush.none")); player.print(Caption.of("fawe.worldedit.brush.brush.none"));
return; return;
} }
if (pattern == null) { if (pattern == null) {
@ -119,7 +118,7 @@ public class ToolUtilCommands {
settings.addSetting(BrushSettings.SettingType.FILL, lastArg); settings.addSetting(BrushSettings.SettingType.FILL, lastArg);
tool.update(); tool.update();
} }
player.printInfo(TranslatableComponent.of("worldedit.tool.material.set")); player.print(Caption.of("worldedit.tool.material.set"));
} }
@Command( @Command(
@ -132,7 +131,7 @@ public class ToolUtilCommands {
@Arg(desc = "The range of the brush") @Arg(desc = "The range of the brush")
int range) throws WorldEditException { int range) throws WorldEditException {
session.getBrushTool(player, false).setRange(range); session.getBrushTool(player, false).setRange(range);
player.printInfo(TranslatableComponent.of("worldedit.tool.range.set")); player.print(Caption.of("worldedit.tool.range.set"));
} }
@Command( @Command(
@ -146,7 +145,7 @@ public class ToolUtilCommands {
we.checkMaxBrushRadius(size); we.checkMaxBrushRadius(size);
session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()).setSize(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( @Command(
@ -160,9 +159,9 @@ public class ToolUtilCommands {
Mask maskOpt) throws WorldEditException { Mask maskOpt) throws WorldEditException {
session.getBrushTool(player, false).setTraceMask(maskOpt); session.getBrushTool(player, false).setTraceMask(maskOpt);
if (maskOpt == null) { if (maskOpt == null) {
player.printInfo(TranslatableComponent.of("worldedit.tool.tracemask.disabled")); player.print(Caption.of("worldedit.tool.tracemask.disabled"));
} else { } 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 superPickaxe) {
boolean hasSuperPickAxe = session.hasSuperPickAxe(); boolean hasSuperPickAxe = session.hasSuperPickAxe();
if (superPickaxe != null && superPickaxe == 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; return;
} }
if (hasSuperPickAxe) { if (hasSuperPickAxe) {
session.disableSuperPickAxe(); session.disableSuperPickAxe();
player.printInfo(TranslatableComponent.of("worldedit.tool.superpickaxe.disabled")); player.print(Caption.of("worldedit.tool.superpickaxe.disabled"));
} else { } else {
session.enableSuperPickAxe(); 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 { int mode) throws WorldEditException {
BrushTool tool = session.getBrushTool(player, false); BrushTool tool = session.getBrushTool(player, false);
if (tool == null) { if (tool == null) {
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none")); player.print(Caption.of("fawe.worldedit.brush.brush.none"));
return; return;
} }
VisualMode[] modes = VisualMode.values(); VisualMode[] modes = VisualMode.values();
@ -268,7 +267,7 @@ public class ToolUtilCommands {
int mode) throws WorldEditException { int mode) throws WorldEditException {
BrushTool tool = session.getBrushTool(player, false); BrushTool tool = session.getBrushTool(player, false);
if (tool == null) { if (tool == null) {
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none")); player.print(Caption.of("fawe.worldedit.brush.brush.none"));
return; return;
} }
TargetMode[] modes = TargetMode.values(); TargetMode[] modes = TargetMode.values();
@ -287,7 +286,7 @@ public class ToolUtilCommands {
@Arg(name = "offset", desc = "offset", def = "0") int offset) throws WorldEditException { @Arg(name = "offset", desc = "offset", def = "0") int offset) throws WorldEditException {
BrushTool tool = session.getBrushTool(player, false); BrushTool tool = session.getBrushTool(player, false);
if (tool == null) { if (tool == null) {
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none")); player.print(Caption.of("fawe.worldedit.brush.brush.none"));
return; return;
} }
tool.setTargetOffset(offset); tool.setTargetOffset(offset);
@ -308,7 +307,7 @@ public class ToolUtilCommands {
List<String> commandStr) throws WorldEditException { List<String> commandStr) throws WorldEditException {
BrushTool bt = session.getBrushTool(player, false); BrushTool bt = session.getBrushTool(player, false);
if (bt == null) { if (bt == null) {
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none")); player.print(Caption.of("fawe.worldedit.brush.brush.none"));
return; return;
} }
@ -316,7 +315,7 @@ public class ToolUtilCommands {
Scroll action = Scroll.fromArguments(bt, player, session, mode, commandStr, true); Scroll action = Scroll.fromArguments(bt, player, session, mode, commandStr, true);
settings.setScrollAction(action); settings.setScrollAction(action);
if (mode == Scroll.Action.NONE) { 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) { } else if (action != null) {
String full = (mode.name().toLowerCase(Locale.ROOT) + " " + StringMan.join(commandStr, " ")).trim(); String full = (mode.name().toLowerCase(Locale.ROOT) + " " + StringMan.join(commandStr, " ")).trim();
settings.addSetting(BrushSettings.SettingType.SCROLL_ACTION, full); settings.addSetting(BrushSettings.SettingType.SCROLL_ACTION, full);
@ -342,11 +341,11 @@ public class ToolUtilCommands {
Arguments arguments) throws WorldEditException { Arguments arguments) throws WorldEditException {
BrushTool tool = session.getBrushTool(player, false); BrushTool tool = session.getBrushTool(player, false);
if (tool == null) { if (tool == null) {
player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none")); player.print(Caption.of("fawe.worldedit.brush.brush.none"));
return; return;
} }
if (maskArg == null) { 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); tool.setSourceMask(null);
return; return;
} }
@ -355,7 +354,7 @@ public class ToolUtilCommands {
settings.addSetting(BrushSettings.SettingType.SOURCE_MASK, lastArg); settings.addSetting(BrushSettings.SettingType.SOURCE_MASK, lastArg);
settings.setSourceMask(maskArg); settings.setSourceMask(maskArg);
tool.update(); 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 // TODO: Ping @MattBDev to reimplement 2020-02-04

Datei anzeigen

@ -67,7 +67,6 @@ import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.formatting.component.SubtleFormat; import com.sk89q.worldedit.util.formatting.component.SubtleFormat;
import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TextComponent; 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.TextColor;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.block.BlockTypes;
@ -217,7 +216,7 @@ public class UtilityCommands {
BlockVector3 pos = session.getPlacementPosition(actor); BlockVector3 pos = session.getPlacementPosition(actor);
int affected = editSession.fillDirection(pos, pattern, radius, depth, direction); 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; return affected;
} }
@ -315,7 +314,7 @@ public class UtilityCommands {
BlockVector3 pos = session.getPlacementPosition(actor); BlockVector3 pos = session.getPlacementPosition(actor);
int affected = editSession.fillXZ(pos, pattern, radius, depth, true); 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; return affected;
} }
@ -336,7 +335,7 @@ public class UtilityCommands {
radius = Math.max(0, radius); radius = Math.max(0, radius);
we.checkMaxRadius(radius); we.checkMaxRadius(radius);
int affected = editSession.drainArea(session.getPlacementPosition(actor), radius, waterlogged, plants); 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; return affected;
} }
@ -353,7 +352,7 @@ public class UtilityCommands {
radius = Math.max(0, radius); radius = Math.max(0, radius);
we.checkMaxRadius(radius); we.checkMaxRadius(radius);
int affected = editSession.fixLiquid(session.getPlacementPosition(actor), radius, BlockTypes.LAVA); 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; return affected;
} }
@ -370,7 +369,7 @@ public class UtilityCommands {
radius = Math.max(0, radius); radius = Math.max(0, radius);
we.checkMaxRadius(radius); we.checkMaxRadius(radius);
int affected = editSession.fixLiquid(session.getPlacementPosition(actor), radius, BlockTypes.WATER); 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; return affected;
} }
@ -391,7 +390,7 @@ public class UtilityCommands {
height = height != null ? Math.min((world.getMaxY() + 1), height + 1) : (world.getMaxY() + 1); height = height != null ? Math.min((world.getMaxY() + 1), height + 1) : (world.getMaxY() + 1);
int affected = editSession.removeAbove(session.getPlacementPosition(actor), size, height); 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; return affected;
} }
@ -412,7 +411,7 @@ public class UtilityCommands {
height = height != null ? Math.min((world.getMaxY() + 1), height + 1) : (world.getMaxY() + 1); height = height != null ? Math.min((world.getMaxY() + 1), height + 1) : (world.getMaxY() + 1);
int affected = editSession.removeBelow(session.getPlacementPosition(actor), size, height); 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; return affected;
} }
@ -432,7 +431,7 @@ public class UtilityCommands {
we.checkMaxRadius(radius); we.checkMaxRadius(radius);
int affected = editSession.removeNear(session.getPlacementPosition(actor), mask, 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; return affected;
} }
@ -463,7 +462,7 @@ public class UtilityCommands {
} }
int affected = editSession.replaceBlocks(region, from, to); 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; return affected;
} }
@ -494,7 +493,7 @@ public class UtilityCommands {
CylinderRegion region = new CylinderRegion(position, Vector2.at(size, size), position.getBlockY() - height, position.getBlockY() + height); CylinderRegion region = new CylinderRegion(position, Vector2.at(size, size), position.getBlockY() - height, position.getBlockY() + height);
int affected = editSession.simulateSnow(region, stack); int affected = editSession.simulateSnow(region, stack);
actor.printInfo(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.snow.created", TextComponent.of(affected) "worldedit.snow.created", TextComponent.of(affected)
)); ));
return affected; return affected;
@ -521,7 +520,7 @@ public class UtilityCommands {
we.checkMaxRadius(size); we.checkMaxRadius(size);
int affected = editSession.thaw(session.getPlacementPosition(actor), size, height); int affected = editSession.thaw(session.getPlacementPosition(actor), size, height);
actor.printInfo(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.thaw.removed", TextComponent.of(affected) "worldedit.thaw.removed", TextComponent.of(affected)
)); ));
return affected; return affected;
@ -553,7 +552,7 @@ public class UtilityCommands {
final int affected = editSession.green( final int affected = editSession.green(
session.getPlacementPosition(actor), size, height, onlyNormalDirt session.getPlacementPosition(actor), size, height, onlyNormalDirt
); );
actor.printInfo(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.green.changed", TextComponent.of(affected) "worldedit.green.changed", TextComponent.of(affected)
)); ));
return affected; return affected;
@ -578,7 +577,7 @@ public class UtilityCommands {
Mask mask = new BlockTypeMask(editSession, BlockTypes.FIRE); Mask mask = new BlockTypeMask(editSession, BlockTypes.FIRE);
int affected = editSession.removeNear(session.getPlacementPosition(actor), mask, size); 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; return affected;
} }
@ -615,7 +614,7 @@ public class UtilityCommands {
if (radius == null) { if (radius == null) {
radius = config.butcherDefaultRadius; radius = config.butcherDefaultRadius;
} else if (radius < -1) { } else if (radius < -1) {
actor.printError(TranslatableComponent.of("worldedit.butcher.explain-all")); actor.print(Caption.of("worldedit.butcher.explain-all"));
return 0; return 0;
} else if (radius == -1) { } else if (radius == -1) {
if (config.butcherMaxRadius != -1) { if (config.butcherMaxRadius != -1) {
@ -639,7 +638,7 @@ public class UtilityCommands {
int killed = killMatchingEntities(radius, actor, flags::createFunction); int killed = killMatchingEntities(radius, actor, flags::createFunction);
actor.printInfo(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.butcher.killed", "worldedit.butcher.killed",
TextComponent.of(killed), TextComponent.of(killed),
TextComponent.of(radius) TextComponent.of(radius)
@ -661,12 +660,12 @@ public class UtilityCommands {
@Arg(desc = "The radius of the cuboid to remove from") @Arg(desc = "The radius of the cuboid to remove from")
int radius) throws WorldEditException { int radius) throws WorldEditException {
if (radius < -1) { if (radius < -1) {
actor.printError(TranslatableComponent.of("worldedit.remove.explain-all")); actor.print(Caption.of("worldedit.remove.explain-all"));
return 0; return 0;
} }
int removed = killMatchingEntities(radius, actor, remover::createFunction); 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; return removed;
} }
@ -716,7 +715,7 @@ public class UtilityCommands {
try { try {
expression = Expression.compile(String.join(" ", input)); expression = Expression.compile(String.join(" ", input));
} catch (ExpressionException e) { } catch (ExpressionException e) {
actor.printError(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.calc.invalid.with-error", "worldedit.calc.invalid.with-error",
TextComponent.of(String.join(" ", input)), TextComponent.of(String.join(" ", input)),
TextComponent.of(e.getMessage()) TextComponent.of(e.getMessage())
@ -755,7 +754,7 @@ public class UtilityCommands {
@CommandPermissions(value = "fawe.confirm", queued = false) @CommandPermissions(value = "fawe.confirm", queued = false)
public void confirm(Player player) throws WorldEditException { public void confirm(Player player) throws WorldEditException {
if (!player.confirm()) { 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); getFiles(dir, actor, args, formatName, playerFolder, fileList::add);
if (fileList.isEmpty()) { if (fileList.isEmpty()) {
actor.print(TranslatableComponent.of("fawe.worldedit.schematic.schematic.none")); actor.print(Caption.of("fawe.worldedit.schematic.schematic.none"));
return Collections.emptyList(); return Collections.emptyList();
} }

Datei anzeigen

@ -21,6 +21,7 @@ package com.sk89q.worldedit.command;
import com.boydti.fawe.Fawe; import com.boydti.fawe.Fawe;
import com.boydti.fawe.FaweVersion; import com.boydti.fawe.FaweVersion;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.config.Settings; import com.boydti.fawe.config.Settings;
import com.intellectualsites.paster.IncendoPaster; import com.intellectualsites.paster.IncendoPaster;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
@ -92,7 +93,7 @@ public class WorldEditCommands {
TextComponent buildArg = TextComponent.of(version.build); TextComponent buildArg = TextComponent.of(version.build);
TextComponent platformArg = TextComponent.of(Settings.IMP.PLATFORM); 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")); 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.getPlatformManager().queryCapability(Capability.CONFIGURATION).reload();
we.getEventBus().post(new ConfigurationLoadEvent(we.getPlatformManager().queryCapability(Capability.CONFIGURATION).getConfiguration())); we.getEventBus().post(new ConfigurationLoadEvent(we.getPlatformManager().queryCapability(Capability.CONFIGURATION).getConfiguration()));
Fawe.get().setupConfigs(); Fawe.get().setupConfigs();
actor.printInfo(TranslatableComponent.of("worldedit.reload.config")); actor.print(Caption.of("worldedit.reload.config"));
} }
@Command( @Command(
@ -151,7 +152,7 @@ public class WorldEditCommands {
actor.printInfo(TextComponent.of(e.getMessage())); actor.printInfo(TextComponent.of(e.getMessage()));
return; 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)))); ClickEvent.openUrl(dest))));
} }
@ -164,7 +165,7 @@ public class WorldEditCommands {
Map<Thread, StackTraceElement[]> stacks = Thread.getAllStackTraces(); Map<Thread, StackTraceElement[]> stacks = Thread.getAllStackTraces();
for (Map.Entry<Thread, StackTraceElement[]> entry : stacks.entrySet()) { for (Map.Entry<Thread, StackTraceElement[]> entry : stacks.entrySet()) {
Thread thread = entry.getKey(); Thread thread = entry.getKey();
actor.printDebug(TranslatableComponent.of( actor.printDebug(TextComponent.of(
"--------------------------------------------------------------------------------------------")); "--------------------------------------------------------------------------------------------"));
actor.printDebug("Thread: " + thread.getName() + " | Id: " + thread.getId() + " | Alive: " + thread.isAlive()); actor.printDebug("Thread: " + thread.getName() + " | Id: " + thread.getId() + " | Alive: " + thread.isAlive());
for (StackTraceElement elem : entry.getValue()) { for (StackTraceElement elem : entry.getValue()) {
@ -194,13 +195,13 @@ public class WorldEditCommands {
try { try {
ZoneId tz = ZoneId.of(timezone); ZoneId tz = ZoneId.of(timezone);
session.setTimezone(tz); 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() 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))))); TextComponent.of(dateFormat.withLocale(actor.getLocale()).format(ZonedDateTime.now(tz)))));
} catch (ZoneRulesException e) { } catch (ZoneRulesException e) {
actor.printError(TranslatableComponent.of("worldedit.timezone.invalid")); actor.print(Caption.of("worldedit.timezone.invalid"));
} }
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command.tool; package com.sk89q.worldedit.command.tool;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
@ -80,7 +81,7 @@ public class AreaPickaxe implements BlockTool {
} }
editSession.flushQueue(); editSession.flushQueue();
} catch (MaxChangedBlocksException e) { } catch (MaxChangedBlocksException e) {
player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes")); player.print(Caption.of("worldedit.tool.max-block-changes"));
} finally { } finally {
session.remember(editSession); session.remember(editSession);
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command.tool; package com.sk89q.worldedit.command.tool;
import com.boydti.fawe.config.Caption;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
@ -65,12 +66,12 @@ public class BlockDataCyler implements DoubleActionBlockTool {
if (!config.allowedDataCycleBlocks.isEmpty() if (!config.allowedDataCycleBlocks.isEmpty()
&& !player.hasPermission("worldedit.override.data-cycler") && !player.hasPermission("worldedit.override.data-cycler")
&& !config.allowedDataCycleBlocks.contains(block.getBlockType().getId())) { && !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; return true;
} }
if (block.getStates().keySet().isEmpty()) { 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 { } else {
Property<?> currentProperty = selectedProperties.get(player.getUniqueId()); Property<?> currentProperty = selectedProperties.get(player.getUniqueId());
@ -92,13 +93,13 @@ public class BlockDataCyler implements DoubleActionBlockTool {
try { try {
editSession.setBlock(blockPoint, newBlock); editSession.setBlock(blockPoint, newBlock);
player.printInfo(TranslatableComponent.of( player.print(Caption.of(
"worldedit.tool.data-cycler.new-value", "worldedit.tool.data-cycler.new-value",
TextComponent.of(currentProperty.getName()), TextComponent.of(currentProperty.getName()),
TextComponent.of(String.valueOf(currentProperty.getValues().get(index))) TextComponent.of(String.valueOf(currentProperty.getValues().get(index)))
)); ));
} catch (MaxChangedBlocksException e) { } catch (MaxChangedBlocksException e) {
player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes")); player.print(Caption.of("worldedit.tool.max-block-changes"));
} finally { } finally {
session.remember(editSession); session.remember(editSession);
} }
@ -109,7 +110,7 @@ public class BlockDataCyler implements DoubleActionBlockTool {
index = (index + 1) % properties.size(); index = (index + 1) % properties.size();
currentProperty = properties.get(index); currentProperty = properties.get(index);
selectedProperties.put(player.getUniqueId(), currentProperty); 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())));
} }
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command.tool; package com.sk89q.worldedit.command.tool;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
@ -78,7 +79,7 @@ public class BlockReplacer implements DoubleActionBlockTool {
if (targetBlock != null) { if (targetBlock != null) {
pattern = targetBlock; 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; return true;

Datei anzeigen

@ -446,7 +446,7 @@ public class BrushTool
if (target == null) { if (target == null) {
editSession.cancel(); editSession.cancel();
player.printError(TranslatableComponent.of("worldedit.tool.no-block")); player.print(Caption.of("worldedit.tool.no-block"));
return true; return true;
} }
BlockBag bag = session.getBlockBag(player); BlockBag bag = session.getBlockBag(player);
@ -481,7 +481,7 @@ public class BrushTool
WorldEdit.getInstance().checkMaxBrushRadius(size); WorldEdit.getInstance().checkMaxBrushRadius(size);
brush.build(editSession, target.toBlockPoint(), current.getMaterial(), size); brush.build(editSession, target.toBlockPoint(), current.getMaterial(), size);
} catch (MaxChangedBlocksException e) { } catch (MaxChangedBlocksException e) {
player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes")); player.print(Caption.of("worldedit.tool.max-block-changes"));
} finally { } finally {
session.remember(editSession); session.remember(editSession);
if (bag != null) { if (bag != null) {

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command.tool; package com.sk89q.worldedit.command.tool;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.entity.Player;
@ -79,7 +80,7 @@ public class DistanceWand extends BrushTool implements DoubleActionTraceTool {
} }
if (target == null) { if (target == null) {
player.printError(TranslatableComponent.of("worldedit.tool.no-block")); player.print(Caption.of("worldedit.tool.no-block"));
return null; return null;
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command.tool; package com.sk89q.worldedit.command.tool;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.collection.LocalBlockVectorSet; import com.boydti.fawe.object.collection.LocalBlockVectorSet;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
@ -75,7 +76,7 @@ public class FloatingTreeRemover implements BlockTool {
final BlockState state = world.getBlock(clicked.toVector().toBlockPoint()); final BlockState state = world.getBlock(clicked.toVector().toBlockPoint());
if (!isTreeBlock(state.getBlockType())) { if (!isTreeBlock(state.getBlockType())) {
player.printError(TranslatableComponent.of("worldedit.tool.deltree.not-tree")); player.print(Caption.of("worldedit.tool.deltree.not-tree"));
return true; return true;
} }
@ -83,7 +84,7 @@ public class FloatingTreeRemover implements BlockTool {
try { try {
final Set<BlockVector3> blockSet = bfs(world, clicked.toVector().toBlockPoint()); final Set<BlockVector3> blockSet = bfs(world, clicked.toVector().toBlockPoint());
if (blockSet == null) { if (blockSet == null) {
player.printError(TranslatableComponent.of("worldedit.tool.deltree.not-floating")); player.print(Caption.of("worldedit.tool.deltree.not-floating"));
return true; return true;
} }
@ -94,7 +95,7 @@ public class FloatingTreeRemover implements BlockTool {
} }
} }
} catch (MaxChangedBlocksException e) { } catch (MaxChangedBlocksException e) {
player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes")); player.print(Caption.of("worldedit.tool.max-block-changes"));
} finally { } finally {
session.remember(editSession); session.remember(editSession);
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command.tool; package com.sk89q.worldedit.command.tool;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
@ -83,7 +84,7 @@ public class FloodFillTool implements BlockTool {
visitor.visit(origin); visitor.visit(origin);
Operations.completeLegacy(visitor); Operations.completeLegacy(visitor);
} catch (MaxChangedBlocksException e) { } catch (MaxChangedBlocksException e) {
player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes")); player.print(Caption.of("worldedit.tool.max-block-changes"));
} finally { } finally {
session.remember(editSession); session.remember(editSession);
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command.tool; package com.sk89q.worldedit.command.tool;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
@ -121,7 +122,7 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo
} }
if (target == null) { if (target == null) {
player.printError(TranslatableComponent.of("worldedit.tool.no-block")); player.print(Caption.of("worldedit.tool.no-block"));
return null; return null;
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command.tool; package com.sk89q.worldedit.command.tool;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.entity.Player;
@ -43,7 +44,7 @@ public enum NavigationWand implements DoubleActionTraceTool {
if (pos != null) { if (pos != null) {
player.findFreePosition(pos); player.findFreePosition(pos);
} else { } else {
player.printError(TranslatableComponent.of("worldedit.jumpto.none")); player.print(Caption.of("worldedit.jumpto.none"));
} }
return true; return true;
} }
@ -59,7 +60,7 @@ public enum NavigationWand implements DoubleActionTraceTool {
} }
if (!player.passThroughForwardWall(Math.max(1, maxDist - 10))) { if (!player.passThroughForwardWall(Math.max(1, maxDist - 10))) {
player.printError(TranslatableComponent.of("worldedit.thru.obstructed")); player.print(Caption.of("worldedit.thru.obstructed"));
} }
return true; return true;
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command.tool; package com.sk89q.worldedit.command.tool;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; 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(TextComponent.of("@" + clicked.toVector().toBlockPoint() + ": ", TextColor.BLUE));
builder.append(block.getBlockType().getRichName().color(TextColor.YELLOW)); builder.append(block.getBlockType().getRichName().color(TextColor.YELLOW));
builder.append(TextComponent.of(" (" + block + ") ", TextColor.GRAY) 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()); final int internalId = BlockStateIdAccess.getBlockStateId(block.toImmutableState());
if (BlockStateIdAccess.isValidInternalId(internalId)) { if (BlockStateIdAccess.isValidInternalId(internalId)) {
builder.append(TextComponent.of(" (" + internalId + ") ", TextColor.DARK_GRAY) 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()); final int[] legacy = LegacyMapper.getInstance().getLegacyFromBlock(block.toImmutableState());
if (legacy != null) { if (legacy != null) {
builder.append(TextComponent.of(" (" + legacy[0] + ":" + legacy[1] + ") ", TextColor.DARK_GRAY) 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) + "/" builder.append(TextComponent.of(" (" + world.getBlockLightLevel(blockPoint) + "/"
+ world.getBlockLightLevel(blockPoint.add(0, 1, 0)) + ")", TextColor.WHITE) + 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()); player.print(builder.build());

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command.tool; package com.sk89q.worldedit.command.tool;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
@ -57,7 +58,7 @@ public class SinglePickaxe implements BlockTool {
editSession.setBlock(blockPoint, BlockTypes.AIR.getDefaultState()); editSession.setBlock(blockPoint, BlockTypes.AIR.getDefaultState());
session.remember(editSession); session.remember(editSession);
} catch (MaxChangedBlocksException e) { } catch (MaxChangedBlocksException e) {
player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes")); player.print(Caption.of("worldedit.tool.max-block-changes"));
} }
return true; return true;

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command.tool; package com.sk89q.worldedit.command.tool;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalConfiguration;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
@ -63,10 +64,10 @@ public class TreePlanter implements BlockTool {
} }
if (!successful) { if (!successful) {
player.printError(TranslatableComponent.of("worldedit.tool.tree.obstructed")); player.print(Caption.of("worldedit.tool.tree.obstructed"));
} }
} catch (MaxChangedBlocksException e) { } catch (MaxChangedBlocksException e) {
player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes")); player.print(Caption.of("worldedit.tool.max-block-changes"));
} finally { } finally {
session.remember(editSession); session.remember(editSession);
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.command.util; package com.sk89q.worldedit.command.util;
import com.boydti.fawe.config.Caption;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
@ -79,7 +80,7 @@ public class PrintCommandHelp {
List<Command> visited = new ArrayList<>(); List<Command> visited = new ArrayList<>();
Command currentCommand = detectCommand(manager, commandPath.get(0)); Command currentCommand = detectCommand(manager, commandPath.get(0));
if (currentCommand == null) { 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; return;
} }
visited.add(currentCommand); visited.add(currentCommand);
@ -90,7 +91,7 @@ public class PrintCommandHelp {
Map<String, Command> subCommands = getSubCommands(currentCommand); Map<String, Command> subCommands = getSubCommands(currentCommand);
if (subCommands.isEmpty()) { 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))); TextComponent.of(toCommandString(visited)), TextComponent.of(subCommand)));
// full help for single command // full help for single command
CommandUsageBox box = new CommandUsageBox(visited, visited.stream() CommandUsageBox box = new CommandUsageBox(visited, visited.stream()
@ -103,7 +104,7 @@ public class PrintCommandHelp {
currentCommand = subCommands.get(subCommand); currentCommand = subCommands.get(subCommand);
visited.add(currentCommand); visited.add(currentCommand);
} else { } 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)))); TextComponent.of(subCommand), TextComponent.of(toCommandString(visited))));
// list subcommands for currentCommand // list subcommands for currentCommand
printCommands(page, getSubCommands(Iterables.getLast(visited)).values().stream(), actor, visited, helpRootCommand); printCommands(page, getSubCommands(Iterables.getLast(visited)).values().stream(), actor, visited, helpRootCommand);

Datei anzeigen

@ -14,7 +14,6 @@ import com.sk89q.worldedit.internal.util.Substring;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.formatting.text.TextComponent; 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.exception.StopExecutionException;
import org.enginehub.piston.inject.InjectAnnotation; import org.enginehub.piston.inject.InjectAnnotation;
import org.enginehub.piston.inject.InjectedValueAccess; import org.enginehub.piston.inject.InjectedValueAccess;
@ -102,7 +101,7 @@ public @interface Confirm {
if (checkExisting(context)) { if (checkExisting(context)) {
return true; 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); return confirm(actor, context);
} }
}; };

Datei anzeigen

@ -20,6 +20,7 @@
package com.sk89q.worldedit.entity; package com.sk89q.worldedit.entity;
import com.boydti.fawe.Fawe; import com.boydti.fawe.Fawe;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.config.Settings; import com.boydti.fawe.config.Settings;
import com.boydti.fawe.object.brush.visualization.VirtualWorld; import com.boydti.fawe.object.brush.visualization.VirtualWorld;
import com.boydti.fawe.object.clipboard.DiskOptimizedClipboard; 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.Location;
import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TextComponent; 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.World;
import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.gamemode.GameMode; import com.sk89q.worldedit.world.gamemode.GameMode;
import java.io.File;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.io.File;
/** /**
* Represents a player. * Represents a player.
@ -431,12 +431,12 @@ public interface Player extends Entity, Actor {
getSession().setClipboard(holder); getSession().setClipboard(holder);
} }
} catch (Exception event) { } catch (Exception event) {
printError(TranslatableComponent.of("====== INVALID CLIPBOARD ======")); printError(TextComponent.of("====== INVALID CLIPBOARD ======"));
event.printStackTrace(); event.printStackTrace();
printError(TranslatableComponent.of("fawe.error.stacktrace")); printError(Caption.of("fawe.error.stacktrace"));
printError(TranslatableComponent.of("fawe.error.no-failure")); printError(Caption.of("fawe.error.no-failure"));
printError(TranslatableComponent.of("File: ", TextComponent.of(file.getName()), TextComponent.of(" (len:"), TextComponent.of(file.length()), TextComponent.of(")"))); printError(Caption.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"));
} }
} }
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.factory; package com.sk89q.worldedit.extension.factory;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.factory.parser.mask.AdjacentMaskParser; import com.sk89q.worldedit.extension.factory.parser.mask.AdjacentMaskParser;
import com.sk89q.worldedit.extension.factory.parser.mask.AirMaskParser; import com.sk89q.worldedit.extension.factory.parser.mask.AirMaskParser;
@ -138,14 +139,14 @@ public final class MaskFactory extends AbstractFactory<Mask> {
} }
} }
if (match == null) { 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); masks.add(match);
} }
switch (masks.size()) { switch (masks.size()) {
case 0: 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: case 1:
return masks.get(0).optimize(); return masks.get(0).optimize();
default: default:

Datei anzeigen

@ -84,10 +84,10 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
} catch (NotABlockException e) { } catch (NotABlockException e) {
throw new InputParseException(e.getRichMessage()); throw new InputParseException(e.getRichMessage());
} catch (WorldEditException e) { } 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 { } else {
throw new InputParseException(TranslatableComponent.of( throw new InputParseException(Caption.of(
"worldedit.error.parser.player-only", "worldedit.error.parser.player-only",
TextComponent.of(handSide == HandSide.MAIN_HAND ? "hand" : "offhand") TextComponent.of(handSide == HandSide.MAIN_HAND ? "hand" : "offhand")
)); ));
@ -181,7 +181,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
String[] parts = parseableData.split("="); String[] parts = parseableData.split("=");
if (parts.length != 2) { if (parts.length != 2) {
throw new InputParseException( throw new InputParseException(
TranslatableComponent.of("worldedit.error.parser.bad-state-format", Caption.of("worldedit.error.parser.bad-state-format",
TextComponent.of(parseableData)) TextComponent.of(parseableData))
); );
} }
@ -190,7 +190,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
Property<Object> propertyKey = (Property<Object>) type.getPropertyMap().get(parts[0]); Property<Object> propertyKey = (Property<Object>) type.getPropertyMap().get(parts[0]);
if (propertyKey == null) { if (propertyKey == null) {
if (context.getActor() != null) { if (context.getActor() != null) {
throw new NoMatchException(TranslatableComponent.of( throw new NoMatchException(Caption.of(
"worldedit.error.parser.unknown-property", "worldedit.error.parser.unknown-property",
TextComponent.of(parts[0]), TextComponent.of(parts[0]),
TextComponent.of(type.getId()) TextComponent.of(type.getId())
@ -201,7 +201,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
return Maps.newHashMap(); return Maps.newHashMap();
} }
if (blockStates.containsKey(propertyKey)) { if (blockStates.containsKey(propertyKey)) {
throw new InputParseException(TranslatableComponent.of( throw new InputParseException(Caption.of(
"worldedit.error.parser.duplicate-property", "worldedit.error.parser.duplicate-property",
TextComponent.of(parts[0]) TextComponent.of(parts[0])
)); ));
@ -210,7 +210,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
try { try {
value = propertyKey.getValueFor(parts[1]); value = propertyKey.getValueFor(parts[1]);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
throw new NoMatchException(TranslatableComponent.of( throw new NoMatchException(Caption.of(
"worldedit.error.parser.unknown-value", "worldedit.error.parser.unknown-value",
TextComponent.of(parts[1]), TextComponent.of(parts[1]),
TextComponent.of(propertyKey.getName()) TextComponent.of(propertyKey.getName())
@ -221,7 +221,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
} catch (NoMatchException e) { } catch (NoMatchException e) {
throw e; // Pass-through throw e; // Pass-through
} catch (Exception e) { } catch (Exception e) {
throw new InputParseException(TranslatableComponent.of( throw new InputParseException(Caption.of(
"worldedit.error.parser.bad-state-format", "worldedit.error.parser.bad-state-format",
TextComponent.of(parseableData) TextComponent.of(parseableData)
)); ));
@ -264,14 +264,14 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
try { try {
String[] split = blockAndExtraData[0].split(":", 2); String[] split = blockAndExtraData[0].split(":", 2);
if (split.length == 0) { 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) { } else if (split.length == 1) {
state = LegacyMapper.getInstance().getBlockFromLegacy(Integer.parseInt(split[0])); state = LegacyMapper.getInstance().getBlockFromLegacy(Integer.parseInt(split[0]));
} else if (MathMan.isInteger(split[0])) { } else if (MathMan.isInteger(split[0])) {
int id = Integer.parseInt(split[0]); int id = Integer.parseInt(split[0]);
int data = Integer.parseInt(split[1]); int data = Integer.parseInt(split[1]);
if (data < 0 || data >= 16) { 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); state = LegacyMapper.getInstance().getBlockFromLegacy(id, data);
} else { } else {
@ -279,7 +279,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
if (type != null) { if (type != null) {
int data = Integer.parseInt(split[1]); int data = Integer.parseInt(split[1]);
if (data < 0 || data >= 16) { 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); state = LegacyMapper.getInstance().getBlockFromLegacy(type.getLegacyCombinedId() >> 4, data);
} }
@ -298,11 +298,11 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
} else { } else {
typeString = blockAndExtraData[0].substring(0, stateStart); typeString = blockAndExtraData[0].substring(0, stateStart);
if (stateStart + 1 >= blockAndExtraData[0].length()) { 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(']'); int stateEnd = blockAndExtraData[0].lastIndexOf(']');
if (stateEnd < 0) { 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); stateString = blockAndExtraData[0].substring(stateStart + 1, blockAndExtraData[0].length() - 1);
} }
@ -311,7 +311,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
stateProperties = stateString.split(","); stateProperties = stateString.split(",");
} }
if (typeString.isEmpty()) { if (typeString.isEmpty()) {
throw new InputParseException(TranslatableComponent.of( throw new InputParseException(Caption.of(
"worldedit.error.parser.bad-state-format", "worldedit.error.parser.bad-state-format",
TextComponent.of(blockAndExtraData[0]) TextComponent.of(blockAndExtraData[0])
)); ));
@ -334,25 +334,25 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
try { try {
primaryPosition = context.requireSession().getRegionSelector(world).getVertices().get(index - 1); primaryPosition = context.requireSession().getRegionSelector(world).getVertices().get(index - 1);
} catch (IncompleteRegionException e) { } 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); state = world.getBlock(primaryPosition);
} else if (typeString.matches("slot[0-9]+")) { } else if (typeString.matches("slot[0-9]+")) {
int slot = Integer.parseInt(typeString.substring(4)) - 1; int slot = Integer.parseInt(typeString.substring(4)) - 1;
Actor actor = context.requireActor(); Actor actor = context.requireActor();
if (!(actor instanceof Player)) { 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; Player player = (Player) actor;
BlockBag bag = player.getInventoryBlockBag(); BlockBag bag = player.getInventoryBlockBag();
if (!(bag instanceof SlottableBlockBag)) { if (!(bag instanceof SlottableBlockBag)) {
throw new InputParseException(TranslatableComponent.of("fawe.error.unsupported")); throw new InputParseException(Caption.of("fawe.error.unsupported"));
} }
SlottableBlockBag slottable = (SlottableBlockBag) bag; SlottableBlockBag slottable = (SlottableBlockBag) bag;
BaseItem item = slottable.getItem(slot); BaseItem item = slottable.getItem(slot);
if (!item.getType().hasBlockType()) { 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(); state = item.getType().getBlockType().getDefaultState();
nbt = item.getNbtData(); nbt = item.getNbtData();
@ -363,7 +363,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
state = type.getDefaultState(); state = type.getDefaultState();
} }
if (state == null) { 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) { if (nbt == null) {
@ -394,7 +394,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
} }
// this should be impossible but IntelliJ isn't that smart // this should be impossible but IntelliJ isn't that smart
if (state == null) { 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("{")) { if (blockAndExtraData.length > 1 && blockAndExtraData[1].startsWith("{")) {
@ -402,7 +402,7 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
try { try {
nbt = JSON2NBT.getTagFromJson(joined); nbt = JSON2NBT.getTagFromJson(joined);
} catch (NBTException e) { } 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(); Actor actor = context.requireActor();
if (actor != null && !actor.hasPermission("worldedit.anyblock") if (actor != null && !actor.hasPermission("worldedit.anyblock")
&& worldEdit.getConfiguration().disallowedBlocks.contains(blockType.getId())) { && 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]; String mobName = blockAndExtraData[1];
EntityType ent = EntityTypes.get(mobName.toLowerCase(Locale.ROOT)); EntityType ent = EntityTypes.get(mobName.toLowerCase(Locale.ROOT));
if (ent == null) { 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(); mobName = ent.getId();
if (!worldEdit.getPlatformManager().queryCapability(Capability.USER_COMMANDS).isValidMobType(mobName)) { 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)); return validate(context, new MobSpawnerBlock(state, mobName));
} else { } else {
@ -465,12 +465,12 @@ public class DefaultBlockParser extends InputParser<BaseBlock> {
if (context.isRestricted()) { if (context.isRestricted()) {
Actor actor = context.requireActor(); Actor actor = context.requireActor();
if (!actor.hasPermission("worldedit.anyblock") && worldEdit.getConfiguration().checkDisallowedBlocks(holder)) { 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(); CompoundTag nbt = holder.getNbtData();
if (nbt != null) { if (nbt != null) {
if (!actor.hasPermission("worldedit.anyblock")) { if (!actor.hasPermission("worldedit.anyblock")) {
throw new DisallowedUsageException(TranslatableComponent.of("fawe.error.nbt.forbidden")); throw new DisallowedUsageException(Caption.of("fawe.error.nbt.forbidden"));
} }
} }
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.factory.parser; package com.sk89q.worldedit.extension.factory.parser;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItem;
import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.blocks.BaseItemStack;
@ -58,7 +59,7 @@ public class DefaultItemParser extends InputParser<BaseItem> {
String[] split = input.split(":"); String[] split = input.split(":");
ItemType type; ItemType type;
if (split.length == 0) { 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) { } else if (split.length == 1) {
type = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(split[0])); type = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(split[0]));
} else { } else {
@ -85,7 +86,7 @@ public class DefaultItemParser extends InputParser<BaseItem> {
} }
if (item == null) { 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 { } else {
return item; return item;
} }
@ -95,7 +96,7 @@ public class DefaultItemParser extends InputParser<BaseItem> {
if (actor instanceof Player) { if (actor instanceof Player) {
return ((Player) actor).getItemInHand(handSide); return ((Player) actor).getItemInHand(handSide);
} else { } else {
throw new InputParseException(TranslatableComponent.of( throw new InputParseException(Caption.of(
"worldedit.error.parser.player-only", "worldedit.error.parser.player-only",
TextComponent.of(handSide == HandSide.MAIN_HAND ? "hand" : "offhand") TextComponent.of(handSide == HandSide.MAIN_HAND ? "hand" : "offhand")
)); ));

Datei anzeigen

@ -1,5 +1,6 @@
package com.sk89q.worldedit.extension.factory.parser; package com.sk89q.worldedit.extension.factory.parser;
import com.boydti.fawe.config.Caption;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.input.InputParseException; 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)); arguments.add(input.substring(openIndex + 1));
} }
if (requireClosing && open != 0) { 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]); return arguments.toArray(new String[0]);
} }

Datei anzeigen

@ -1,5 +1,6 @@
package com.sk89q.worldedit.extension.factory.parser.mask; package com.sk89q.worldedit.extension.factory.parser.mask;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.mask.AngleMask; import com.boydti.fawe.object.mask.AngleMask;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper; import com.sk89q.worldedit.command.util.SuggestionHelper;
@ -40,7 +41,7 @@ public class AngleMaskParser extends RichParser<Mask> {
String maxArg = arguments[1]; String maxArg = arguments[1];
boolean degree = minArg.endsWith("d"); boolean degree = minArg.endsWith("d");
if (degree ^ maxArg.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; boolean overlay = false;
if (arguments.length > 2) { if (arguments.length > 2) {
@ -49,7 +50,7 @@ public class AngleMaskParser extends RichParser<Mask> {
if (flag.equals("-o")) { if (flag.equals("-o")) {
overlay = true; overlay = true;
} else { } else {
throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-flag", throw new InputParseException(Caption.of("fawe.error.invalid-flag",
TextComponent.of(flag))); TextComponent.of(flag)));
} }
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.factory.parser.mask; package com.sk89q.worldedit.extension.factory.parser.mask;
import com.boydti.fawe.config.Caption;
import com.google.common.base.Splitter; import com.google.common.base.Splitter;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper; 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))) { for (String biomeName : Splitter.on(",").split(input.substring(1))) {
BiomeType biome = BiomeType.REGISTRY.get(biomeName); BiomeType biome = BiomeType.REGISTRY.get(biomeName);
if (biome == null) { 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); biomes.add(biome);
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.factory.parser.mask; package com.sk89q.worldedit.extension.factory.parser.mask;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper; import com.sk89q.worldedit.command.util.SuggestionHelper;
import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.InputParseException;
@ -53,7 +54,7 @@ public class BlockCategoryMaskParser extends InputParser<Mask> {
// This means it's a tag mask. // This means it's a tag mask.
BlockCategory category = BlockCategory.REGISTRY.get(input.substring(2).toLowerCase(Locale.ROOT)); BlockCategory category = BlockCategory.REGISTRY.get(input.substring(2).toLowerCase(Locale.ROOT));
if (category == null) { 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 { } else {
return new BlockCategoryMask(context.requireExtent(), category); return new BlockCategoryMask(context.requireExtent(), category);
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.factory.parser.mask; package com.sk89q.worldedit.extension.factory.parser.mask;
import com.boydti.fawe.config.Caption;
import com.google.common.base.Splitter; import com.google.common.base.Splitter;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.InputParseException;
@ -58,7 +59,7 @@ public class BlockStateMaskParser extends InputParser<Mask> {
Splitter.on(',').omitEmptyStrings().trimResults().withKeyValueSeparator('=').split(states), Splitter.on(',').omitEmptyStrings().trimResults().withKeyValueSeparator('=').split(states),
strict); strict);
} catch (Exception e) { } 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))));
} }
} }
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.factory.parser.mask; package com.sk89q.worldedit.extension.factory.parser.mask;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.ParserContext;
@ -68,7 +69,7 @@ public class ExpressionMaskParser extends InputParser<Mask> {
} }
return new ExpressionMask(exp); return new ExpressionMask(exp);
} catch (ExpressionException e) { } 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())));
} }
} }
} }

Datei anzeigen

@ -1,5 +1,6 @@
package com.sk89q.worldedit.extension.factory.parser.mask; package com.sk89q.worldedit.extension.factory.parser.mask;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.mask.ExtremaMask; import com.boydti.fawe.object.mask.ExtremaMask;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper; import com.sk89q.worldedit.command.util.SuggestionHelper;
@ -40,7 +41,7 @@ public class ExtremaMaskParser extends RichParser<Mask> {
String maxArg = arguments[1]; String maxArg = arguments[1];
boolean degree = minArg.endsWith("d"); boolean degree = minArg.endsWith("d");
if (degree ^ maxArg.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 min;
double max; double max;
@ -51,7 +52,7 @@ public class ExtremaMaskParser extends RichParser<Mask> {
if (flag.equals("-o")) { if (flag.equals("-o")) {
overlay = true; overlay = true;
} else { } else {
throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-flag", throw new InputParseException(Caption.of("fawe.error.invalid-flag",
TextComponent.of(flag))); TextComponent.of(flag)));
} }
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.factory.parser.mask; package com.sk89q.worldedit.extension.factory.parser.mask;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.InputParseException;
import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.input.ParserContext;
@ -55,7 +56,7 @@ public class NegateMaskParser extends InputParser<Mask> {
if (input.length() > 1) { if (input.length() > 1) {
return Masks.negate(worldEdit.getMaskFactory().parseFromInput(input.substring(1), context)); return Masks.negate(worldEdit.getMaskFactory().parseFromInput(input.substring(1), context));
} else { } else {
throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.negate-nothing")); throw new InputParseException(Caption.of("worldedit.error.parser.negate-nothing"));
} }
} }
} }

Datei anzeigen

@ -1,5 +1,6 @@
package com.sk89q.worldedit.extension.factory.parser.mask; package com.sk89q.worldedit.extension.factory.parser.mask;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.mask.ROCAngleMask; import com.boydti.fawe.object.mask.ROCAngleMask;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper; import com.sk89q.worldedit.command.util.SuggestionHelper;
@ -40,7 +41,7 @@ public class ROCAngleMaskParser extends RichParser<Mask> {
String maxArg = arguments[1]; String maxArg = arguments[1];
boolean degree = minArg.endsWith("d"); boolean degree = minArg.endsWith("d");
if (degree ^ maxArg.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 min;
double max; double max;
@ -51,7 +52,7 @@ public class ROCAngleMaskParser extends RichParser<Mask> {
if (flag.equals("-o")) { if (flag.equals("-o")) {
overlay = true; overlay = true;
} else { } else {
throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-flag", throw new InputParseException(Caption.of("fawe.error.invalid-flag",
TextComponent.of(flag))); TextComponent.of(flag)));
} }
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.factory.parser.mask; package com.sk89q.worldedit.extension.factory.parser.mask;
import com.boydti.fawe.config.Caption;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.IncompleteRegionException;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
@ -49,7 +50,7 @@ public class RegionMaskParser extends SimpleInputParser<Mask> {
try { try {
return new RegionMask(context.requireSession().getSelection(context.requireWorld()).clone()); return new RegionMask(context.requireSession().getSelection(context.requireWorld()).clone());
} catch (IncompleteRegionException e) { } catch (IncompleteRegionException e) {
throw new InputParseException(TranslatableComponent.of("worldedit.error.incomplete-region")); throw new InputParseException(Caption.of("worldedit.error.incomplete-region"));
} }
} }
} }

Datei anzeigen

@ -1,5 +1,6 @@
package com.sk89q.worldedit.extension.factory.parser.pattern; package com.sk89q.worldedit.extension.factory.parser.pattern;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.pattern.BiomeApplyingPattern; import com.boydti.fawe.object.pattern.BiomeApplyingPattern;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.factory.parser.RichParser; import com.sk89q.worldedit.extension.factory.parser.RichParser;
@ -34,7 +35,7 @@ public class BiomePatternParser extends RichParser<Pattern> {
String biomeId = input.substring(1); String biomeId = input.substring(1);
BiomeType biomeType = BiomeTypes.get(biomeId); BiomeType biomeType = BiomeTypes.get(biomeId);
if (biomeType == null) { 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); return new BiomeApplyingPattern(context.requireExtent(), biomeType);
} else { } else {
@ -63,11 +64,11 @@ public class BiomePatternParser extends RichParser<Pattern> {
@Override @Override
protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException { protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
if (arguments.length != 1) { 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]); BiomeType biomeType = BiomeTypes.get(arguments[0]);
if (biomeType == null) { 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); return new BiomeApplyingPattern(context.requireExtent(), biomeType);
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.factory.parser.pattern; package com.sk89q.worldedit.extension.factory.parser.pattern;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper; import com.sk89q.worldedit.command.util.SuggestionHelper;
import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.InputParseException;
@ -60,13 +61,13 @@ public class BlockCategoryPatternParser extends InputParser<Pattern> {
BlockCategory category = BlockCategory.REGISTRY.get(tag); BlockCategory category = BlockCategory.REGISTRY.get(tag);
if (category == null) { 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(); RandomPattern randomPattern = new RandomPattern();
Set<BlockType> blocks = category.getAll(); Set<BlockType> blocks = category.getAll();
if (blocks.isEmpty()) { 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) { if (anyState) {

Datei anzeigen

@ -1,5 +1,6 @@
package com.sk89q.worldedit.extension.factory.parser.pattern; package com.sk89q.worldedit.extension.factory.parser.pattern;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.pattern.BufferedPattern; import com.boydti.fawe.object.pattern.BufferedPattern;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.factory.parser.RichParser; import com.sk89q.worldedit.extension.factory.parser.RichParser;
@ -34,7 +35,7 @@ public class BufferedPatternParser extends RichParser<Pattern> {
@Override @Override
protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException { protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
if (arguments.length != 1) { 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])"))); TextComponent.of(getPrefix() + "[pattern] (e.g. " + getPrefix() + "[stone,dirt])")));
} }
Pattern inner = this.worldEdit.getPatternFactory().parseFromInput(arguments[0], context); Pattern inner = this.worldEdit.getPatternFactory().parseFromInput(arguments[0], context);

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.factory.parser.pattern; package com.sk89q.worldedit.extension.factory.parser.pattern;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.EmptyClipboardException; import com.sk89q.worldedit.EmptyClipboardException;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
@ -80,11 +81,11 @@ public class ClipboardPatternParser extends InputParser<Pattern> {
String coords = offsetParts[1]; String coords = offsetParts[1];
if (coords.length() < 7 // min length of `[x,y,z]` if (coords.length() < 7 // min length of `[x,y,z]`
|| coords.charAt(0) != '[' || coords.charAt(coords.length() - 1) != ']') { || 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(","); String[] offsetSplit = coords.substring(1, coords.length() - 1).split(",");
if (offsetSplit.length != 3) { 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( offset = BlockVector3.at(
Integer.valueOf(offsetSplit[0]), Integer.valueOf(offsetSplit[0]),
@ -99,10 +100,10 @@ public class ClipboardPatternParser extends InputParser<Pattern> {
Clipboard clipboard = holder.getClipboard(); Clipboard clipboard = holder.getClipboard();
return new ClipboardPattern(clipboard, offset); return new ClipboardPattern(clipboard, offset);
} catch (EmptyClipboardException e) { } 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 { } else {
throw new InputParseException(TranslatableComponent.of("fawe.error.no-session")); throw new InputParseException(Caption.of("fawe.error.no-session"));
} }
} }

Datei anzeigen

@ -1,5 +1,6 @@
package com.sk89q.worldedit.extension.factory.parser.pattern; package com.sk89q.worldedit.extension.factory.parser.pattern;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.pattern.Linear2DBlockPattern; import com.boydti.fawe.object.pattern.Linear2DBlockPattern;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
@ -44,7 +45,7 @@ public class Linear2DPatternParser extends RichParser<Pattern> {
@Override @Override
protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException { protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
if (arguments.length == 0 || arguments.length > 3) { 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])"))); TextComponent.of(getPrefix() + "[pattern] (e.g. " + getPrefix() + "[stone,dirt])")));
} }
Pattern inner = this.worldEdit.getPatternFactory().parseFromInput(arguments[0], context); Pattern inner = this.worldEdit.getPatternFactory().parseFromInput(arguments[0], context);

Datei anzeigen

@ -1,5 +1,6 @@
package com.sk89q.worldedit.extension.factory.parser.pattern; package com.sk89q.worldedit.extension.factory.parser.pattern;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.pattern.Linear3DBlockPattern; import com.boydti.fawe.object.pattern.Linear3DBlockPattern;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
@ -45,7 +46,7 @@ public class Linear3DPatternParser extends RichParser<Pattern> {
@Override @Override
protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException { protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException {
if (arguments.length == 0 || arguments.length > 4) { 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])"))); TextComponent.of(getPrefix() + "[pattern] (e.g. " + getPrefix() + "[stone,dirt])")));
} }
Pattern inner = this.worldEdit.getPatternFactory().parseFromInput(arguments[0], context); Pattern inner = this.worldEdit.getPatternFactory().parseFromInput(arguments[0], context);

Datei anzeigen

@ -1,5 +1,6 @@
package com.sk89q.worldedit.extension.factory.parser.pattern; package com.sk89q.worldedit.extension.factory.parser.pattern;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.random.NoiseRandom; import com.boydti.fawe.object.random.NoiseRandom;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper; import com.sk89q.worldedit.command.util.SuggestionHelper;
@ -49,7 +50,7 @@ public abstract class NoisePatternParser extends RichParser<Pattern> {
@Override @Override
protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) { protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) {
if (arguments.length != 2) { 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])"))); TextComponent.of(getPrefix() + "[scale][pattern] (e.g. " + getPrefix() + "[5][dirt,stone])")));
} }
double scale = parseScale(arguments[0]); double scale = parseScale(arguments[0]);

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.factory.parser.pattern; package com.sk89q.worldedit.extension.factory.parser.pattern;
import com.boydti.fawe.config.Caption;
import com.sk89q.util.StringUtil; import com.sk89q.util.StringUtil;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.InputParseException;
@ -81,7 +82,7 @@ public class RandomPatternParser extends InputParser<Pattern> {
String[] p = token.split("%", 2); String[] p = token.split("%", 2);
if (p.length < 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 { } else {
chance = Double.parseDouble(p[0]); chance = Double.parseDouble(p[0]);
innerPattern = worldEdit.getPatternFactory().parseFromInput(p[1], context); innerPattern = worldEdit.getPatternFactory().parseFromInput(p[1], context);

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.factory.parser.pattern; package com.sk89q.worldedit.extension.factory.parser.pattern;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEdit;
import com.sk89q.worldedit.command.util.SuggestionHelper; import com.sk89q.worldedit.command.util.SuggestionHelper;
import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.InputParseException;
@ -85,28 +86,28 @@ public class TypeOrStateApplyingPatternParser extends InputParser<Pattern> {
} else { } else {
// states given // states given
if (!parts[1].endsWith("]")) { 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(","); final String[] states = parts[1].substring(0, parts[1].length() - 1).split(",");
Map<String, String> statesToSet = new HashMap<>(); Map<String, String> statesToSet = new HashMap<>();
for (String state : states) { for (String state : states) {
if (state.isEmpty()) { 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); String[] propVal = state.split("=", 2);
if (propVal.length != 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]; final String prop = propVal[0];
if (prop.isEmpty()) { 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]; final String value = propVal[1];
if (value.isEmpty()) { 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) { 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()) { if (type.isEmpty()) {

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.input; package com.sk89q.worldedit.extension.input;
import com.boydti.fawe.config.Caption;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.extension.factory.MaskFactory; import com.sk89q.worldedit.extension.factory.MaskFactory;
import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Actor;
@ -157,7 +158,7 @@ public class ParserContext {
public Extent requireExtent() throws InputParseException { public Extent requireExtent() throws InputParseException {
Extent extent = getExtent(); Extent extent = getExtent();
if (extent == null) { if (extent == null) {
throw new InputParseException(TranslatableComponent.of("worldedit.error.missing-extent")); throw new InputParseException(Caption.of("worldedit.error.missing-extent"));
} }
return extent; return extent;
} }
@ -171,7 +172,7 @@ public class ParserContext {
public LocalSession requireSession() throws InputParseException { public LocalSession requireSession() throws InputParseException {
LocalSession session = getSession(); LocalSession session = getSession();
if (session == null) { if (session == null) {
throw new InputParseException(TranslatableComponent.of("worldedit.error.missing-session")); throw new InputParseException(Caption.of("worldedit.error.missing-session"));
} }
return session; return session;
} }
@ -185,7 +186,7 @@ public class ParserContext {
public World requireWorld() throws InputParseException { public World requireWorld() throws InputParseException {
World world = getWorld(); World world = getWorld();
if (world == null) { if (world == null) {
throw new InputParseException(TranslatableComponent.of("worldedit.error.missing-world")); throw new InputParseException(Caption.of("worldedit.error.missing-world"));
} }
return world; return world;
} }
@ -199,7 +200,7 @@ public class ParserContext {
public Actor requireActor() throws InputParseException { public Actor requireActor() throws InputParseException {
Actor actor = getActor(); Actor actor = getActor();
if (actor == null) { if (actor == null) {
throw new InputParseException(TranslatableComponent.of("worldedit.error.missing-actor")); throw new InputParseException(Caption.of("worldedit.error.missing-actor"));
} }
return actor; return actor;
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.platform; package com.sk89q.worldedit.extension.platform;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.exception.FaweException; import com.boydti.fawe.object.exception.FaweException;
import com.boydti.fawe.object.task.AsyncNotifyQueue; import com.boydti.fawe.object.task.AsyncNotifyQueue;
import com.boydti.fawe.util.TaskManager; import com.boydti.fawe.util.TaskManager;
@ -71,7 +72,7 @@ public abstract class AbstractNonPlayerActor implements Actor {
throwable = throwable.getCause(); throwable = throwable.getCause();
} }
if (throwable instanceof WorldEditException) { if (throwable instanceof WorldEditException) {
printError(TranslatableComponent.of(throwable.getLocalizedMessage())); printError(Caption.of(throwable.getLocalizedMessage()));
} else { } else {
FaweException fe = FaweException.get(throwable); FaweException fe = FaweException.get(throwable);
if (fe != null) { if (fe != null) {

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.platform; package com.sk89q.worldedit.extension.platform;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.object.exception.FaweException; import com.boydti.fawe.object.exception.FaweException;
import com.boydti.fawe.object.task.AsyncNotifyQueue; import com.boydti.fawe.object.task.AsyncNotifyQueue;
import com.boydti.fawe.regions.FaweMaskManager; import com.boydti.fawe.regions.FaweMaskManager;
@ -86,7 +87,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable {
throwable = throwable.getCause(); throwable = throwable.getCause();
} }
if (throwable instanceof WorldEditException) { if (throwable instanceof WorldEditException) {
printError(TranslatableComponent.of(throwable.getLocalizedMessage())); printError(Caption.of(throwable.getLocalizedMessage()));
} else { } else {
FaweException fe = FaweException.get(throwable); FaweException fe = FaweException.get(throwable);
if (fe != null) { if (fe != null) {
@ -666,13 +667,13 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable {
@Override @Override
public File openFileOpenDialog(String[] extensions) { public File openFileOpenDialog(String[] extensions) {
printError(TranslatableComponent.of("worldedit.platform.no-file-dialog")); printError(Caption.of("worldedit.platform.no-file-dialog"));
return null; return null;
} }
@Override @Override
public File openFileSaveDialog(String[] extensions) { public File openFileSaveDialog(String[] extensions) {
printError(TranslatableComponent.of("worldedit.platform.no-file-dialog")); printError(Caption.of("worldedit.platform.no-file-dialog"));
return null; return null;
} }

Datei anzeigen

@ -354,7 +354,7 @@ public final class PlatformCommandManager {
additionalConfig.accept(manager); additionalConfig.accept(manager);
final List<Command> subCommands = manager.getAllCommands().collect(Collectors.toList()); 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.")) TextComponent.of("Sub-command to run."))
.withCommands(subCommands) .withCommands(subCommands)
.required() .required()
@ -384,7 +384,7 @@ public final class PlatformCommandManager {
additionalConfig.accept(manager); additionalConfig.accept(manager);
final List<Command> subCommands = manager.getAllCommands().collect(Collectors.toList()); 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.")) TextComponent.of("Sub-command to run."))
.withCommands(subCommands) .withCommands(subCommands)
.required() .required()
@ -724,16 +724,16 @@ public final class PlatformCommandManager {
actor.print(e.getRichMessage()); actor.print(e.getRichMessage());
} }
} catch (FaweException e) { } 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) { } catch (UsageException e) {
ImmutableList<Command> cmd = e.getCommands(); ImmutableList<Command> cmd = e.getCommands();
if (!cmd.isEmpty()) { 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()); actor.printError(e.getRichMessage());
} catch (CommandExecutionException e) { } catch (CommandExecutionException e) {
if (e.getCause() instanceof FaweException) { 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 { } else {
handleUnknownException(actor, e.getCause()); handleUnknownException(actor, e.getCause());
} }
@ -741,7 +741,6 @@ public final class PlatformCommandManager {
Component msg = e.getRichMessage(); Component msg = e.getRichMessage();
if (msg != TextComponent.empty()) { if (msg != TextComponent.empty()) {
actor.print(TextComponent.builder("") actor.print(TextComponent.builder("")
.color(TextColor.RED)
.append(e.getRichMessage()) .append(e.getRichMessage())
.build()); .build());
List<String> argList = parseArgs(event.getArguments()).map(Substring::getSubstring).collect(Collectors.toList()); List<String> argList = parseArgs(event.getArguments()).map(Substring::getSubstring).collect(Collectors.toList());
@ -765,7 +764,7 @@ public final class PlatformCommandManager {
int changed = editSession.getBlockChangeCount(); int changed = editSession.getBlockChangeCount();
double throughput = timeS == 0 ? changed : changed / timeS; double throughput = timeS == 0 ? changed : changed / timeS;
if (time > 1000) { if (time > 1000) {
actor.printDebug(TranslatableComponent.of( actor.print(Caption.of(
"worldedit.command.time-elapsed", "worldedit.command.time-elapsed",
TextComponent.of(timeS), TextComponent.of(timeS),
TextComponent.of(changed), TextComponent.of(changed),
@ -807,7 +806,7 @@ public final class PlatformCommandManager {
store.injectValue(Key.of(Player.class), ValueProvider.constant((Player) actor)); store.injectValue(Key.of(Player.class), ValueProvider.constant((Player) actor));
} else { } else {
store.injectValue(Key.of(Player.class), context -> { 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)); store.injectValue(Key.of(Arguments.class), ValueProvider.constant(arguments));
@ -826,7 +825,7 @@ public final class PlatformCommandManager {
} }
private void handleUnknownException(Actor actor, Throwable t) { 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())); actor.print(TextComponent.of(t.getClass().getName() + ": " + t.getMessage()));
LOGGER.error("An unexpected error while handling a WorldEdit command", t); LOGGER.error("An unexpected error while handling a WorldEdit command", t);
} }

Datei anzeigen

@ -19,6 +19,7 @@
package com.sk89q.worldedit.extension.platform; package com.sk89q.worldedit.extension.platform;
import com.boydti.fawe.config.Caption;
import com.boydti.fawe.config.Settings; import com.boydti.fawe.config.Settings;
import com.boydti.fawe.object.brush.visualization.VirtualWorld; import com.boydti.fawe.object.brush.visualization.VirtualWorld;
import com.boydti.fawe.object.exception.FaweException; import com.boydti.fawe.object.exception.FaweException;
@ -407,10 +408,10 @@ public class PlatformManager {
public void handleThrowable(Throwable e, Actor actor) { public void handleThrowable(Throwable e, Actor actor) {
FaweException faweException = FaweException.get(e); FaweException faweException = FaweException.get(e);
if (faweException != null) { 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 { } else {
actor.printError(TranslatableComponent.of("worldedit.command.error.report")); actor.print(Caption.of("worldedit.command.error.report"));
actor.print(TranslatableComponent.of(e.getClass().getName(), TextComponent.of(": "), TextComponent.of(e.getMessage()))); actor.print(Caption.of(e.getClass().getName(), TextComponent.of(": "), TextComponent.of(e.getMessage())));
e.printStackTrace(); e.printStackTrace();
} }
} }
@ -462,10 +463,10 @@ public class PlatformManager {
} catch (Throwable e) { } catch (Throwable e) {
FaweException faweException = FaweException.get(e); FaweException faweException = FaweException.get(e);
if (faweException != null) { 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 { } else {
player.printError(TranslatableComponent.of("worldedit.command.error.report")); player.print(Caption.of("worldedit.command.error.report"));
player.print(TranslatableComponent.of(e.getClass().getName() + ": " + e.getMessage())); player.print(Caption.of(e.getClass().getName() + ": " + e.getMessage()));
e.printStackTrace(); e.printStackTrace();
} }
} finally { } finally {

Datei anzeigen

@ -116,7 +116,7 @@ public class ConsumeBindings extends Bindings {
uuid = Fawe.imp().getUUID(argument); uuid = Fawe.imp().getUUID(argument);
} }
if (uuid == null) { 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; return uuid;
} }
@ -156,7 +156,7 @@ public class ConsumeBindings extends Bindings {
try { try {
return getWorldEdit().getBlockFactory().parseFromInput(argument, parserContext); return getWorldEdit().getBlockFactory().parseFromInput(argument, parserContext);
} catch (NoMatchException e) { } catch (NoMatchException e) {
throw new InputParseException(TranslatableComponent.of(e.getMessage())); throw new InputParseException(Caption.of(e.getMessage()));
} }
} }
} }

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen