From 5e534ff9e228f99ef4fd586c9b115520fc6cb525 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Mon, 5 Apr 2021 19:54:49 +0200 Subject: [PATCH] Finalize Captions Follow up to a9d1202ce1322ba505536dbce00dc0bc72c1a3ec --- .../fawe/bukkit/adapter/NMSAdapter.java | 1 - .../bukkit/filter/GriefPreventionFilter.java | 1 - .../bukkit/preloader/PluginPreloader.java | 2 - .../bukkit/regions/BukkitMaskManager.java | 1 - .../worldedit/bukkit/BukkitItemStack.java | 1 - .../EditSessionBlockChangeDelegate.java | 2 - .../worldedit/bukkit/WorldEditPlugin.java | 1 - .../bukkit/WorldUnloadedException.java | 4 +- .../adapter/IDelegateBukkitImplAdapter.java | 1 - .../com/sk89q/worldedit/cli/CLIWorldEdit.java | 6 +- .../main/java/com/boydti/fawe/FaweCache.java | 19 ++-- .../fawe/object/brush/CatenaryBrush.java | 2 +- .../fawe/object/brush/CopyPastaBrush.java | 2 +- .../boydti/fawe/object/brush/HeightBrush.java | 3 +- .../boydti/fawe/object/brush/LineBrush.java | 2 +- .../boydti/fawe/object/brush/SplineBrush.java | 8 +- .../fawe/object/brush/SurfaceSpline.java | 5 +- .../fawe/object/brush/sweep/SweepBrush.java | 8 +- .../exception/FaweBlockBagException.java | 4 +- .../exception/FaweChunkLoadException.java | 4 +- .../object/extent/MemoryCheckingExtent.java | 8 +- .../progress/DefaultProgressTracker.java | 3 +- .../fawe/object/regions/FuzzyRegion.java | 8 +- .../fawe/object/visitor/DFSVisitor.java | 7 +- .../boydti/fawe/util/EditSessionBuilder.java | 14 +-- .../java/com/boydti/fawe/util/MainUtil.java | 3 +- .../java/com/boydti/fawe/util/WEManager.java | 3 +- .../com/boydti/fawe/util/image/ImageUtil.java | 17 ++-- .../java/com/sk89q/worldedit/EditSession.java | 6 +- .../worldedit/MissingWorldException.java | 4 +- .../sk89q/worldedit/NotABlockException.java | 10 +- .../worldedit/UnknownDirectionException.java | 4 +- .../java/com/sk89q/worldedit/WorldEdit.java | 22 ++--- .../worldedit/command/ApplyBrushCommands.java | 12 +-- .../worldedit/command/BiomeCommands.java | 8 +- .../worldedit/command/BrushCommands.java | 11 +-- .../worldedit/command/ChunkCommands.java | 9 +- .../worldedit/command/ClipboardCommands.java | 23 +++-- .../worldedit/command/ExpandCommands.java | 10 +- .../worldedit/command/GeneralCommands.java | 50 +++++----- .../worldedit/command/GenerationCommands.java | 19 ++-- .../worldedit/command/HistoryCommands.java | 18 ++-- .../worldedit/command/HistorySubCommands.java | 8 +- .../command/LegacySnapshotCommands.java | 37 +++---- .../command/LegacySnapshotUtilCommands.java | 21 ++-- .../worldedit/command/NavigationCommands.java | 27 ++--- .../worldedit/command/RegionCommands.java | 50 +++++----- .../worldedit/command/SchematicCommands.java | 29 +++--- .../worldedit/command/ScriptingCommands.java | 8 +- .../worldedit/command/SelectionCommands.java | 99 +++++++++---------- .../worldedit/command/SnapshotCommands.java | 29 +++--- .../command/SnapshotUtilCommands.java | 18 ++-- .../command/SuperPickaxeCommands.java | 11 ++- .../sk89q/worldedit/command/ToolCommands.java | 14 +-- .../worldedit/command/ToolUtilCommands.java | 41 ++++---- .../worldedit/command/UtilityCommands.java | 41 ++++---- .../worldedit/command/WorldEditCommands.java | 15 +-- .../worldedit/command/tool/AreaPickaxe.java | 3 +- .../command/tool/BlockDataCyler.java | 11 ++- .../worldedit/command/tool/BlockReplacer.java | 3 +- .../worldedit/command/tool/BrushTool.java | 4 +- .../worldedit/command/tool/DistanceWand.java | 3 +- .../command/tool/FloatingTreeRemover.java | 7 +- .../worldedit/command/tool/FloodFillTool.java | 3 +- .../command/tool/LongRangeBuildTool.java | 3 +- .../command/tool/NavigationWand.java | 5 +- .../worldedit/command/tool/QueryTool.java | 9 +- .../worldedit/command/tool/SinglePickaxe.java | 3 +- .../worldedit/command/tool/TreePlanter.java | 5 +- .../command/util/PrintCommandHelp.java | 7 +- .../command/util/annotation/Confirm.java | 3 +- .../com/sk89q/worldedit/entity/Player.java | 14 +-- .../extension/factory/MaskFactory.java | 5 +- .../factory/parser/DefaultBlockParser.java | 50 +++++----- .../factory/parser/DefaultItemParser.java | 7 +- .../extension/factory/parser/RichParser.java | 3 +- .../factory/parser/mask/AngleMaskParser.java | 5 +- .../factory/parser/mask/BiomeMaskParser.java | 3 +- .../parser/mask/BlockCategoryMaskParser.java | 3 +- .../parser/mask/BlockStateMaskParser.java | 3 +- .../parser/mask/ExpressionMaskParser.java | 3 +- .../parser/mask/ExtremaMaskParser.java | 5 +- .../factory/parser/mask/NegateMaskParser.java | 3 +- .../parser/mask/ROCAngleMaskParser.java | 5 +- .../factory/parser/mask/RegionMaskParser.java | 3 +- .../parser/pattern/BiomePatternParser.java | 7 +- .../pattern/BlockCategoryPatternParser.java | 5 +- .../parser/pattern/BufferedPatternParser.java | 3 +- .../pattern/ClipboardPatternParser.java | 9 +- .../parser/pattern/Linear2DPatternParser.java | 3 +- .../parser/pattern/Linear3DPatternParser.java | 3 +- .../parser/pattern/NoisePatternParser.java | 3 +- .../parser/pattern/RandomPatternParser.java | 3 +- .../TypeOrStateApplyingPatternParser.java | 13 +-- .../extension/input/ParserContext.java | 9 +- .../platform/AbstractNonPlayerActor.java | 3 +- .../platform/AbstractPlayerActor.java | 7 +- .../platform/PlatformCommandManager.java | 17 ++-- .../extension/platform/PlatformManager.java | 13 +-- .../platform/binding/ConsumeBindings.java | 4 +- .../platform/binding/ProvideBindings.java | 2 +- .../extent/clipboard/io/ClipboardFormats.java | 5 +- .../extent/world/ChunkLoadingExtent.java | 1 - .../worldedit/function/factory/Deform.java | 5 +- .../function/mask/BlockMaskBuilder.java | 3 +- .../function/operation/ForwardExtentCopy.java | 13 +-- .../function/visitor/BreadthFirstSearch.java | 5 +- .../function/visitor/EntityVisitor.java | 5 +- .../function/visitor/FlatRegionVisitor.java | 5 +- .../function/visitor/RegionVisitor.java | 5 +- .../WorldEditExceptionConverter.java | 27 ++--- .../internal/registry/AbstractFactory.java | 3 +- .../worldedit/math/DelegateBlockVector3.java | 1 - .../KochanekBartelsInterpolation.java | 1 - .../worldedit/regions/CylinderRegion.java | 3 +- .../worldedit/regions/EllipsoidRegion.java | 3 +- .../sk89q/worldedit/regions/NullRegion.java | 7 +- .../worldedit/regions/Polygonal2DRegion.java | 5 +- .../worldedit/regions/RegionIntersection.java | 5 +- .../worldedit/regions/TransformRegion.java | 7 +- .../ConvexPolyhedralRegionSelector.java | 9 +- .../selector/CuboidRegionSelector.java | 13 +-- .../selector/CylinderRegionSelector.java | 11 ++- .../selector/EllipsoidRegionSelector.java | 13 +-- .../ExtendingCuboidRegionSelector.java | 5 +- .../selector/Polygonal2DRegionSelector.java | 7 +- .../selector/SphereRegionSelector.java | 5 +- .../scripting/CraftScriptContext.java | 3 +- .../formatting/component/PaginationBox.java | 6 +- .../formatting/component/SideEffectBox.java | 12 +-- .../util/paste/ActorCallbackPaste.java | 3 +- .../world/WorldUnloadedException.java | 4 +- .../world/registry/BundledBlockRegistry.java | 6 +- .../world/registry/BundledItemRegistry.java | 4 +- .../world/registry/NullBiomeRegistry.java | 4 +- 135 files changed, 671 insertions(+), 622 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/NMSAdapter.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/NMSAdapter.java index 41c96f295..1732fc3e1 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/NMSAdapter.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/NMSAdapter.java @@ -2,7 +2,6 @@ package com.boydti.fawe.bukkit.adapter; import com.boydti.fawe.FAWEPlatformAdapterImpl; import com.boydti.fawe.beta.IChunkGet; -import com.boydti.fawe.beta.implementation.chunk.ChunkHolder; import com.boydti.fawe.config.Settings; import com.sk89q.worldedit.bukkit.WorldEditPlugin; import com.sk89q.worldedit.math.BlockVector3; diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/filter/GriefPreventionFilter.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/filter/GriefPreventionFilter.java index 6962afdff..d3ef21bb4 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/filter/GriefPreventionFilter.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/filter/GriefPreventionFilter.java @@ -1,6 +1,5 @@ package com.boydti.fawe.bukkit.filter; -import com.boydti.fawe.object.RunnableVal; import com.boydti.fawe.regions.general.CuboidRegionFilter; import com.boydti.fawe.util.TaskManager; import com.sk89q.worldedit.math.BlockVector2; diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/preloader/PluginPreloader.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/preloader/PluginPreloader.java index 05fbb2f5f..91c8ff3a0 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/preloader/PluginPreloader.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/preloader/PluginPreloader.java @@ -3,7 +3,6 @@ package com.boydti.fawe.bukkit.preloader; import com.boydti.fawe.Fawe; import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.math.BlockVector2; -import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.Region; import org.bukkit.Server; import org.bukkit.World; @@ -19,7 +18,6 @@ import org.jetbrains.annotations.Nullable; import java.io.File; import java.io.InputStream; -import java.lang.ref.PhantomReference; import java.util.Iterator; import java.util.List; import java.util.Set; diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/BukkitMaskManager.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/BukkitMaskManager.java index 02c9d69d7..921c7ab0b 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/BukkitMaskManager.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/BukkitMaskManager.java @@ -1,7 +1,6 @@ package com.boydti.fawe.bukkit.regions; import com.boydti.fawe.regions.FaweMaskManager; -import org.bukkit.entity.Player; import org.bukkit.permissions.Permissible; public abstract class BukkitMaskManager extends FaweMaskManager { diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitItemStack.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitItemStack.java index e1109f6fb..0964dbd52 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitItemStack.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitItemStack.java @@ -7,7 +7,6 @@ import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.world.item.ItemType; import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; import javax.annotation.Nullable; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java index 0bbdd8a2b..dd308ba4c 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/EditSessionBlockChangeDelegate.java @@ -21,8 +21,6 @@ package com.sk89q.worldedit.bukkit; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; -import com.sk89q.worldedit.math.BlockVector3; - import org.bukkit.BlockChangeDelegate; import org.bukkit.block.data.BlockData; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index f8578e967..f40151e3f 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -82,7 +82,6 @@ import java.nio.file.Paths; import java.util.List; import java.util.Locale; import java.util.Optional; -import java.util.logging.Level; import static com.boydti.fawe.bukkit.util.JavaVersionCheck.checkJvm; import static com.google.common.base.Preconditions.checkNotNull; diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldUnloadedException.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldUnloadedException.java index a11aa42d6..e8ba56d38 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldUnloadedException.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldUnloadedException.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit.bukkit; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; /** * Thrown if the world has been unloaded. @@ -31,6 +31,6 @@ class WorldUnloadedException extends WorldEditException { * Create a new instance. */ WorldUnloadedException() { - super(TranslatableComponent.of("worldedit.error.world-unloaded")); + super(Caption.of("worldedit.error.world-unloaded")); } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/IDelegateBukkitImplAdapter.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/IDelegateBukkitImplAdapter.java index 5bf4d88af..8f380fc06 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/IDelegateBukkitImplAdapter.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/adapter/IDelegateBukkitImplAdapter.java @@ -12,7 +12,6 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.util.Direction; -import com.sk89q.worldedit.util.SideEffectSet; import com.sk89q.worldedit.world.DataFixer; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BaseBlock; diff --git a/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIWorldEdit.java b/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIWorldEdit.java index 5e3638beb..1413553dd 100644 --- a/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIWorldEdit.java +++ b/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIWorldEdit.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.cli; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.cli.data.FileRegistries; 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.internal.util.LogManagerCompat; 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.block.BlockCategory; import com.sk89q.worldedit.world.block.BlockState; @@ -238,13 +238,13 @@ public class CLIWorldEdit { while (scanner.hasNextLine()) { String line = scanner.nextLine(); if (line.equals("stop")) { - commandSender.printInfo(TranslatableComponent.of("worldedit.cli.stopping")); + commandSender.print(Caption.of("worldedit.cli.stopping")); break; } CommandEvent event = new CommandEvent(commandSender, line); WorldEdit.getInstance().getEventBus().post(event); if (!event.isCancelled()) { - commandSender.printError(TranslatableComponent.of("worldedit.cli.unknown-command")); + commandSender.print(Caption.of("worldedit.cli.unknown-command")); } else { saveAllWorlds(false); } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/FaweCache.java b/worldedit-core/src/main/java/com/boydti/fawe/FaweCache.java index a2461c55f..5de161736 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/FaweCache.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/FaweCache.java @@ -4,6 +4,7 @@ import com.boydti.fawe.beta.IChunkSet; import com.boydti.fawe.beta.Trimable; import com.boydti.fawe.beta.implementation.queue.Pool; import com.boydti.fawe.beta.implementation.queue.QueuePool; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.collection.BitArray; 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 FaweBlockBagException BLOCK_BAG = new FaweBlockBagException(); - public static final FaweException MANUAL = new FaweException(TranslatableComponent.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 OUTSIDE_REGION = new FaweException(TranslatableComponent.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_CHANGES = new FaweException(TranslatableComponent.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 MAX_ENTITIES = new FaweException(TranslatableComponent.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_ITERATIONS = new FaweException(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.max.iterations")); + public static final FaweException MANUAL = new FaweException(Caption.of("fawe.cancel.worldedit.cancel.reason.manual")); + 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(Caption.of("fawe.cancel.worldedit.cancel.reason.outside.region")); + 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(Caption.of("fawe.cancel.worldedit.cancel.reason.max.changes")); + 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(Caption.of("fawe.cancel.worldedit.cancel.reason.max.entities")); + 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(Caption.of("fawe.cancel.worldedit.cancel.reason.max.iterations")); /* thread cache diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CatenaryBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CatenaryBrush.java index eb95ef9e0..02872f046 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CatenaryBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CatenaryBrush.java @@ -69,7 +69,7 @@ public class CatenaryBrush implements Brush, ResettableTool { e.printStackTrace(); } if (!visual) { - player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.line.secondary")); + player.print(Caption.of("fawe.worldedit.brush.brush.line.secondary")); if (!select) { pos1 = null; return; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CopyPastaBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CopyPastaBrush.java index 0d0c36a5f..d53b11b0b 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CopyPastaBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/CopyPastaBrush.java @@ -45,7 +45,7 @@ public class CopyPastaBrush implements Brush, ResettableTool { @Override public boolean reset() { session.setClipboard(null); - player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.reset")); + player.print(Caption.of("fawe.worldedit.brush.brush.reset")); return true; } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/HeightBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/HeightBrush.java index d489d2fe2..9bedcf866 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/HeightBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/HeightBrush.java @@ -1,5 +1,6 @@ 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.RotatableHeightMap; import com.boydti.fawe.object.brush.heightmap.ScalableHeightMap; @@ -44,7 +45,7 @@ public class HeightBrush implements Brush { try { heightMap = ScalableHeightMap.fromPNG(stream); } 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) { heightMap = ScalableHeightMap.fromClipboard(clipboard); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/LineBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/LineBrush.java index e38bf08e2..f7a06e017 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/LineBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/LineBrush.java @@ -34,7 +34,7 @@ public class LineBrush implements Brush, ResettableTool { } editSession.drawLine(pattern, pos1, position, size, !shell, flat); 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) { pos1 = null; } else { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SplineBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SplineBrush.java index 8097f2104..aca3ebd08 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SplineBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SplineBrush.java @@ -1,6 +1,7 @@ package com.boydti.fawe.object.brush; import com.boydti.fawe.FaweCache; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.object.brush.visualization.VisualExtent; import com.boydti.fawe.object.mask.IdMask; 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.Vector3; import com.sk89q.worldedit.math.interpolation.Node; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import java.util.ArrayList; import java.util.Collection; @@ -93,13 +93,13 @@ public class SplineBrush implements Brush, ResettableTool { points.add(position); } 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) { return; } } 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; } List centroids = new ArrayList<>(); @@ -131,7 +131,7 @@ public class SplineBrush implements Brush, ResettableTool { } 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) { numSplines = originalSize; positionSets.remove(positionSets.size() - 1); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SurfaceSpline.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SurfaceSpline.java index a4225e4d2..2b36af67a 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SurfaceSpline.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/SurfaceSpline.java @@ -1,5 +1,6 @@ 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.collection.LocalBlockVectorSet; import com.boydti.fawe.util.MathMan; @@ -43,7 +44,7 @@ public class SurfaceSpline implements Brush { return; } 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) { return; } @@ -107,6 +108,6 @@ public class SurfaceSpline implements Brush { path.clear(); } } - editSession.getPlayer().printInfo(TranslatableComponent.of("fawe.worldedit.brush.spline.secondary")); + editSession.getPlayer().print(Caption.of("fawe.worldedit.brush.spline.secondary")); } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/SweepBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/SweepBrush.java index b8b582d78..d5f17e5f8 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/SweepBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/sweep/SweepBrush.java @@ -1,5 +1,6 @@ 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.visualization.VisualExtent; 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.transform.AffineTransform; import com.sk89q.worldedit.session.ClipboardHolder; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import java.util.ArrayList; import java.util.List; @@ -53,13 +53,13 @@ public class SweepBrush implements Brush, ResettableTool { return; } 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); return; } 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; } @@ -111,7 +111,7 @@ public class SweepBrush implements Brush, ResettableTool { break; } } - player.print(TranslatableComponent.of("fawe.worldedit.brush.spline.secondary")); + player.print(Caption.of("fawe.worldedit.brush.spline.secondary")); reset(); } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/exception/FaweBlockBagException.java b/worldedit-core/src/main/java/com/boydti/fawe/object/exception/FaweBlockBagException.java index ffafd8dec..c81da506c 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/exception/FaweBlockBagException.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/exception/FaweBlockBagException.java @@ -1,9 +1,9 @@ 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 FaweBlockBagException() { - super(TranslatableComponent.of("fawe.error.worldedit.some.fails.blockbag")); + super(Caption.of("fawe.error.worldedit.some.fails.blockbag")); } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/exception/FaweChunkLoadException.java b/worldedit-core/src/main/java/com/boydti/fawe/object/exception/FaweChunkLoadException.java index afbe67b20..15ace72ba 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/exception/FaweChunkLoadException.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/exception/FaweChunkLoadException.java @@ -1,9 +1,9 @@ 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 FaweChunkLoadException() { - super(TranslatableComponent.of("fawe.cancel.worldedit.failed.load.chunk")); + super(Caption.of("fawe.cancel.worldedit.failed.load.chunk")); } } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/MemoryCheckingExtent.java b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/MemoryCheckingExtent.java index 337425da1..0d20dca58 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/MemoryCheckingExtent.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/MemoryCheckingExtent.java @@ -1,13 +1,13 @@ package com.boydti.fawe.object.extent; import com.boydti.fawe.FaweCache; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.util.MemUtil; import com.boydti.fawe.util.Permission; import com.boydti.fawe.util.WEManager; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.PassthroughExtent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; public class MemoryCheckingExtent extends PassthroughExtent { @@ -22,10 +22,10 @@ public class MemoryCheckingExtent extends PassthroughExtent { public Extent getExtent() { if (MemUtil.isMemoryLimited()) { if (this.player != null) { - player.print(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason", - TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.low.memory"))); + player.print(Caption.of("fawe.cancel.worldedit.cancel.reason", + Caption.of("fawe.cancel.worldedit.cancel.reason.low.memory"))); 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); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/progress/DefaultProgressTracker.java b/worldedit-core/src/main/java/com/boydti/fawe/object/progress/DefaultProgressTracker.java index 90e605c30..5ab05eb24 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/progress/DefaultProgressTracker.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/progress/DefaultProgressTracker.java @@ -7,7 +7,6 @@ import com.boydti.fawe.util.TaskManager; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import java.util.function.BiConsumer; @@ -104,7 +103,7 @@ public class DefaultProgressTracker implements BiConsumer getStatusMessages() { - return Lists.newArrayList(TranslatableComponent.of( + return Lists.newArrayList(Caption.of( "fawe.worldedit.visitor.visitor.block", TextComponent.of(getAffected()) - ).color(TextColor.GRAY)); + )); } public int getAffected() { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/util/EditSessionBuilder.java b/worldedit-core/src/main/java/com/boydti/fawe/util/EditSessionBuilder.java index c232d3fff..f2062d50c 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/util/EditSessionBuilder.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/util/EditSessionBuilder.java @@ -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.processors.LimitExtent; import com.boydti.fawe.beta.implementation.queue.ParallelQueueExtent; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.config.Settings; import com.boydti.fawe.logging.rollback.RollbackOptimizedHistory; 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.util.Identifiable; 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.world.World; import org.apache.logging.log4j.Logger; @@ -240,11 +242,11 @@ public class EditSessionBuilder { } if (Settings.IMP.EXTENT.DEBUG) { if (event.getActor() != null) { - event.getActor().printDebug(TranslatableComponent.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(TranslatableComponent.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(TranslatableComponent.of(" - To hide this message set `debug` to false in the FAWE config.yml")); + event.getActor().printDebug(TextComponent.of("Potentially unsafe extent blocked: " + toReturn.getClass().getName())); + event.getActor().printDebug(TextComponent.of(" - For area restrictions, it is recommended to use the FaweAPI")); + event.getActor().printDebug(TextComponent.of(" - For block logging, it is recommended to use BlocksHub")); + event.getActor().printDebug(TextComponent.of(" - To allow this plugin add it to the FAWE `allowed-plugins` list")); + event.getActor().printDebug(TextComponent.of(" - To hide this message set `debug` to false in the FAWE config.yml")); } else { LOGGER.debug("Potentially unsafe extent blocked: " + toReturn.getClass().getName()); LOGGER.debug(" - For area restrictions, it is recommended to use the FaweAPI"); @@ -300,7 +302,7 @@ public class EditSessionBuilder { if (checkMemory) { if (MemUtil.isMemoryLimitedSlow()) { 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; } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/util/MainUtil.java b/worldedit-core/src/main/java/com/boydti/fawe/util/MainUtil.java index c53fe0f29..ee846eb9c 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/util/MainUtil.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/util/MainUtil.java @@ -1,6 +1,7 @@ package com.boydti.fawe.util; import com.boydti.fawe.Fawe; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.FaweInputStream; import com.boydti.fawe.object.FaweOutputStream; @@ -880,7 +881,7 @@ public class MainUtil { long age = now - file.lastModified(); if (age > timeDiff) { pool.submit(file::delete); - Component msg = TranslatableComponent.of("worldedit.schematic.delete.deleted"); + Component msg = Caption.of("worldedit.schematic.delete.deleted"); if (printDebug) { LOGGER.debug(msg.toString()); } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/util/WEManager.java b/worldedit-core/src/main/java/com/boydti/fawe/util/WEManager.java index 338c49297..b2a4d7c85 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/util/WEManager.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/util/WEManager.java @@ -1,5 +1,6 @@ package com.boydti.fawe.util; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.RegionWrapper; import com.boydti.fawe.object.exception.FaweException; @@ -89,7 +90,7 @@ public class WEManager { backupRegions.add(region); } } else { - player.printDebug(TextComponent.of("Invalid Mask")); + player.print(Caption.of("Invalid Mask")); removed = true; iterator.remove(); } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/util/image/ImageUtil.java b/worldedit-core/src/main/java/com/boydti/fawe/util/image/ImageUtil.java index afafaf0e5..a24613d4d 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/util/image/ImageUtil.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/util/image/ImageUtil.java @@ -1,6 +1,7 @@ package com.boydti.fawe.util.image; import com.boydti.fawe.Fawe; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.config.Settings; import com.boydti.fawe.util.MainUtil; import com.boydti.fawe.util.MathMan; @@ -175,7 +176,7 @@ public class ImageUtil { try { return MainUtil.readImage(getInputStream(uri)); } 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(); } 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); 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) { - 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(), Settings.IMP.PATHS.HEIGHTMAP), arg); 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()) { - 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(); } - 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) { - throw new InputParseException(TranslatableComponent.of(e.getMessage())); + throw new InputParseException(Caption.of(e.getMessage())); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 33807746b..0fb662709 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -1086,9 +1086,9 @@ public class EditSession extends PassthroughExtent implements AutoCloseable { if (used.MAX_CHANGES > 0 || used.MAX_ENTITIES > 0) { player.print(Caption.of("fawe.error.worldedit.some.fails", used.MAX_FAILS)); } else if (new ExtentTraverser<>(getExtent()).findAndGet(FaweRegionExtent.class) != null) { - player.printError(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.outside.region")); + player.print(Caption.of("fawe.cancel.worldedit.cancel.reason.outside.region")); } else { - player.printError(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.outside.level")); + player.print(Caption.of("fawe.cancel.worldedit.cancel.reason.outside.level")); } } if (wnaMode) { @@ -1112,7 +1112,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable { } } } catch (Throwable e) { - player.printError(TranslatableComponent.of("fawe.error.lighting")); + player.print(Caption.of("fawe.error.lighting")); e.printStackTrace(); } // Enqueue it diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/MissingWorldException.java b/worldedit-core/src/main/java/com/sk89q/worldedit/MissingWorldException.java index 808bd430b..108cdc744 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/MissingWorldException.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/MissingWorldException.java @@ -19,7 +19,7 @@ package com.sk89q.worldedit; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; +import com.boydti.fawe.config.Caption; /** * Raised when a world is missing but is required. @@ -27,6 +27,6 @@ import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; public class MissingWorldException extends WorldEditException { public MissingWorldException() { - super(TranslatableComponent.of("worldedit.error.missing-world")); + super(Caption.of("worldedit.error.missing-world")); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/NotABlockException.java b/worldedit-core/src/main/java/com/sk89q/worldedit/NotABlockException.java index 4a43cf9dc..f9177e129 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/NotABlockException.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/NotABlockException.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.world.item.ItemType; /** @@ -32,7 +32,7 @@ public class NotABlockException extends WorldEditException { * Create a new instance. */ public NotABlockException() { - super(TranslatableComponent.of("worldedit.error.not-a-block")); + super(Caption.of("worldedit.error.not-a-block")); } /** @@ -42,7 +42,7 @@ public class NotABlockException extends WorldEditException { */ @Deprecated public NotABlockException(String input) { - super(TranslatableComponent.of("worldedit.error.not-a-block.item", TextComponent.of(input))); + super(Caption.of("worldedit.error.not-a-block.item", TextComponent.of(input))); } /** @@ -52,7 +52,7 @@ public class NotABlockException extends WorldEditException { */ @Deprecated public NotABlockException(int input) { - super(TranslatableComponent.of("worldedit.error.not-a-block.item", TextComponent.of(input))); + super(Caption.of("worldedit.error.not-a-block.item", TextComponent.of(input))); } /** @@ -61,6 +61,6 @@ public class NotABlockException extends WorldEditException { * @param input the input that was used */ public NotABlockException(ItemType input) { - super(TranslatableComponent.of("worldedit.error.not-a-block.item", input.getRichName())); + super(Caption.of("worldedit.error.not-a-block.item", input.getRichName())); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/UnknownDirectionException.java b/worldedit-core/src/main/java/com/sk89q/worldedit/UnknownDirectionException.java index 9ba595d1a..9cba96cfa 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/UnknownDirectionException.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/UnknownDirectionException.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; /** * Thrown when an unknown direction is specified or detected. @@ -35,7 +35,7 @@ public class UnknownDirectionException extends WorldEditException { * @param dir the input that was tried */ public UnknownDirectionException(String dir) { - super(TranslatableComponent.of("worldedit.error.unknown-direction", TextComponent.of(dir))); + super(Caption.of("worldedit.error.unknown-direction", TextComponent.of(dir))); this.dir = dir; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java index d69fe18f8..0aaba5dee 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/WorldEdit.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit; +import com.boydti.fawe.config.Caption; import com.google.common.base.Throwables; import com.google.common.collect.HashMultimap; import com.google.common.collect.ImmutableList; @@ -58,7 +59,6 @@ import com.sk89q.worldedit.util.concurrency.EvenMoreExecutors; import com.sk89q.worldedit.util.concurrency.LazyReference; import com.sk89q.worldedit.util.eventbus.EventBus; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; import com.sk89q.worldedit.util.io.file.FileSelectionAbortedException; import com.sk89q.worldedit.util.io.file.FilenameException; @@ -315,7 +315,7 @@ public final class WorldEdit { } if (f == null) { - throw new FileSelectionAbortedException(TranslatableComponent.of("worldedit.error.no-file-selected")); + throw new FileSelectionAbortedException(Caption.of("worldedit.error.no-file-selected")); } } else { List exts = extensions == null ? ImmutableList.of(defaultExt) : Lists.asList(defaultExt, extensions); @@ -334,12 +334,12 @@ public final class WorldEdit { boolean isSym = existingParent != null && !existingParent.toRealPath().equals(existingParent); if (!inDir || (!getConfiguration().allowSymlinks && isSym)) { - throw new FilenameResolutionException(filename, TranslatableComponent.of("worldedit.error.file-resolution.outside-root")); + throw new FilenameResolutionException(filename, Caption.of("worldedit.error.file-resolution.outside-root")); } return filePath.toFile(); } catch (IOException e) { - throw new FilenameResolutionException(filename, TranslatableComponent.of("worldedit.error.file-resolution.resolve-failed")); + throw new FilenameResolutionException(filename, Caption.of("worldedit.error.file-resolution.resolve-failed")); } } @@ -366,7 +366,7 @@ public final class WorldEdit { result = getSafeFileWithExtension(dir, filename, iter.next()); } if (result == null) { - throw new InvalidFilenameException(filename, TranslatableComponent.of("worldedit.error.invalid-filename.invalid-characters")); + throw new InvalidFilenameException(filename, Caption.of("worldedit.error.invalid-filename.invalid-characters")); } return result; } @@ -717,7 +717,7 @@ public final class WorldEdit { String ext = filename.substring(index + 1); if (!ext.equalsIgnoreCase("js")) { - player.printError(TranslatableComponent.of("worldedit.script.unsupported")); + player.print(Caption.of("worldedit.script.unsupported")); return; } @@ -730,7 +730,7 @@ public final class WorldEdit { file = WorldEdit.class.getResourceAsStream("craftscripts/" + filename); if (file == null) { - player.printError(TranslatableComponent.of("worldedit.script.file-not-found", TextComponent.of(filename))); + player.print(Caption.of("worldedit.script.file-not-found", TextComponent.of(filename))); return; } } else { @@ -743,7 +743,7 @@ public final class WorldEdit { in.close(); script = new String(data, 0, data.length, StandardCharsets.UTF_8); } catch (IOException e) { - player.printError(TranslatableComponent.of("worldedit.script.read-error", TextComponent.of(e.getMessage()))); + player.print(Caption.of("worldedit.script.read-error", TextComponent.of(e.getMessage()))); return; } @@ -756,7 +756,7 @@ public final class WorldEdit { try { engine = new RhinoCraftScriptEngine(); } catch (NoClassDefFoundError ignored) { - player.printError(TranslatableComponent.of("worldedit.script.no-script-engine")); + player.print(Caption.of("worldedit.script.no-script-engine")); return; } @@ -772,13 +772,13 @@ public final class WorldEdit { } catch (ScriptException e) { // non-exceptional return check if (!(Throwables.getRootCause(e) instanceof ReturnException)) { - player.printError(TranslatableComponent.of("worldedit.script.failed", TextComponent.of(e.getMessage(), TextColor.WHITE))); + player.print(Caption.of("worldedit.script.failed", TextComponent.of(e.getMessage(), TextColor.WHITE))); logger.warn("Failed to execute script", e); } } catch (NumberFormatException | WorldEditException e) { throw e; } catch (Throwable e) { - player.printError(TranslatableComponent.of("worldedit.script.failed-console", TextComponent.of(e.getClass().getCanonicalName(), + player.print(Caption.of("worldedit.script.failed-console", TextComponent.of(e.getClass().getCanonicalName(), TextColor.WHITE))); logger.warn("Failed to execute script", e); } finally { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ApplyBrushCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ApplyBrushCommands.java index ad2e993a0..6828e457a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ApplyBrushCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ApplyBrushCommands.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command; +import com.boydti.fawe.config.Caption; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.sk89q.worldedit.LocalSession; @@ -41,7 +42,6 @@ import com.sk89q.worldedit.internal.expression.Expression; import com.sk89q.worldedit.regions.factory.RegionFactory; import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; import com.sk89q.worldedit.util.formatting.text.format.TextDecoration; import org.enginehub.piston.CommandManager; @@ -62,19 +62,19 @@ import static org.enginehub.piston.part.CommandParts.arg; @CommandContainer(superTypes = CommandPermissionsConditionGenerator.Registration.class) public class ApplyBrushCommands { - private static final CommandArgument REGION_FACTORY = arg(TranslatableComponent.of("shape"), TranslatableComponent.of("worldedit.brush.apply.shape")) + private static final CommandArgument REGION_FACTORY = arg(Caption.of("shape"), Caption.of("worldedit.brush.apply.shape")) .defaultsTo(ImmutableList.of()) .ofTypes(ImmutableList.of(Key.of(RegionFactory.class))) .build(); - private static final CommandArgument RADIUS = arg(TranslatableComponent.of("radius"), TranslatableComponent.of("worldedit.brush.apply.radius")) + private static final CommandArgument RADIUS = arg(Caption.of("radius"), Caption.of("worldedit.brush.apply.radius")) .defaultsTo(ImmutableList.of("5")) .ofTypes(ImmutableList.of(Key.of(double.class))) .build(); public static void register(CommandManagerService service, CommandManager commandManager, CommandRegistrationHandler registration) { commandManager.register("apply", builder -> { - builder.description(TranslatableComponent.of("worldedit.brush.apply.description")); + builder.description(Caption.of("worldedit.brush.apply.description")); builder.action(org.enginehub.piston.Command.Action.NULL_ACTION); CommandManager manager = service.newCommandManager(); @@ -86,7 +86,7 @@ public class ApplyBrushCommands { builder.condition(new PermissionCondition(ImmutableSet.of("worldedit.brush.apply"))); builder.addParts(REGION_FACTORY, RADIUS); - builder.addPart(SubCommandPart.builder(TranslatableComponent.of("type"), TranslatableComponent.of("worldedit.brush.apply.type")) + builder.addPart(SubCommandPart.builder(Caption.of("type"), Caption.of("worldedit.brush.apply.type")) .withCommands(manager.getAllCommands().collect(Collectors.toList())) .required() .build()); @@ -126,7 +126,7 @@ public class ApplyBrushCommands { @Direction(includeDiagonals = true) com.sk89q.worldedit.util.Direction direction) throws WorldEditException { player.print(TextComponent.builder().append("WARNING: ", TextColor.RED, TextDecoration.BOLD) - .append(TranslatableComponent.of("worldedit.brush.apply.item.warning")).build()); + .append(Caption.of("worldedit.brush.apply.item.warning")).build()); setApplyBrush(parameters, player, localSession, new ItemUseFactory(item, direction)); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java index 793fd19c2..c0094f38a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BiomeCommands.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; @@ -49,7 +50,6 @@ import com.sk89q.worldedit.util.formatting.component.PaginationBox; import com.sk89q.worldedit.util.formatting.component.TextUtils; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.event.HoverEvent; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BiomeType; @@ -124,7 +124,7 @@ public class BiomeCommands { if (useLineOfSight) { Location blockPosition = player.getBlockTrace(300); if (blockPosition == null) { - player.printError(TranslatableComponent.of("worldedit.raytrace.noblock")); + player.print(Caption.of("worldedit.raytrace.noblock")); return; } @@ -153,7 +153,7 @@ public class BiomeCommands { HoverEvent.showText(TextComponent.of(biome.getId())) ) ).collect(Collectors.toList()); - player.printInfo(TranslatableComponent.of(messageKey, TextUtils.join(components, TextComponent.of(", ")))); + player.print(Caption.of(messageKey, TextUtils.join(components, TextComponent.of(", ")))); } @Command( @@ -185,7 +185,7 @@ public class BiomeCommands { RegionVisitor visitor = new RegionVisitor(region, replace); Operations.completeLegacy(visitor); - player.printInfo(TranslatableComponent.of( + player.print(Caption.of( "worldedit.setbiome.changed", TextComponent.of(visitor.getAffected()) )); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java index 020300fcd..8599f9c92 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java @@ -106,7 +106,6 @@ import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.event.ClickEvent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; import com.sk89q.worldedit.world.block.BlockID; @@ -315,7 +314,7 @@ public class BrushCommands { public void sweepBrush(Player player, InjectedValueAccess context, @Arg(desc = "int", def = "-1") int copies) throws WorldEditException { - player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.spline")); + player.print(Caption.of("fawe.worldedit.brush.brush.spline")); set(context, new SweepBrush(copies)); } @@ -428,7 +427,7 @@ public class BrushCommands { case BlockID.SAND: case BlockID.GRAVEL: player.print( - TranslatableComponent.of("fawe.worldedit.brush.brush.try.other")); + Caption.of("fawe.worldedit.brush.brush.try.other")); falling = true; break; default: @@ -1111,7 +1110,7 @@ public class BrushCommands { } player.print(Caption.of("fawe.worldedit.schematic.schematic.saved", name)); } else { - player.printError(TranslatableComponent.of("fawe.worldedit.brush.brush.none")); + player.print(Caption.of("fawe.worldedit.brush.brush.none")); } } @@ -1145,7 +1144,7 @@ public class BrushCommands { player.print(Caption.of("fawe.worldedit.brush.brush.equipped", name)); } catch (Throwable e) { e.printStackTrace(); - player.printError(TranslatableComponent.of("fawe.error.brush.incompatible")); + player.print(Caption.of("fawe.error.brush.incompatible")); } } */ @@ -1273,7 +1272,7 @@ public class BrushCommands { tool.setFill(null); tool.setBrush(new OperationFactoryBrush(factory, shape, session), permission); - player.printInfo(TranslatableComponent.of("worldedit.brush.operation.equip", TextComponent.of(factory.toString()))); + player.print(Caption.of("worldedit.brush.operation.equip", TextComponent.of(factory.toString()))); ToolCommands.sendUnbindInstruction(player, UNBIND_COMMAND_COMPONENT); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java index 2b075e56c..f1662f439 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ChunkCommands.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command; +import com.boydti.fawe.config.Caption; import com.google.gson.JsonIOException; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; @@ -86,9 +87,9 @@ public class ChunkCommands { int chunkZ = (int) Math.floor(pos.getBlockZ() / 16.0); final BlockVector2 chunkPos = BlockVector2.at(chunkX, chunkZ); - player.printInfo(TranslatableComponent.of("worldedit.chunkinfo.chunk", TextComponent.of(chunkX), TextComponent.of(chunkZ))); - player.printInfo(TranslatableComponent.of("worldedit.chunkinfo.old-filename", TextComponent.of(LegacyChunkStore.getFilename(chunkPos)))); - player.printInfo(TranslatableComponent.of("worldedit.chunkinfo.mcregion-filename", TextComponent.of(McRegionChunkStore.getFilename(chunkPos)))); + player.print(Caption.of("worldedit.chunkinfo.chunk", TextComponent.of(chunkX), TextComponent.of(chunkZ))); + player.print(Caption.of("worldedit.chunkinfo.old-filename", TextComponent.of(LegacyChunkStore.getFilename(chunkPos)))); + player.print(Caption.of("worldedit.chunkinfo.mcregion-filename", TextComponent.of(McRegionChunkStore.getFilename(chunkPos)))); } @Command( @@ -101,7 +102,7 @@ public class ChunkCommands { @ArgFlag(name = 'p', desc = "Page number.", def = "1") int page) throws WorldEditException { final Region region = session.getSelection(world); - actor.print(TranslatableComponent.of("worldedit.listchunks.listfor", TextComponent.of(actor.getName()))); + actor.print(Caption.of("worldedit.listchunks.listfor", TextComponent.of(actor.getName()))); actor.print(new ChunkListPaginationBox(region).create(page)); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java index 5d5cc7f1f..8743e1e1d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java @@ -77,7 +77,6 @@ import com.sk89q.worldedit.regions.selector.CuboidRegionSelector; import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.event.ClickEvent; import com.sk89q.worldedit.world.World; import org.enginehub.piston.annotation.Command; @@ -185,7 +184,7 @@ public class ClipboardCommands { long volume = (((long) max.getX() - (long) min.getX() + 1) * ((long) max.getY() - (long) min.getY() + 1) * ((long) max.getZ() - (long) min.getZ() + 1)); FaweLimit limit = actor.getLimit(); if (volume >= limit.MAX_CHECKS) { - throw new FaweException(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.max.checks")); + throw new FaweException(Caption.of("fawe.cancel.worldedit.cancel.reason.max.checks")); } session.setClipboard(null); ReadOnlyClipboard lazyClipboard = ReadOnlyClipboard.of(region, !skipEntities, copyBiomes); @@ -224,7 +223,7 @@ public class ClipboardCommands { ReadOnlyClipboard lazyClipboard = new WorldCutClipboard(editSession, region, !skipEntities, copyBiomes); clipboard.setOrigin(session.getPlacementPosition(actor)); session.setClipboard(new ClipboardHolder(lazyClipboard)); - actor.print(TranslatableComponent.of("fawe.worldedit.cut.command.cut.lazy", region.getArea())); + actor.print(Caption.of("fawe.worldedit.cut.command.cut.lazy", region.getArea())); }*/ @Command( @@ -289,7 +288,7 @@ public class ClipboardCommands { session.setClipboard(new ClipboardHolder(clipboard)); if (!actor.hasPermission("fawe.tips")) { - actor.print(TranslatableComponent.of("fawe.tips.tip.lazycut")); + actor.print(Caption.of("fawe.tips.tip.lazycut")); } copy.getStatusMessages().forEach(actor::print); } @@ -384,7 +383,7 @@ public class ClipboardCommands { } } if (url == null) { - player.printError(TranslatableComponent.of("fawe.web.generating.link.failed")); + player.print(Caption.of("fawe.web.generating.link.failed")); } else { String urlText = url.toString(); if (Settings.IMP.WEB.SHORTEN_URLS) { @@ -459,9 +458,9 @@ public class ClipboardCommands { } if (onlySelect) { - actor.printInfo(TranslatableComponent.of("worldedit.paste.selected")); + actor.print(Caption.of("worldedit.paste.selected")); } else { - actor.printInfo(TranslatableComponent.of("worldedit.paste.pasted", TextComponent.of(to.toString()))); + actor.print(Caption.of("worldedit.paste.pasted", TextComponent.of(to.toString()))); } messages.forEach(actor::print); } @@ -474,7 +473,7 @@ public class ClipboardCommands { PasteEvent event = new PasteEvent(player, clipboard, uri, editSession, to); WorldEdit.getInstance().getEventBus().post(event); if (event.isCancelled()) { - throw new FaweException(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.manual")); + throw new FaweException(Caption.of("fawe.cancel.worldedit.cancel.reason.manual")); } } @@ -516,7 +515,7 @@ public class ClipboardCommands { actor.print(Caption.of("fawe.worldedit.paste.command.paste", to)); if (!actor.hasPermission("fawe.tips")) { - actor.print(TranslatableComponent.of("fawe.tips.tip.copypaste")); + actor.print(Caption.of("fawe.tips.tip.copypaste")); } } @@ -541,7 +540,7 @@ public class ClipboardCommands { transform = transform.rotateX(-rotateX); transform = transform.rotateZ(-rotateZ); holder.setTransform(transform.combine(holder.getTransform())); - actor.printInfo(TranslatableComponent.of("worldedit.rotate.rotated")); + actor.print(Caption.of("worldedit.rotate.rotated")); } @Command( @@ -556,7 +555,7 @@ public class ClipboardCommands { AffineTransform transform = new AffineTransform(); transform = transform.scale(direction.abs().multiply(-2).add(1, 1, 1).toVector3()); holder.setTransform(transform.combine(holder.getTransform())); - actor.printInfo(TranslatableComponent.of("worldedit.flip.flipped")); + actor.print(Caption.of("worldedit.flip.flipped")); } @Command( @@ -567,7 +566,7 @@ public class ClipboardCommands { @CommandPermissions("worldedit.clipboard.clear") public void clearClipboard(Actor actor, LocalSession session) throws WorldEditException { session.setClipboard(null); - actor.printInfo(TranslatableComponent.of("worldedit.clearclipboard.cleared")); + actor.print(Caption.of("worldedit.clearclipboard.cleared")); } private void saveDiskClipboard(Clipboard clipboard) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ExpandCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ExpandCommands.java index 8c3d45366..976372191 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ExpandCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ExpandCommands.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command; +import com.boydti.fawe.config.Caption; import com.google.common.collect.ImmutableSet; import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.LocalSession; @@ -33,7 +34,6 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.RegionOperationException; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.world.World; import org.enginehub.piston.Command; import org.enginehub.piston.CommandManager; @@ -73,7 +73,7 @@ public class ExpandCommands { command.condition(new PermissionCondition(ImmutableSet.of("worldedit.selection.expand"))); command.addPart(SubCommandPart.builder( - TranslatableComponent.of("vert"), + Caption.of("vert"), TextComponent.of("Vertical expansion sub-command") ) .withCommands(ImmutableSet.of(createVertCommand(commandManager))) @@ -88,7 +88,7 @@ public class ExpandCommands { private static Command createVertCommand(CommandManager commandManager) { return commandManager.newCommand("vert") - .description(TranslatableComponent.of("worldedit.expand.description.vert")) + .description(Caption.of("worldedit.expand.description.vert")) .action(parameters -> { expandVert( requireIV(Key.of(LocalSession.class), "localSession", parameters), @@ -112,7 +112,7 @@ public class ExpandCommands { session.getRegionSelector(world).explainRegionAdjust(actor, session); long changeSize = newSize - oldSize; actor.printInfo( - TranslatableComponent.of("worldedit.expand.expanded.vert", TextComponent.of(changeSize)) + Caption.of("worldedit.expand.expanded.vert", TextComponent.of(changeSize)) ); } catch (RegionOperationException e) { actor.printError(TextComponent.of(e.getMessage())); @@ -151,7 +151,7 @@ public class ExpandCommands { session.getRegionSelector(world).explainRegionAdjust(actor, session); long changeSize = newSize - oldSize; - actor.printInfo(TranslatableComponent.of("worldedit.expand.expanded", TextComponent.of(changeSize))); + actor.print(Caption.of("worldedit.expand.expanded", TextComponent.of(changeSize))); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java index 1861da9ab..9724de8f8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GeneralCommands.java @@ -172,7 +172,7 @@ public class GeneralCommands { limit = limit == null ? config.defaultChangeLimit : Math.max(-1, limit); if (!mayDisable && config.maxChangeLimit > -1) { if (limit > config.maxChangeLimit) { - actor.printError(TranslatableComponent.of("worldedit.limit.too-high", TextComponent.of(config.maxChangeLimit))); + actor.print(Caption.of("worldedit.limit.too-high", TextComponent.of(config.maxChangeLimit))); return; } } @@ -199,7 +199,7 @@ public class GeneralCommands { limit = limit == null ? config.calculationTimeout : Math.max(-1, limit); if (!mayDisable && config.maxCalculationTimeout > -1) { if (limit > config.maxCalculationTimeout) { - actor.printError(TranslatableComponent.of("worldedit.timeout.too-high", TextComponent.of(config.maxCalculationTimeout))); + actor.print(Caption.of("worldedit.timeout.too-high", TextComponent.of(config.maxCalculationTimeout))); return; } } @@ -223,16 +223,16 @@ public class GeneralCommands { Boolean fastMode) { boolean hasFastMode = session.hasFastMode(); if (fastMode != null && fastMode == hasFastMode) { - actor.printError(TranslatableComponent.of(fastMode ? "worldedit.fast.enabled.already" : "worldedit.fast.disabled.already")); + actor.print(Caption.of(fastMode ? "worldedit.fast.enabled.already" : "worldedit.fast.disabled.already")); return; } if (hasFastMode) { session.setFastMode(false); - actor.printInfo(TranslatableComponent.of("worldedit.fast.disabled")); + actor.print(Caption.of("worldedit.fast.disabled")); } else { session.setFastMode(true); - actor.printInfo(TranslatableComponent.of("worldedit.fast.enabled")); + actor.print(Caption.of("worldedit.fast.enabled")); } } @@ -254,7 +254,7 @@ public class GeneralCommands { SideEffect.State currentState = session.getSideEffectSet().getState(sideEffect); if (newState != null && newState == currentState) { if (!showInfoBox) { - actor.printError(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.perf.sideeffect.already-set", TranslatableComponent.of(sideEffect.getDisplayName()), TranslatableComponent.of(newState.getDisplayName()) @@ -266,14 +266,14 @@ public class GeneralCommands { if (newState != null) { session.setSideEffectSet(session.getSideEffectSet().with(sideEffect, newState)); if (!showInfoBox) { - actor.printInfo(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.perf.sideeffect.set", TranslatableComponent.of(sideEffect.getDisplayName()), TranslatableComponent.of(newState.getDisplayName()) )); } } else { - actor.printInfo(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.perf.sideeffect.get", TranslatableComponent.of(sideEffect.getDisplayName()), TranslatableComponent.of(currentState.getDisplayName()) @@ -286,7 +286,7 @@ public class GeneralCommands { } session.setSideEffectSet(applier); if (!showInfoBox) { - actor.printInfo(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.perf.sideeffect.set-all", TranslatableComponent.of(newState.getDisplayName()) )); @@ -308,10 +308,10 @@ public class GeneralCommands { @Arg(desc = "The reorder mode", def = "") EditSession.ReorderMode reorderMode) { if (reorderMode == null) { - actor.printInfo(TranslatableComponent.of("worldedit.reorder.current", TextComponent.of(session.getReorderMode().getDisplayName()))); + actor.print(Caption.of("worldedit.reorder.current", TextComponent.of(session.getReorderMode().getDisplayName()))); } else { session.setReorderMode(reorderMode); - actor.printInfo(TranslatableComponent.of("worldedit.reorder.set", TextComponent.of(session.getReorderMode().getDisplayName()))); + actor.print(Caption.of("worldedit.reorder.set", TextComponent.of(session.getReorderMode().getDisplayName()))); } } @@ -328,18 +328,18 @@ public class GeneralCommands { } boolean useServerCui = session.shouldUseServerCUI(); if (drawSelection != null && drawSelection == useServerCui) { - player.printError(TranslatableComponent.of("worldedit.drawsel." + (useServerCui ? "enabled" : "disabled") + ".already")); + player.print(Caption.of("worldedit.drawsel." + (useServerCui ? "enabled" : "disabled") + ".already")); return; } if (useServerCui) { session.setUseServerCUI(false); session.updateServerCUI(player); - player.printInfo(TranslatableComponent.of("worldedit.drawsel.disabled")); + player.print(Caption.of("worldedit.drawsel.disabled")); } else { session.setUseServerCUI(true); session.updateServerCUI(player); - player.printInfo(TranslatableComponent.of("worldedit.drawsel.enabled")); + player.print(Caption.of("worldedit.drawsel.enabled")); } } @@ -352,9 +352,9 @@ public class GeneralCommands { @Arg(desc = "The world override", def = "") World world) { session.setWorldOverride(world); if (world == null) { - actor.printInfo(TranslatableComponent.of("worldedit.world.remove")); + actor.print(Caption.of("worldedit.world.remove")); } else { - actor.printInfo(TranslatableComponent.of("worldedit.world.set", TextComponent.of(world.getId()))); + actor.print(Caption.of("worldedit.world.set", TextComponent.of(world.getId()))); } } @@ -369,16 +369,16 @@ public class GeneralCommands { @Arg(desc = "The mode to set the watchdog hook to", def = "") HookMode hookMode) { if (WorldEdit.getInstance().getPlatformManager().queryCapability(Capability.GAME_HOOKS).getWatchdog() == null) { - actor.printError(TranslatableComponent.of("worldedit.watchdog.no-hook")); + actor.print(Caption.of("worldedit.watchdog.no-hook")); return; } boolean previousMode = session.isTickingWatchdog(); if (hookMode != null && (hookMode == HookMode.ACTIVE) == previousMode) { - actor.printError(TranslatableComponent.of(previousMode ? "worldedit.watchdog.active.already" : "worldedit.watchdog.inactive.already")); + actor.print(Caption.of(previousMode ? "worldedit.watchdog.active.already" : "worldedit.watchdog.inactive.already")); return; } session.setTickingWatchdog(!previousMode); - actor.printInfo(TranslatableComponent.of(previousMode ? "worldedit.watchdog.inactive" : "worldedit.watchdog.active")); + actor.print(Caption.of(previousMode ? "worldedit.watchdog.inactive" : "worldedit.watchdog.active")); } @Command( @@ -392,10 +392,10 @@ public class GeneralCommands { Mask mask) { if (mask == null) { session.setMask(null); - actor.printInfo(TranslatableComponent.of("worldedit.gmask.disabled")); + actor.print(Caption.of("worldedit.gmask.disabled")); } else { session.setMask(mask); - actor.printInfo(TranslatableComponent.of("worldedit.gmask.set")); + actor.print(Caption.of("worldedit.gmask.set")); } } @@ -407,9 +407,9 @@ public class GeneralCommands { @CommandPermissions("worldedit.toggleplace") public void togglePlace(Player player, LocalSession session) { if (session.togglePlacementPosition()) { - player.printInfo(TranslatableComponent.of("worldedit.toggleplace.pos1")); + player.print(Caption.of("worldedit.toggleplace.pos1")); } else { - player.printInfo(TranslatableComponent.of("worldedit.toggleplace.player")); + player.print(Caption.of("worldedit.toggleplace.player")); } } @@ -430,11 +430,11 @@ public class GeneralCommands { List query) { String search = String.join(" ", query); if (search.length() <= 2) { - actor.printError(TranslatableComponent.of("worldedit.searchitem.too-short")); + actor.print(Caption.of("worldedit.searchitem.too-short")); return; } if (blocksOnly && itemsOnly) { - actor.printError(TranslatableComponent.of("worldedit.searchitem.either-b-or-i")); + actor.print(Caption.of("worldedit.searchitem.either-b-or-i")); return; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java index bb9bd1e43..7e9afc7a8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java @@ -49,7 +49,6 @@ import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BlockType; import org.enginehub.piston.annotation.Command; @@ -239,7 +238,7 @@ public class GenerationCommands { break; default: - actor.printError(TranslatableComponent.of("worldedit.cyl.invalid-radius")); + actor.print(Caption.of("worldedit.cyl.invalid-radius")); return 0; } @@ -249,7 +248,7 @@ public class GenerationCommands { BlockVector3 pos = session.getPlacementPosition(actor); int affected = editSession.makeCylinder(pos, pattern, radiusX, radiusZ, height, !hollow); - actor.printInfo(TranslatableComponent.of("worldedit.cyl.created", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.cyl.created", TextComponent.of(affected))); return affected; } @@ -301,7 +300,7 @@ public class GenerationCommands { break; default: - actor.printError(TranslatableComponent.of("worldedit.sphere.invalid-radius")); + actor.print(Caption.of("worldedit.sphere.invalid-radius")); return 0; } @@ -317,7 +316,7 @@ public class GenerationCommands { if (actor instanceof Player) { ((Player) actor).findFreePosition(); } - actor.printInfo(TranslatableComponent.of("worldedit.sphere.created", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.sphere.created", TextComponent.of(affected))); return affected; } @@ -339,7 +338,7 @@ public class GenerationCommands { worldEdit.checkMaxRadius(size); density /= 100; int affected = editSession.makeForest(session.getPlacementPosition(actor), size, density, type); - actor.printInfo(TranslatableComponent.of("worldedit.forestgen.created", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.forestgen.created", TextComponent.of(affected))); return affected; } @@ -358,7 +357,7 @@ public class GenerationCommands { checkCommandArgument(0 <= density && density <= 100, "Density must be between 0 and 100"); worldEdit.checkMaxRadius(size); int affected = editSession.makePumpkinPatches(session.getPlacementPosition(actor), size, density); - actor.printInfo(TranslatableComponent.of("worldedit.pumpkins.created", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.pumpkins.created", TextComponent.of(affected))); return affected; } @@ -395,7 +394,7 @@ public class GenerationCommands { if (actor instanceof Player) { ((Player) actor).findFreePosition(); } - actor.printInfo(TranslatableComponent.of("worldedit.pyramid.created", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.pyramid.created", TextComponent.of(affected))); return affected; } @@ -463,7 +462,7 @@ public class GenerationCommands { if (actor instanceof Player) { ((Player) actor).findFreePosition(); } - actor.printInfo(TranslatableComponent.of("worldedit.generate.created", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.generate.created", TextComponent.of(affected))); return affected; } catch (ExpressionException e) { actor.printError(TextComponent.of(e.getMessage())); @@ -532,7 +531,7 @@ public class GenerationCommands { final Vector3 unit1 = unit; try { final int affected = editSession.makeBiomeShape(region, zero, unit1, target, String.join(" ", expression), hollow, session.getTimeout()); - actor.printInfo(TranslatableComponent.of("worldedit.generatebiome.changed", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.generatebiome.changed", TextComponent.of(affected))); return affected; } catch (ExpressionException e) { actor.printError(TextComponent.of(e.getMessage())); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java index bac775360..90f0c55cf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistoryCommands.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; @@ -30,7 +31,6 @@ import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import org.enginehub.piston.annotation.Command; import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.param.Arg; @@ -69,14 +69,14 @@ public class HistoryCommands { times = Math.max(1, times); LocalSession undoSession = session; if (session.hasFastMode()) { - actor.print(TranslatableComponent.of("fawe.worldedit.history.command.undo.disabled")); + actor.print(Caption.of("fawe.worldedit.history.command.undo.disabled")); return; } if (playerName != null) { actor.checkPermission("worldedit.history.undo.other"); undoSession = worldEdit.getSessionManager().findByName(playerName); if (undoSession == null) { - actor.printError(TranslatableComponent.of("worldedit.session.cant-find-session", TextComponent.of(playerName))); + actor.print(Caption.of("worldedit.session.cant-find-session", TextComponent.of(playerName))); return; } } @@ -92,9 +92,9 @@ public class HistoryCommands { } } if (timesUndone > 0) { - actor.printInfo(TranslatableComponent.of("worldedit.undo.undone", TextComponent.of(timesUndone))); + actor.print(Caption.of("worldedit.undo.undone", TextComponent.of(timesUndone))); } else { - actor.printError(TranslatableComponent.of("worldedit.undo.none")); + actor.print(Caption.of("worldedit.undo.none")); } } @@ -115,7 +115,7 @@ public class HistoryCommands { actor.checkPermission("worldedit.history.redo.other"); redoSession = worldEdit.getSessionManager().findByName(playerName); if (redoSession == null) { - actor.printError(TranslatableComponent.of("worldedit.session.cant-find-session", TextComponent.of(playerName))); + actor.print(Caption.of("worldedit.session.cant-find-session", TextComponent.of(playerName))); return; } } @@ -131,9 +131,9 @@ public class HistoryCommands { } } if (timesRedone > 0) { - actor.printInfo(TranslatableComponent.of("worldedit.redo.redone", TextComponent.of(timesRedone))); + actor.print(Caption.of("worldedit.redo.redone", TextComponent.of(timesRedone))); } else { - actor.printError(TranslatableComponent.of("worldedit.redo.none")); + actor.print(Caption.of("worldedit.redo.none")); } } @@ -145,7 +145,7 @@ public class HistoryCommands { @CommandPermissions("worldedit.history.clear") public void clearHistory(Actor actor, LocalSession session) { session.clearHistory(); - actor.printInfo(TranslatableComponent.of("worldedit.clearhistory.cleared")); + actor.print(Caption.of("worldedit.clearhistory.cleared")); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistorySubCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistorySubCommands.java index 9032d21d2..3c5eae03d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistorySubCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/HistorySubCommands.java @@ -221,7 +221,7 @@ public class HistorySubCommands { Integer index) throws WorldEditException, ExecutionException, InterruptedException { RollbackOptimizedHistory edit = database.getEdit(other, index).get(); if (edit == null) { - player.print(TranslatableComponent.of("fawe.worldedit.schematic.schematic.none")); + player.print(Caption.of("fawe.worldedit.schematic.schematic.none")); return; } Location origin = player.getLocation(); @@ -341,10 +341,10 @@ public class HistorySubCommands { return; } if (other == null && radius == 0 && timeDiff == 0) { - throw new InsufficientArgumentsException(TranslatableComponent.of("fawe.error.invalid-user")); + throw new InsufficientArgumentsException(Caption.of("fawe.error.invalid-user")); } - checkCommandArgument(radius > 0, TranslatableComponent.of("fawe.error.radius-too-small")); - checkCommandArgument(timeDiff > 0, TranslatableComponent.of("fawe.error.time-too-less")); + checkCommandArgument(radius > 0, Caption.of("fawe.error.radius-too-small")); + checkCommandArgument(timeDiff > 0, Caption.of("fawe.error.time-too-less")); Location origin = player.getLocation(); String pageCommand = "/" + arguments.get().replaceAll("-p [0-9]+", "").trim(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/LegacySnapshotCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/LegacySnapshotCommands.java index 499971396..b330b3e4e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/LegacySnapshotCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/LegacySnapshotCommands.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.command; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; @@ -67,7 +68,7 @@ class LegacySnapshotCommands { if (!snapshots.isEmpty()) { actor.print(new SnapshotListBox(world.getName(), snapshots).create(page)); } else { - actor.printError(TranslatableComponent.of("worldedit.restore.none-found-console")); + actor.print(Caption.of("worldedit.restore.none-found-console")); // Okay, let's toss some debugging information! File dir = config.snapshotRepo.getDirectory(); @@ -82,7 +83,7 @@ class LegacySnapshotCommands { } } } catch (MissingWorldException ex) { - actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world")); + actor.print(Caption.of("worldedit.restore.none-for-world")); } } @@ -96,19 +97,19 @@ class LegacySnapshotCommands { if (snapshot != null) { session.setSnapshot(null); - actor.printInfo(TranslatableComponent.of("worldedit.snapshot.use.newest")); + actor.print(Caption.of("worldedit.snapshot.use.newest")); } else { - actor.printError(TranslatableComponent.of("worldedit.restore.none-found")); + actor.print(Caption.of("worldedit.restore.none-found")); } } catch (MissingWorldException ex) { - actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world")); + actor.print(Caption.of("worldedit.restore.none-for-world")); } } else { try { session.setSnapshot(config.snapshotRepo.getSnapshot(name)); - actor.printInfo(TranslatableComponent.of("worldedit.snapshot.use", TextComponent.of(name))); + actor.print(Caption.of("worldedit.snapshot.use", TextComponent.of(name))); } catch (InvalidSnapshotException e) { - actor.printError(TranslatableComponent.of("worldedit.restore.not-available")); + actor.print(Caption.of("worldedit.restore.not-available")); } } } @@ -117,25 +118,25 @@ class LegacySnapshotCommands { LocalConfiguration config = we.getConfiguration(); if (index < 1) { - actor.printError(TranslatableComponent.of("worldedit.snapshot.index-above-0")); + actor.print(Caption.of("worldedit.snapshot.index-above-0")); return; } try { List snapshots = config.snapshotRepo.getSnapshots(true, world.getName()); if (snapshots.size() < index) { - actor.printError(TranslatableComponent.of("worldedit.snapshot.index-oob", TextComponent.of(snapshots.size()))); + actor.print(Caption.of("worldedit.snapshot.index-oob", TextComponent.of(snapshots.size()))); return; } Snapshot snapshot = snapshots.get(index - 1); if (snapshot == null) { - actor.printError(TranslatableComponent.of("worldedit.restore.not-available")); + actor.print(Caption.of("worldedit.restore.not-available")); return; } session.setSnapshot(snapshot); - actor.printInfo(TranslatableComponent.of("worldedit.snapshot.use", TextComponent.of(snapshot.getName()))); + actor.print(Caption.of("worldedit.snapshot.use", TextComponent.of(snapshot.getName()))); } catch (MissingWorldException e) { - actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world")); + actor.print(Caption.of("worldedit.restore.none-for-world")); } } @@ -146,16 +147,16 @@ class LegacySnapshotCommands { Snapshot snapshot = config.snapshotRepo.getSnapshotBefore(date, world.getName()); if (snapshot == null) { - actor.printError(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.snapshot.none-before", TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date))) ); } else { session.setSnapshot(snapshot); - actor.printInfo(TranslatableComponent.of("worldedit.snapshot.use", TextComponent.of(snapshot.getName()))); + actor.print(Caption.of("worldedit.snapshot.use", TextComponent.of(snapshot.getName()))); } } catch (MissingWorldException ex) { - actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world")); + actor.print(Caption.of("worldedit.restore.none-for-world")); } } @@ -165,16 +166,16 @@ class LegacySnapshotCommands { try { Snapshot snapshot = config.snapshotRepo.getSnapshotAfter(date, world.getName()); if (snapshot == null) { - actor.printError(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.snapshot.none-after", TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date))) ); } else { session.setSnapshot(snapshot); - actor.printInfo(TranslatableComponent.of("worldedit.snapshot.use", TextComponent.of(snapshot.getName()))); + actor.print(Caption.of("worldedit.snapshot.use", TextComponent.of(snapshot.getName()))); } } catch (MissingWorldException ex) { - actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world")); + actor.print(Caption.of("worldedit.restore.none-for-world")); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/LegacySnapshotUtilCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/LegacySnapshotUtilCommands.java index 297841039..c1af641b4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/LegacySnapshotUtilCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/LegacySnapshotUtilCommands.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; @@ -58,7 +59,7 @@ class LegacySnapshotUtilCommands { try { snapshot = config.snapshotRepo.getSnapshot(snapshotName); } catch (InvalidSnapshotException e) { - actor.printError(TranslatableComponent.of("worldedit.restore.not-available")); + actor.print(Caption.of("worldedit.restore.not-available")); return; } } else { @@ -71,7 +72,7 @@ class LegacySnapshotUtilCommands { snapshot = config.snapshotRepo.getDefaultSnapshot(world.getName()); if (snapshot == null) { - actor.printError(TranslatableComponent.of("worldedit.restore.none-found-console")); + actor.print(Caption.of("worldedit.restore.none-found-console")); // Okay, let's toss some debugging information! File dir = config.snapshotRepo.getDirectory(); @@ -88,7 +89,7 @@ class LegacySnapshotUtilCommands { return; } } catch (MissingWorldException ex) { - actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world")); + actor.print(Caption.of("worldedit.restore.none-for-world")); return; } } @@ -98,9 +99,9 @@ class LegacySnapshotUtilCommands { // Load chunk store try { chunkStore = snapshot.getChunkStore(); - actor.printInfo(TranslatableComponent.of("worldedit.restore.loaded", TextComponent.of(snapshot.getName()))); + actor.print(Caption.of("worldedit.restore.loaded", TextComponent.of(snapshot.getName()))); } catch (DataException | IOException e) { - actor.printError(TranslatableComponent.of("worldedit.restore.failed", TextComponent.of(e.getMessage()))); + actor.print(Caption.of("worldedit.restore.failed", TextComponent.of(e.getMessage()))); return; } @@ -114,15 +115,15 @@ class LegacySnapshotUtilCommands { if (restore.hadTotalFailure()) { String error = restore.getLastErrorMessage(); if (!restore.getMissingChunks().isEmpty()) { - actor.printError(TranslatableComponent.of("worldedit.restore.chunk-not-present")); + actor.print(Caption.of("worldedit.restore.chunk-not-present")); } else if (error != null) { - actor.printError(TranslatableComponent.of("worldedit.restore.block-place-failed")); - actor.printError(TranslatableComponent.of("worldedit.restore.block-place-error", TextComponent.of(error))); + actor.print(Caption.of("worldedit.restore.block-place-failed")); + actor.print(Caption.of("worldedit.restore.block-place-error", TextComponent.of(error))); } else { - actor.printError(TranslatableComponent.of("worldedit.restore.chunk-load-failed")); + actor.print(Caption.of("worldedit.restore.chunk-load-failed")); } } else { - actor.printInfo(TranslatableComponent.of("worldedit.restore.restored", + actor.print(Caption.of("worldedit.restore.restored", TextComponent.of(restore.getMissingChunks().size()), TextComponent.of(restore.getErrorChunks().size()))); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java index 5337fbc4e..ff6fe7b63 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/NavigationCommands.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; @@ -63,7 +64,7 @@ public class NavigationCommands { @CommandPermissions("worldedit.navigation.unstuck") public void unstuck(Player player) throws WorldEditException { player.findFreePosition(); - player.printInfo(TranslatableComponent.of("worldedit.unstuck.moved")); + player.print(Caption.of("worldedit.unstuck.moved")); } @Command( @@ -83,9 +84,9 @@ public class NavigationCommands { } } if (ascentLevels == 0) { - player.printError(TranslatableComponent.of("worldedit.ascend.obstructed")); + player.print(Caption.of("worldedit.ascend.obstructed")); } else { - player.printInfo(TranslatableComponent.of("worldedit.ascend.moved", TextComponent.of(ascentLevels))); + player.print(Caption.of("worldedit.ascend.moved", TextComponent.of(ascentLevels))); } } @@ -106,9 +107,9 @@ public class NavigationCommands { } } if (descentLevels == 0) { - player.printError(TranslatableComponent.of("worldedit.descend.obstructed")); + player.print(Caption.of("worldedit.descend.obstructed")); } else { - player.printInfo(TranslatableComponent.of("worldedit.descend.moved", TextComponent.of(descentLevels))); + player.print(Caption.of("worldedit.descend.moved", TextComponent.of(descentLevels))); } } @@ -130,9 +131,9 @@ public class NavigationCommands { boolean alwaysGlass = getAlwaysGlass(forceFlight, forceGlass); if (player.ascendToCeiling(clearance, alwaysGlass)) { - player.printInfo(TranslatableComponent.of("worldedit.ceil.moved")); + player.print(Caption.of("worldedit.ceil.moved")); } else { - player.printError(TranslatableComponent.of("worldedit.ceil.obstructed")); + player.print(Caption.of("worldedit.ceil.obstructed")); } } @@ -144,9 +145,9 @@ public class NavigationCommands { @CommandPermissions("worldedit.navigation.thru.command") public void thru(Player player) throws WorldEditException { if (player.passThroughForwardWall(6)) { - player.printInfo(TranslatableComponent.of("worldedit.thru.moved")); + player.print(Caption.of("worldedit.thru.moved")); } else { - player.printError(TranslatableComponent.of("worldedit.thru.obstructed")); + player.print(Caption.of("worldedit.thru.obstructed")); } } @@ -167,9 +168,9 @@ public class NavigationCommands { } if (pos != null) { player.findFreePosition(pos); - player.printInfo(TranslatableComponent.of("worldedit.jumpto.moved")); + player.print(Caption.of("worldedit.jumpto.moved")); } else { - player.printError(TranslatableComponent.of("worldedit.jumpto.none")); + player.print(Caption.of("worldedit.jumpto.none")); } } @@ -189,9 +190,9 @@ public class NavigationCommands { boolean forceGlass) throws WorldEditException { boolean alwaysGlass = getAlwaysGlass(forceFlight, forceGlass); if (player.ascendUpwards(distance, alwaysGlass)) { - player.printInfo(TranslatableComponent.of("worldedit.up.moved")); + player.print(Caption.of("worldedit.up.moved")); } else { - player.printError(TranslatableComponent.of("worldedit.up.obstructed")); + player.print(Caption.of("worldedit.up.obstructed")); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java index 4a8c1840d..5c5aed9d4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/RegionCommands.java @@ -112,7 +112,7 @@ public class RegionCommands { Pattern pattern) { int affected = editSession.setBlocks(region, pattern); if (affected != 0) { - actor.printInfo(TranslatableComponent.of("worldedit.set.done")); + actor.print(Caption.of("worldedit.set.done")); } return affected; } @@ -194,14 +194,14 @@ public class RegionCommands { public void nbtinfo(Player player, EditSession editSession) { Location pos = player.getBlockTrace(128); if (pos == null) { - player.printError(TranslatableComponent.of("fawe.navigation.no.block")); + player.print(Caption.of("fawe.navigation.no.block")); return; } CompoundTag nbt = editSession.getFullBlock(pos.toBlockPoint()).getNbtData(); if (nbt != null) { player.print(TextComponent.of(nbt.getValue().toString())); } else { - player.printError(TranslatableComponent.of("fawe.navigation.no.block")); + player.print(Caption.of("fawe.navigation.no.block")); } } @@ -240,7 +240,7 @@ public class RegionCommands { @Switch(name = 'h', desc = "Generate only a shell") boolean shell) throws WorldEditException { if (!(region instanceof CuboidRegion)) { - actor.printError(TranslatableComponent.of("worldedit.line.cuboid-only")); + actor.print(Caption.of("worldedit.line.cuboid-only")); return 0; } checkCommandArgument(thickness >= 0, "Thickness must be >= 0"); @@ -250,7 +250,7 @@ public class RegionCommands { BlockVector3 pos2 = cuboidregion.getPos2(); int blocksChanged = editSession.drawLine(pattern, pos1, pos2, thickness, !shell); - actor.printInfo(TranslatableComponent.of("worldedit.line.changed", TextComponent.of(blocksChanged))); + actor.print(Caption.of("worldedit.line.changed", TextComponent.of(blocksChanged))); return blocksChanged; } @@ -271,7 +271,7 @@ public class RegionCommands { @Switch(name = 'h', desc = "Generate only a shell") boolean shell) throws WorldEditException { if (!(region instanceof ConvexPolyhedralRegion)) { - actor.printError(TranslatableComponent.of("worldedit.curve.invalid-type")); + actor.print(Caption.of("worldedit.curve.invalid-type")); return 0; } checkCommandArgument(thickness >= 0, "Thickness must be >= 0"); @@ -281,7 +281,7 @@ public class RegionCommands { int blocksChanged = editSession.drawSpline(pattern, vectors, 0, 0, 0, 10, thickness, !shell); - actor.printInfo(TranslatableComponent.of("worldedit.curve.changed", TextComponent.of(blocksChanged))); + actor.print(Caption.of("worldedit.curve.changed", TextComponent.of(blocksChanged))); return blocksChanged; } @@ -305,7 +305,7 @@ public class RegionCommands { ((AbstractExtentMask) from).setExtent(editSession); } int affected = editSession.replaceBlocks(region, from, to); - actor.printInfo(TranslatableComponent.of("worldedit.replace.replaced", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.replace.replaced", TextComponent.of(affected))); return affected; } @@ -320,7 +320,7 @@ public class RegionCommands { @Arg(desc = "The pattern of blocks to overlay") Pattern pattern) throws WorldEditException { int affected = editSession.overlayCuboidBlocks(region, pattern); - actor.printInfo(TranslatableComponent.of("worldedit.overlay.overlaid", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.overlay.overlaid", TextComponent.of(affected))); return affected; } @@ -360,7 +360,7 @@ public class RegionCommands { @Arg(desc = "The pattern of blocks to set") Pattern pattern) throws WorldEditException { int affected = editSession.center(region, pattern); - actor.printInfo(TranslatableComponent.of("worldedit.center.changed", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.center.changed", TextComponent.of(affected))); return affected; } @@ -373,7 +373,7 @@ public class RegionCommands { @Confirm(Confirm.Processor.REGION) public int naturalize(Actor actor, EditSession editSession, @Selection Region region) throws WorldEditException { int affected = editSession.naturalizeCuboidBlocks(region); - actor.printInfo(TranslatableComponent.of("worldedit.naturalize.naturalized", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.naturalize.naturalized", TextComponent.of(affected))); return affected; } @@ -388,7 +388,7 @@ public class RegionCommands { @Arg(desc = "The pattern of blocks to set") Pattern pattern) throws WorldEditException { int affected = editSession.makeWalls(region, pattern); - actor.printInfo(TranslatableComponent.of("worldedit.walls.changed", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.walls.changed", TextComponent.of(affected))); return affected; } @@ -404,7 +404,7 @@ public class RegionCommands { @Arg(desc = "The pattern of blocks to set") Pattern pattern) throws WorldEditException { int affected = editSession.makeCuboidFaces(region, pattern); - actor.printInfo(TranslatableComponent.of("worldedit.faces.changed", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.faces.changed", TextComponent.of(affected))); return affected; } @@ -435,7 +435,7 @@ public class RegionCommands { HeightMap heightMap = new HeightMap(editSession, region, mask, snow); HeightMapFilter filter = new HeightMapFilter(new GaussianKernel(5, 1.0)); affected = heightMap.applyFilter(filter, iterations); - actor.printInfo(TranslatableComponent.of("worldedit.smooth.changed", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.smooth.changed", TextComponent.of(affected))); } catch (Throwable e) { throw new RuntimeException(e); } @@ -451,9 +451,9 @@ public class RegionCommands { @CommandPermissions("fawe.admin") public void wea(Actor actor) throws WorldEditException { if (actor.togglePermission("fawe.bypass")) { - actor.print(TranslatableComponent.of("fawe.info.worldedit.bypassed")); + actor.print(Caption.of("fawe.info.worldedit.bypassed")); } else { - actor.print(TranslatableComponent.of("fawe.info.worldedit.restricted")); + actor.print(Caption.of("fawe.info.worldedit.restricted")); } } @@ -528,7 +528,7 @@ public class RegionCommands { } } - actor.printInfo(TranslatableComponent.of("worldedit.move.moved", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.move.moved", TextComponent.of(affected))); return affected; } @@ -602,7 +602,7 @@ public class RegionCommands { } } - actor.printInfo(TranslatableComponent.of("worldedit.stack.changed", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.stack.changed", TextComponent.of(affected))); return affected; } @@ -628,7 +628,7 @@ public class RegionCommands { try { session.setMask(null); session.setSourceMask(null); - actor.printInfo(TranslatableComponent.of("fawe.regen.time")); + actor.print(Caption.of("fawe.regen.time")); RegenOptions options = RegenOptions.builder() .seed(seed) .regenBiomes(regenBiomes) @@ -640,9 +640,9 @@ public class RegionCommands { session.setSourceMask(mask); } if (success) { - actor.printInfo(TranslatableComponent.of("worldedit.regen.regenerated")); + actor.print(Caption.of("worldedit.regen.regenerated")); } else { - actor.printError(TranslatableComponent.of("worldedit.regen.failed")); + actor.print(Caption.of("worldedit.regen.failed")); } } @@ -705,7 +705,7 @@ public class RegionCommands { if (actor instanceof Player) { ((Player) actor).findFreePosition(); } - actor.printInfo(TranslatableComponent.of("worldedit.deform.deformed", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.deform.deformed", TextComponent.of(affected))); return affected; } catch (ExpressionException e) { actor.printError(TextComponent.of(e.getMessage())); @@ -735,7 +735,7 @@ public class RegionCommands { Mask finalMask = mask == null ? new SolidBlockMask(editSession) : mask; int affected = editSession.hollowOutRegion(region, thickness, pattern, finalMask); - actor.printInfo(TranslatableComponent.of("worldedit.hollow.changed", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.hollow.changed", TextComponent.of(affected))); return affected; } @@ -753,7 +753,7 @@ public class RegionCommands { double density) throws WorldEditException { checkCommandArgument(0 <= density && density <= 100, "Density must be in [0, 100]"); int affected = editSession.makeForest(region, density / 100, type); - actor.printInfo(TranslatableComponent.of("worldedit.forest.created", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.forest.created", TextComponent.of(affected))); return affected; } @@ -776,7 +776,7 @@ public class RegionCommands { Operations.completeLegacy(visitor); int affected = ground.getAffected(); - actor.printInfo(TranslatableComponent.of("worldedit.flora.created", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.flora.created", TextComponent.of(affected))); return affected; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java index 1f01293ba..5202e7830 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SchematicCommands.java @@ -53,7 +53,6 @@ import com.sk89q.worldedit.util.formatting.component.PaginationBox; import com.sk89q.worldedit.util.formatting.component.TextComponentProducer; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.event.ClickEvent; import com.sk89q.worldedit.util.formatting.text.event.HoverEvent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; @@ -176,7 +175,7 @@ public class SchematicCommands { @CommandPermissions({"worldedit.clipboard.clear", "worldedit.schematic.clear"}) public void clear(Player player, LocalSession session) throws WorldEditException { session.setClipboard(null); - player.print(TranslatableComponent.of("fawe.worldedit.clipboard.clipboard.cleared")); + player.print(Caption.of("fawe.worldedit.clipboard.clipboard.cleared")); } @Command( @@ -208,7 +207,7 @@ public class SchematicCommands { } else { session.setClipboard(null); } - player.print(TranslatableComponent.of("fawe.worldedit.clipboard.clipboard.cleared")); + player.print(Caption.of("fawe.worldedit.clipboard.clipboard.cleared")); return; } } @@ -262,7 +261,7 @@ public class SchematicCommands { } file = actor.openFileOpenDialog(extensions); if (file == null || !file.exists()) { - actor.printError(TranslatableComponent.of("worldedit.schematic.load.does-not-exist", TextComponent.of(filename))); + actor.print(Caption.of("worldedit.schematic.load.does-not-exist", TextComponent.of(filename))); return; } } else { @@ -291,7 +290,7 @@ public class SchematicCommands { if (format == null) { format = ClipboardFormats.findByFile(file); if (format == null) { - actor.printError(TranslatableComponent.of("worldedit.schematic.unknown-format", TextComponent.of(formatName))); + actor.print(Caption.of("worldedit.schematic.unknown-format", TextComponent.of(formatName))); return; } } @@ -339,7 +338,7 @@ public class SchematicCommands { ClipboardFormat format = ClipboardFormats.findByAlias(formatName); if (format == null) { - actor.printError(TranslatableComponent.of("worldedit.schematic.unknown-format", TextComponent.of(formatName))); + actor.print(Caption.of("worldedit.schematic.unknown-format", TextComponent.of(formatName))); return; } @@ -370,7 +369,7 @@ public class SchematicCommands { } } if (!allowOverwrite) { - actor.printError(TranslatableComponent.of("worldedit.schematic.save.already-exists")); + actor.print(Caption.of("worldedit.schematic.save.already-exists")); return; } } @@ -379,7 +378,7 @@ public class SchematicCommands { File parent = f.getParentFile(); if (parent != null && !parent.exists()) { if (!parent.mkdirs()) { - throw new StopExecutionException(TranslatableComponent.of( + throw new StopExecutionException(Caption.of( "worldedit.schematic.save.failed-directory")); } } @@ -389,7 +388,7 @@ public class SchematicCommands { SchematicSaveTask task = new SchematicSaveTask(actor, f, dir, format, holder, overwrite); AsyncCommandBuilder.wrap(task, actor) .registerWithSupervisor(worldEdit.getSupervisor(), "Saving schematic " + filename) - .sendMessageAfterDelay(TranslatableComponent.of("worldedit.schematic.save.saving")) + .sendMessageAfterDelay(Caption.of("worldedit.schematic.save.saving")) .onSuccess(filename + " saved" + (overwrite ? " (overwriting previous file)." : "."), null) .onFailure("Failed to save schematic", worldEdit.getPlatformManager().getPlatformCommandManager().getExceptionConverter()) .buildAndExec(worldEdit.getExecutorService()); @@ -417,7 +416,7 @@ public class SchematicCommands { ClipboardHolder clipboard = session.getClipboard(); List sources = getFiles(clipboard); if (sources.isEmpty()) { - player.printError(TranslatableComponent.of("fawe.worldedit.schematic.schematic.none")); + player.print(Caption.of("fawe.worldedit.schematic.schematic.none")); return; } if (!destDir.exists() && !destDir.mkdirs()) { @@ -470,7 +469,7 @@ public class SchematicCommands { ) @CommandPermissions("worldedit.schematic.formats") public void formats(Actor actor) { - actor.printInfo(TranslatableComponent.of("worldedit.schematic.formats.title")); + actor.print(Caption.of("worldedit.schematic.formats.title")); StringBuilder builder; boolean first = true; for (ClipboardFormat format : ClipboardFormats.getAll()) { @@ -654,12 +653,12 @@ public class SchematicCommands { } if (files.isEmpty()) { - actor.printError(TranslatableComponent.of("worldedit.schematic.delete.does-not-exist", TextComponent.of(filename))); + actor.print(Caption.of("worldedit.schematic.delete.does-not-exist", TextComponent.of(filename))); return; } for (File f : files) { if (!MainUtil.isInSubDirectory(working, f) || !f.exists()) { - actor.printError(TranslatableComponent.of("worldedit.schematic.delete.does-not-exist", TextComponent.of(filename))); + actor.print(Caption.of("worldedit.schematic.delete.does-not-exist", TextComponent.of(filename))); continue; } if (Settings.IMP.PATHS.PER_PLAYER_SCHEMATICS && !MainUtil.isInSubDirectory(dir, f) && !actor.hasPermission("worldedit.schematic.delete.other")) { @@ -667,7 +666,7 @@ public class SchematicCommands { continue; } if (!deleteFile(f)) { - actor.printError(TranslatableComponent.of("worldedit.schematic.delete.failed", TextComponent.of(filename))); + actor.print(Caption.of("worldedit.schematic.delete.failed", TextComponent.of(filename))); continue; } actor.print(Caption.of("worldedit.schematic.delete.deleted", filename)); @@ -862,7 +861,7 @@ public class SchematicCommands { } LOGGER.info(actor.getName() + " saved " + file.getCanonicalPath()); } else { - actor.printError(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.manual")); + actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason.manual")); } } return null; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java index 2a8bc0099..678a95bb6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; @@ -26,7 +27,6 @@ import com.sk89q.worldedit.command.util.CommandPermissions; import com.sk89q.worldedit.command.util.CommandPermissionsConditionGenerator; import com.sk89q.worldedit.command.util.Logging; import com.sk89q.worldedit.entity.Player; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import org.enginehub.piston.annotation.Command; import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.param.Arg; @@ -70,7 +70,7 @@ public class ScriptingCommands { @Arg(desc = "Arguments to the CraftScript", def = "", variable = true) List args) throws WorldEditException { if (!player.hasPermission("worldedit.scripting.execute." + filename)) { - player.printError(TranslatableComponent.of("worldedit.execute.script-permissions")); + player.print(Caption.of("worldedit.execute.script-permissions")); return; } @@ -97,12 +97,12 @@ public class ScriptingCommands { String lastScript = session.getLastScript(); if (!player.hasPermission("worldedit.scripting.execute." + lastScript)) { - player.printError(TranslatableComponent.of("worldedit.execute.script-permissions")); + player.print(Caption.of("worldedit.execute.script-permissions")); return; } if (lastScript == null) { - player.printError(TranslatableComponent.of("worldedit.executelast.no-script")); + player.print(Caption.of("worldedit.executelast.no-script")); return; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java index 40179d4f0..f3c27f631 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SelectionCommands.java @@ -70,7 +70,6 @@ import com.sk89q.worldedit.util.formatting.component.SubtleFormat; import com.sk89q.worldedit.util.formatting.component.TextComponentProducer; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.event.ClickEvent; import com.sk89q.worldedit.util.formatting.text.event.HoverEvent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; @@ -124,12 +123,12 @@ public class SelectionCommands { } else if (actor instanceof Locatable) { pos = ((Locatable) actor).getBlockLocation().clampY(0, world.getMaxY()); } else { - actor.printError(TranslatableComponent.of("worldedit.pos.console-require-coords")); + actor.print(Caption.of("worldedit.pos.console-require-coords")); return; } if (!session.getRegionSelector(world).selectPrimary(pos.toVector().toBlockPoint(), ActorSelectorLimits.forActor(actor))) { - actor.printError(TranslatableComponent.of("worldedit.pos.already-set")); + actor.print(Caption.of("worldedit.pos.already-set")); return; } @@ -153,12 +152,12 @@ public class SelectionCommands { } else if (actor instanceof Locatable) { pos = ((Locatable) actor).getBlockLocation().clampY(0, world.getMaxY()); } else { - actor.printError(TranslatableComponent.of("worldedit.pos.console-require-coords")); + actor.print(Caption.of("worldedit.pos.console-require-coords")); return; } if (!session.getRegionSelector(world).selectSecondary(pos.toVector().toBlockPoint(), ActorSelectorLimits.forActor(actor))) { - actor.printError(TranslatableComponent.of("worldedit.pos.already-set")); + actor.print(Caption.of("worldedit.pos.already-set")); return; } @@ -177,14 +176,14 @@ public class SelectionCommands { if (pos != null) { if (!session.getRegionSelector(player.getWorld()).selectPrimary(pos.toVector().toBlockPoint(), ActorSelectorLimits.forActor(player))) { - player.printError(TranslatableComponent.of("worldedit.hpos.already-set")); + player.print(Caption.of("worldedit.hpos.already-set")); return; } session.getRegionSelector(player.getWorld()) .explainPrimarySelection(player, session, pos.toBlockPoint()); } else { - player.printError(TranslatableComponent.of("worldedit.hpos.no-block")); + player.print(Caption.of("worldedit.hpos.no-block")); } } @@ -199,14 +198,14 @@ public class SelectionCommands { if (pos != null) { if (!session.getRegionSelector(player.getWorld()).selectSecondary(pos.toVector().toBlockPoint(), ActorSelectorLimits.forActor(player))) { - player.printError(TranslatableComponent.of("worldedit.hpos.already-set")); + player.print(Caption.of("worldedit.hpos.already-set")); return; } session.getRegionSelector(player.getWorld()) .explainSecondarySelection(player, session, pos.toBlockPoint()); } else { - player.printError(TranslatableComponent.of("worldedit.hpos.no-block")); + player.print(Caption.of("worldedit.hpos.no-block")); } } @@ -235,7 +234,7 @@ public class SelectionCommands { min = BlockVector3.at(min2D.getBlockX() * 16, 0, min2D.getBlockZ() * 16); max = BlockVector3.at(max2D.getBlockX() * 16 + 15, world.getMaxY(), max2D.getBlockZ() * 16 + 15); - actor.printInfo(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.chunk.selected-multiple", TextComponent.of(min2D.getBlockX()), TextComponent.of(min2D.getBlockZ()), @@ -261,7 +260,7 @@ public class SelectionCommands { min = BlockVector3.at(min2D.getBlockX() * 16, 0, min2D.getBlockZ() * 16); max = min.add(15, world.getMaxY(), 15); - actor.printInfo(TranslatableComponent.of("worldedit.chunk.selected", TextComponent.of(min2D.getBlockX()), + actor.print(Caption.of("worldedit.chunk.selected", TextComponent.of(min2D.getBlockX()), TextComponent.of(min2D.getBlockZ()))); } @@ -293,16 +292,16 @@ public class SelectionCommands { } ItemType itemType = ItemTypes.parse(wandId); if (itemType == null) { - player.printError(TranslatableComponent.of("worldedit.wand.invalid")); + player.print(Caption.of("worldedit.wand.invalid")); return; } player.giveItem(new BaseItemStack(itemType, 1)); if (navWand) { session.setTool(itemType, NavigationWand.INSTANCE); - player.printInfo(TranslatableComponent.of("worldedit.wand.navwand.info")); + player.print(Caption.of("worldedit.wand.navwand.info")); } else { session.setTool(itemType, SelectionWand.INSTANCE); - player.printInfo(TranslatableComponent.of("worldedit.wand.selwand.info")); + player.print(Caption.of("worldedit.wand.selwand.info")); } } @@ -314,7 +313,7 @@ public class SelectionCommands { @CommandPermissions("worldedit.wand.toggle") public void toggleWand(Player player) { player.printInfo( - TranslatableComponent.of( + Caption.of( "worldedit.wand.selwand.now.tool", TextComponent.of("/tool none", TextColor.AQUA).clickEvent( ClickEvent.of(ClickEvent.Action.RUN_COMMAND, "/tool none")), @@ -357,7 +356,7 @@ public class SelectionCommands { session.getRegionSelector(world).explainRegionAdjust(actor, session); - actor.printInfo(TranslatableComponent.of("worldedit.contract.contracted", TextComponent.of(oldSize - newSize))); + actor.print(Caption.of("worldedit.contract.contracted", TextComponent.of(oldSize - newSize))); } catch (RegionOperationException e) { actor.printError(TextComponent.of(e.getMessage())); } @@ -386,7 +385,7 @@ public class SelectionCommands { session.getRegionSelector(world).explainRegionAdjust(actor, session); - actor.printInfo(TranslatableComponent.of("worldedit.shift.shifted")); + actor.print(Caption.of("worldedit.shift.shifted")); } catch (RegionOperationException e) { actor.printError(TextComponent.of(e.getMessage())); } @@ -409,7 +408,7 @@ public class SelectionCommands { region.expand(getChangesForEachDir(amount, onlyHorizontal, onlyVertical)); session.getRegionSelector(world).learnChanges(); session.getRegionSelector(world).explainRegionAdjust(actor, session); - actor.printInfo(TranslatableComponent.of("worldedit.outset.outset")); + actor.print(Caption.of("worldedit.outset.outset")); } @Command( @@ -429,7 +428,7 @@ public class SelectionCommands { region.contract(getChangesForEachDir(amount, onlyHorizontal, onlyVertical)); session.getRegionSelector(world).learnChanges(); session.getRegionSelector(world).explainRegionAdjust(actor, session); - actor.printInfo(TranslatableComponent.of("worldedit.inset.inset")); + actor.print(Caption.of("worldedit.inset.inset")); } private BlockVector3[] getChangesForEachDir(int amount, boolean onlyHorizontal, boolean onlyVertical) { @@ -485,14 +484,14 @@ public class SelectionCommands { String originStr = origin.getBlockX() + "," + origin.getBlockY() + "," + origin.getBlockZ(); long numBlocks = ((long) size.getBlockX() * size.getBlockY() * size.getBlockZ()); - actor.printInfo(TranslatableComponent.of("worldedit.size.offset", TextComponent.of(name), TextComponent.of(sizeStr), TextComponent.of(originStr), TextComponent.of(numBlocks))); + actor.print(Caption.of("worldedit.size.offset", TextComponent.of(name), TextComponent.of(sizeStr), TextComponent.of(originStr), TextComponent.of(numBlocks))); index++; } return; } else { region = session.getSelection(world); - actor.printInfo(TranslatableComponent.of("worldedit.size.type", TextComponent.of(session.getRegionSelector(world).getTypeName()))); + actor.print(Caption.of("worldedit.size.type", TextComponent.of(session.getRegionSelector(world).getTypeName()))); for (Component line : session.getRegionSelector(world).getSelectionInfoLines()) { actor.printInfo(line); @@ -502,9 +501,9 @@ public class SelectionCommands { .subtract(region.getMinimumPoint()) .add(1, 1, 1); - actor.printInfo(TranslatableComponent.of("worldedit.size.size", TextComponent.of(size.toString()))); - actor.printInfo(TranslatableComponent.of("worldedit.size.distance", TextComponent.of(region.getMaximumPoint().distance(region.getMinimumPoint())))); - actor.printInfo(TranslatableComponent.of("worldedit.size.blocks", TextComponent.of(region.getVolume()))); + actor.print(Caption.of("worldedit.size.size", TextComponent.of(size.toString()))); + actor.print(Caption.of("worldedit.size.distance", TextComponent.of(region.getMaximumPoint().distance(region.getMinimumPoint())))); + actor.print(Caption.of("worldedit.size.blocks", TextComponent.of(region.getVolume()))); } @Command( @@ -516,7 +515,7 @@ public class SelectionCommands { @Arg(desc = "The mask of blocks to match") Mask mask) throws WorldEditException { int count = editSession.countBlocks(session.getSelection(world), mask); - actor.printInfo(TranslatableComponent.of("worldedit.count.counted", TextComponent.of(count))); + actor.print(Caption.of("worldedit.count.counted", TextComponent.of(count))); return count; } @@ -551,13 +550,13 @@ public class SelectionCommands { } else { distribution = session.getLastDistribution(); if (distribution == null) { - actor.printError(TranslatableComponent.of("worldedit.distr.no-previous")); + actor.print(Caption.of("worldedit.distr.no-previous")); return; } } if (distribution.isEmpty()) { // *Should* always be false - actor.printError(TranslatableComponent.of("worldedit.distr.no-blocks")); + actor.print(Caption.of("worldedit.distr.no-blocks")); return; } @@ -582,7 +581,7 @@ public class SelectionCommands { if (selector == null) { session.getRegionSelector(world).clear(); session.dispatchCUISelection(actor); - actor.printInfo(TranslatableComponent.of("worldedit.select.cleared")); + actor.print(Caption.of("worldedit.select.cleared")); return; } @@ -592,54 +591,54 @@ public class SelectionCommands { switch (selector) { case CUBOID: newSelector = new CuboidRegionSelector(oldSelector); - actor.printInfo(TranslatableComponent.of("worldedit.select.cuboid.message")); + actor.print(Caption.of("worldedit.select.cuboid.message")); break; case EXTEND: newSelector = new ExtendingCuboidRegionSelector(oldSelector); - actor.printInfo(TranslatableComponent.of("worldedit.select.extend.message")); + actor.print(Caption.of("worldedit.select.extend.message")); break; case POLY: { newSelector = new Polygonal2DRegionSelector(oldSelector); - actor.printInfo(TranslatableComponent.of("worldedit.select.poly.message")); + actor.print(Caption.of("worldedit.select.poly.message")); Optional limit = ActorSelectorLimits.forActor(actor).getPolygonVertexLimit(); - limit.ifPresent(integer -> actor.printInfo(TranslatableComponent.of("worldedit.select.poly.limit-message", TextComponent.of(integer)))); + limit.ifPresent(integer -> actor.print(Caption.of("worldedit.select.poly.limit-message", TextComponent.of(integer)))); break; } case ELLIPSOID: newSelector = new EllipsoidRegionSelector(oldSelector); - actor.printInfo(TranslatableComponent.of("worldedit.select.ellipsoid.message")); + actor.print(Caption.of("worldedit.select.ellipsoid.message")); break; case SPHERE: newSelector = new SphereRegionSelector(oldSelector); - actor.printInfo(TranslatableComponent.of("worldedit.select.sphere.message")); + actor.print(Caption.of("worldedit.select.sphere.message")); break; case CYL: newSelector = new CylinderRegionSelector(oldSelector); - actor.printInfo(TranslatableComponent.of("worldedit.select.cyl.message")); + actor.print(Caption.of("worldedit.select.cyl.message")); break; case CONVEX: case HULL: case POLYHEDRON: { newSelector = new ConvexPolyhedralRegionSelector(oldSelector); - actor.printInfo(TranslatableComponent.of("worldedit.select.convex.message")); + actor.print(Caption.of("worldedit.select.convex.message")); Optional limit = ActorSelectorLimits.forActor(actor).getPolyhedronVertexLimit(); - limit.ifPresent(integer -> actor.printInfo(TranslatableComponent.of("worldedit.select.convex.limit-message", TextComponent.of(integer)))); + limit.ifPresent(integer -> actor.print(Caption.of("worldedit.select.convex.limit-message", TextComponent.of(integer)))); break; } case POLYHEDRAL: newSelector = new PolyhedralRegionSelector(world); - actor.print(TranslatableComponent.of("fawe.selection.sel.convex.polyhedral")); + actor.print(Caption.of("fawe.selection.sel.convex.polyhedral")); Optional limit = ActorSelectorLimits.forActor(actor).getPolyhedronVertexLimit(); limit.ifPresent(integer -> actor.print(Caption.of("fawe.selection.sel.max", integer))); - actor.print(TranslatableComponent.of("fawe.selection.sel.list")); + actor.print(Caption.of("fawe.selection.sel.list")); break; case FUZZY: case MAGIC: Mask maskOpt = new IdMask(world); //TODO Make FuzzyRegionSelector accept actors newSelector = new FuzzyRegionSelector((Player) actor, world, maskOpt); - actor.print(TranslatableComponent.of("fawe.selection.sel.fuzzy")); - actor.print(TranslatableComponent.of("fawe.selection.sel.list")); + actor.print(Caption.of("fawe.selection.sel.fuzzy")); + actor.print(Caption.of("fawe.selection.sel.list")); break; case LIST: default: @@ -648,13 +647,13 @@ public class SelectionCommands { TextComponentProducer contents = box.getContents(); contents.append(SubtleFormat.wrap("Select one of the modes below:")).newline(); - box.appendCommand("cuboid", TranslatableComponent.of("worldedit.select.cuboid.description"), "//sel cuboid"); - box.appendCommand("extend", TranslatableComponent.of("worldedit.select.extend.description"), "//sel extend"); - box.appendCommand("poly", TranslatableComponent.of("worldedit.select.poly.description"), "//sel poly"); - box.appendCommand("ellipsoid", TranslatableComponent.of("worldedit.select.ellipsoid.description"), "//sel ellipsoid"); - box.appendCommand("sphere", TranslatableComponent.of("worldedit.select.sphere.description"), "//sel sphere"); - box.appendCommand("cyl", TranslatableComponent.of("worldedit.select.cyl.description"), "//sel cyl"); - box.appendCommand("convex", TranslatableComponent.of("worldedit.select.convex.description"), "//sel convex"); + box.appendCommand("cuboid", Caption.of("worldedit.select.cuboid.description"), "//sel cuboid"); + box.appendCommand("extend", Caption.of("worldedit.select.extend.description"), "//sel extend"); + box.appendCommand("poly", Caption.of("worldedit.select.poly.description"), "//sel poly"); + box.appendCommand("ellipsoid", Caption.of("worldedit.select.ellipsoid.description"), "//sel ellipsoid"); + box.appendCommand("sphere", Caption.of("worldedit.select.sphere.description"), "//sel sphere"); + box.appendCommand("cyl", Caption.of("worldedit.select.cyl.description"), "//sel cyl"); + box.appendCommand("convex", Caption.of("worldedit.select.convex.description"), "//sel convex"); box.appendCommand("polyhedral", "Select a hollow polyhedral", "//sel polyhedral"); box.appendCommand("fuzzy[=]", "Select all connected blocks (magic wand)", "//sel fuzzy[=]"); @@ -673,7 +672,7 @@ public class SelectionCommands { if (found != null) { session.setDefaultRegionSelector(found); - actor.printInfo(TranslatableComponent.of("worldedit.select.default-set", TextComponent.of(found.name()))); + actor.print(Caption.of("worldedit.select.default-set", TextComponent.of(found.name()))); } else { throw new RuntimeException("Something unexpected happened. Please report this."); } @@ -740,7 +739,7 @@ public class SelectionCommands { @Override public Component create(int page) throws InvalidComponentException { - super.getContents().append(TranslatableComponent.of("worldedit.distr.total", TextColor.GRAY, TextComponent.of(totalBlocks))) + super.getContents().append(Caption.of("worldedit.distr.total", TextComponent.of(totalBlocks))) .append(TextComponent.newline()); return super.create(page); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotCommands.java index 842b16561..755bf7bfd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotCommands.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.command; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; @@ -74,7 +75,7 @@ public class SnapshotCommands { static void checkSnapshotsConfigured(LocalConfiguration localConfiguration) { if (!localConfiguration.snapshotsConfigured) { - throw new StopExecutionException(TranslatableComponent.of( + throw new StopExecutionException(Caption.of( "worldedit.restore.not-configured" )); } @@ -120,7 +121,7 @@ public class SnapshotCommands { if (!snapshots.isEmpty()) { actor.print(new SnapshotListBox(world.getName(), snapshots).create(page)); } else { - actor.printError(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.restore.none-for-specific-world", TextComponent.of(world.getName()) )); @@ -169,9 +170,9 @@ public class SnapshotCommands { session.getSnapshotExperimental().close(); } session.setSnapshot(null); - actor.printInfo(TranslatableComponent.of("worldedit.snapshot.use.newest")); + actor.print(Caption.of("worldedit.snapshot.use.newest")); } else { - actor.printError(TranslatableComponent.of("worldedit.restore.none-for-world")); + actor.print(Caption.of("worldedit.restore.none-for-world")); } } else { URI uri = resolveSnapshotName(config, name); @@ -181,11 +182,11 @@ public class SnapshotCommands { session.getSnapshotExperimental().close(); } session.setSnapshotExperimental(snapshot.get()); - actor.printInfo(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.snapshot.use", TextComponent.of(name) )); } else { - actor.printError(TranslatableComponent.of("worldedit.restore.not-available")); + actor.print(Caption.of("worldedit.restore.not-available")); } } } @@ -207,7 +208,7 @@ public class SnapshotCommands { } if (index < 1) { - actor.printError(TranslatableComponent.of("worldedit.snapshot.index-above-0")); + actor.print(Caption.of("worldedit.snapshot.index-above-0")); return; } @@ -218,7 +219,7 @@ public class SnapshotCommands { .collect(toList()); } if (snapshots.size() < index) { - actor.printError(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.snapshot.index-oob", TextComponent.of(snapshots.size()) )); @@ -226,14 +227,14 @@ public class SnapshotCommands { } Snapshot snapshot = snapshots.get(index - 1); if (snapshot == null) { - actor.printError(TranslatableComponent.of("worldedit.restore.not-available")); + actor.print(Caption.of("worldedit.restore.not-available")); return; } if (session.getSnapshotExperimental() != null) { session.getSnapshotExperimental().close(); } session.setSnapshotExperimental(snapshot); - actor.printInfo(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.snapshot.use", TextComponent.of(snapshot.getInfo().getDisplayName()) )); @@ -263,7 +264,7 @@ public class SnapshotCommands { } if (snapshot == null) { - actor.printError(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.snapshot.none-before", TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date))) ); @@ -272,7 +273,7 @@ public class SnapshotCommands { session.getSnapshotExperimental().close(); } session.setSnapshotExperimental(snapshot); - actor.printInfo(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.snapshot.use", TextComponent.of(snapshot.getInfo().getDisplayName()) )); @@ -302,7 +303,7 @@ public class SnapshotCommands { .findFirst().orElse(null); } if (snapshot == null) { - actor.printError(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.snapshot.none-after", TextComponent.of(dateFormat.withZone(session.getTimeZone()).format(date))) ); @@ -311,7 +312,7 @@ public class SnapshotCommands { session.getSnapshotExperimental().close(); } session.setSnapshotExperimental(snapshot); - actor.printInfo(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.snapshot.use", TextComponent.of(snapshot.getInfo().getDisplayName()) )); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java index 34a1a9c12..d6ec23811 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SnapshotUtilCommands.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; @@ -30,7 +31,6 @@ import com.sk89q.worldedit.command.util.Logging; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.snapshot.experimental.Snapshot; import com.sk89q.worldedit.world.snapshot.experimental.SnapshotRestore; @@ -83,7 +83,7 @@ public class SnapshotUtilCommands { URI uri = resolveSnapshotName(config, snapshotName); Optional snapOpt = config.snapshotDatabase.getSnapshot(uri); if (!snapOpt.isPresent()) { - actor.printError(TranslatableComponent.of("worldedit.restore.not-available")); + actor.print(Caption.of("worldedit.restore.not-available")); return; } snapshot = snapOpt.get(); @@ -100,14 +100,14 @@ public class SnapshotUtilCommands { } if (snapshot == null) { - actor.printError(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.restore.none-for-specific-world", TextComponent.of(world.getName()) )); return; } } - actor.printInfo(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.restore.loaded", TextComponent.of(snapshot.getInfo().getDisplayName()) )); @@ -122,15 +122,15 @@ public class SnapshotUtilCommands { if (restore.hadTotalFailure()) { String error = restore.getLastErrorMessage(); if (!restore.getMissingChunks().isEmpty()) { - actor.printError(TranslatableComponent.of("worldedit.restore.chunk-not-present")); + actor.print(Caption.of("worldedit.restore.chunk-not-present")); } else if (error != null) { - actor.printError(TranslatableComponent.of("worldedit.restore.block-place-failed")); - actor.printError(TranslatableComponent.of("worldedit.restore.block-place-error", TextComponent.of(error))); + actor.print(Caption.of("worldedit.restore.block-place-failed")); + actor.print(Caption.of("worldedit.restore.block-place-error", TextComponent.of(error))); } else { - actor.printError(TranslatableComponent.of("worldedit.restore.chunk-load-failed")); + actor.print(Caption.of("worldedit.restore.chunk-load-failed")); } } else { - actor.printInfo(TranslatableComponent.of("worldedit.restore.restored", + actor.print(Caption.of("worldedit.restore.restored", TextComponent.of(restore.getMissingChunks().size()), TextComponent.of(restore.getErrorChunks().size()))); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SuperPickaxeCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SuperPickaxeCommands.java index ae8d4c836..9406ed261 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/SuperPickaxeCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/SuperPickaxeCommands.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; @@ -51,7 +52,7 @@ public class SuperPickaxeCommands { public void single(Player player, LocalSession session) throws WorldEditException { session.setSuperPickaxe(new SinglePickaxe()); session.enableSuperPickAxe(); - player.printInfo(TranslatableComponent.of("worldedit.tool.superpickaxe.mode.single")); + player.print(Caption.of("worldedit.tool.superpickaxe.mode.single")); } @Command( @@ -66,12 +67,12 @@ public class SuperPickaxeCommands { LocalConfiguration config = we.getConfiguration(); if (range > config.maxSuperPickaxeSize) { - player.printError(TranslatableComponent.of("worldedit.tool.superpickaxe.max-range", TextComponent.of(config.maxSuperPickaxeSize))); + player.print(Caption.of("worldedit.tool.superpickaxe.max-range", TextComponent.of(config.maxSuperPickaxeSize))); return; } session.setSuperPickaxe(new AreaPickaxe(range)); session.enableSuperPickAxe(); - player.printInfo(TranslatableComponent.of("worldedit.tool.superpickaxe.mode.area")); + player.print(Caption.of("worldedit.tool.superpickaxe.mode.area")); } @Command( @@ -87,12 +88,12 @@ public class SuperPickaxeCommands { LocalConfiguration config = we.getConfiguration(); if (range > config.maxSuperPickaxeSize) { - player.printError(TranslatableComponent.of("worldedit.tool.superpickaxe.max-range", TextComponent.of(config.maxSuperPickaxeSize))); + player.print(Caption.of("worldedit.tool.superpickaxe.max-range", TextComponent.of(config.maxSuperPickaxeSize))); return; } session.setSuperPickaxe(new RecursivePickaxe(range)); session.enableSuperPickAxe(); - player.printInfo(TranslatableComponent.of("worldedit.tool.superpickaxe.mode.recursive")); + player.print(Caption.of("worldedit.tool.superpickaxe.mode.recursive")); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java index e2eab7d4b..fc76c93ad 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolCommands.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.object.brush.InspectBrush; import com.google.common.collect.Collections2; import com.sk89q.worldedit.LocalConfiguration; @@ -52,7 +53,6 @@ import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.event.ClickEvent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; import com.sk89q.worldedit.world.block.BlockStateHolder; @@ -120,7 +120,7 @@ public class ToolCommands { .collect(Collectors.toSet()); commandManager.register("tool", command -> { command.addPart(SubCommandPart.builder( - TranslatableComponent.of("tool"), + Caption.of("tool"), TextComponent.of("The tool to bind") ) .withCommands(nonGlobalCommands) @@ -145,18 +145,18 @@ public class ToolCommands { throws InvalidToolBindException { isBrush = session.getTool(player) instanceof BrushTool; session.setTool(player.getItemInHand(HandSide.MAIN_HAND).getType(), null); - player.printInfo(TranslatableComponent.of(isBrush ? "worldedit.brush.none.equip" : "worldedit.tool.none.equip")); + player.print(Caption.of(isBrush ? "worldedit.brush.none.equip" : "worldedit.tool.none.equip")); } static void sendUnbindInstruction(Player sender, Component commandComponent) { - sender.printDebug(TranslatableComponent.of("worldedit.tool.unbind-instruction", commandComponent)); + sender.print(Caption.of("worldedit.tool.unbind-instruction", commandComponent)); } private static void setTool(Player player, LocalSession session, Tool tool, String translationKey) throws InvalidToolBindException { BaseItemStack itemStack = player.getItemInHand(HandSide.MAIN_HAND); session.setTool(itemStack.getType(), tool); - player.printInfo(TranslatableComponent.of(translationKey, itemStack.getRichName())); + player.print(Caption.of(translationKey, itemStack.getRichName())); sendUnbindInstruction(player, UNBIND_COMMAND_COMPONENT); } @@ -278,7 +278,7 @@ public class ToolCommands { LocalConfiguration config = we.getConfiguration(); if (range > config.maxSuperPickaxeSize) { - player.printError(TranslatableComponent.of("worldedit.tool.superpickaxe.max-range", TextComponent.of(config.maxSuperPickaxeSize))); + player.print(Caption.of("worldedit.tool.superpickaxe.max-range", TextComponent.of(config.maxSuperPickaxeSize))); return; } setTool(player, session, new FloodFillTool(range, pattern), "worldedit.tool.floodfill.equip"); @@ -328,6 +328,6 @@ public class ToolCommands { } else { secondaryName = TextComponent.of("pattern"); } - player.printInfo(TranslatableComponent.of("worldedit.tool.lrbuild.set", primaryName, secondaryName)); + player.print(Caption.of("worldedit.tool.lrbuild.set", primaryName, secondaryName)); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java index f941d951c..533e98a80 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java @@ -43,7 +43,6 @@ import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.internal.command.CommandArgParser; import com.sk89q.worldedit.util.HandSide; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import org.enginehub.piston.annotation.Command; import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.param.Arg; @@ -77,11 +76,11 @@ public class ToolUtilCommands { Mask maskOpt, Arguments arguments) throws WorldEditException { BrushTool tool = session.getBrushTool(player, false); if (tool == null) { - player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none")); + player.print(Caption.of("fawe.worldedit.brush.brush.none")); return; } if (maskOpt == null) { - player.printInfo(TranslatableComponent.of("worldedit.tool.mask.disabled")); + player.print(Caption.of("worldedit.tool.mask.disabled")); tool.setMask(null); } else { BrushSettings settings = offHand ? tool.getOffHand() : tool.getContext(); @@ -90,7 +89,7 @@ public class ToolUtilCommands { settings.addSetting(BrushSettings.SettingType.MASK, lastArg); settings.setMask(maskOpt); tool.update(); - player.printInfo(TranslatableComponent.of("worldedit.tool.mask.set")); + player.print(Caption.of("worldedit.tool.mask.set")); } } @@ -107,7 +106,7 @@ public class ToolUtilCommands { boolean offHand, Arguments arguments) throws WorldEditException { BrushTool tool = session.getBrushTool(player, false); if (tool == null) { - player.printInfo(TranslatableComponent.of("fawe.worldedit.brush.brush.none")); + player.print(Caption.of("fawe.worldedit.brush.brush.none")); return; } if (pattern == null) { @@ -119,7 +118,7 @@ public class ToolUtilCommands { settings.addSetting(BrushSettings.SettingType.FILL, lastArg); tool.update(); } - player.printInfo(TranslatableComponent.of("worldedit.tool.material.set")); + player.print(Caption.of("worldedit.tool.material.set")); } @Command( @@ -132,7 +131,7 @@ public class ToolUtilCommands { @Arg(desc = "The range of the brush") int range) throws WorldEditException { session.getBrushTool(player, false).setRange(range); - player.printInfo(TranslatableComponent.of("worldedit.tool.range.set")); + player.print(Caption.of("worldedit.tool.range.set")); } @Command( @@ -146,7 +145,7 @@ public class ToolUtilCommands { we.checkMaxBrushRadius(size); session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()).setSize(size); - player.printInfo(TranslatableComponent.of("worldedit.tool.size.set")); + player.print(Caption.of("worldedit.tool.size.set")); } @Command( @@ -160,9 +159,9 @@ public class ToolUtilCommands { Mask maskOpt) throws WorldEditException { session.getBrushTool(player, false).setTraceMask(maskOpt); if (maskOpt == null) { - player.printInfo(TranslatableComponent.of("worldedit.tool.tracemask.disabled")); + player.print(Caption.of("worldedit.tool.tracemask.disabled")); } else { - player.printInfo(TranslatableComponent.of("worldedit.tool.tracemask.set")); + player.print(Caption.of("worldedit.tool.tracemask.set")); } } @@ -177,15 +176,15 @@ public class ToolUtilCommands { Boolean superPickaxe) { boolean hasSuperPickAxe = session.hasSuperPickAxe(); if (superPickaxe != null && superPickaxe == hasSuperPickAxe) { - player.printError(TranslatableComponent.of(superPickaxe ? "worldedit.tool.superpickaxe.enabled.already" : "worldedit.tool.superpickaxe.disabled.already")); + player.print(Caption.of(superPickaxe ? "worldedit.tool.superpickaxe.enabled.already" : "worldedit.tool.superpickaxe.disabled.already")); return; } if (hasSuperPickAxe) { session.disableSuperPickAxe(); - player.printInfo(TranslatableComponent.of("worldedit.tool.superpickaxe.disabled")); + player.print(Caption.of("worldedit.tool.superpickaxe.disabled")); } else { session.enableSuperPickAxe(); - player.printInfo(TranslatableComponent.of("worldedit.tool.superpickaxe.enabled")); + player.print(Caption.of("worldedit.tool.superpickaxe.enabled")); } } @@ -248,7 +247,7 @@ public class ToolUtilCommands { int mode) throws WorldEditException { BrushTool tool = session.getBrushTool(player, false); if (tool == null) { - player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none")); + player.print(Caption.of("fawe.worldedit.brush.brush.none")); return; } VisualMode[] modes = VisualMode.values(); @@ -268,7 +267,7 @@ public class ToolUtilCommands { int mode) throws WorldEditException { BrushTool tool = session.getBrushTool(player, false); if (tool == null) { - player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none")); + player.print(Caption.of("fawe.worldedit.brush.brush.none")); return; } TargetMode[] modes = TargetMode.values(); @@ -287,7 +286,7 @@ public class ToolUtilCommands { @Arg(name = "offset", desc = "offset", def = "0") int offset) throws WorldEditException { BrushTool tool = session.getBrushTool(player, false); if (tool == null) { - player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none")); + player.print(Caption.of("fawe.worldedit.brush.brush.none")); return; } tool.setTargetOffset(offset); @@ -308,7 +307,7 @@ public class ToolUtilCommands { List commandStr) throws WorldEditException { BrushTool bt = session.getBrushTool(player, false); if (bt == null) { - player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none")); + player.print(Caption.of("fawe.worldedit.brush.brush.none")); return; } @@ -316,7 +315,7 @@ public class ToolUtilCommands { Scroll action = Scroll.fromArguments(bt, player, session, mode, commandStr, true); settings.setScrollAction(action); if (mode == Scroll.Action.NONE) { - player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.scroll.action.unset")); + player.print(Caption.of("fawe.worldedit.brush.brush.scroll.action.unset")); } else if (action != null) { String full = (mode.name().toLowerCase(Locale.ROOT) + " " + StringMan.join(commandStr, " ")).trim(); settings.addSetting(BrushSettings.SettingType.SCROLL_ACTION, full); @@ -342,11 +341,11 @@ public class ToolUtilCommands { Arguments arguments) throws WorldEditException { BrushTool tool = session.getBrushTool(player, false); if (tool == null) { - player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none")); + player.print(Caption.of("fawe.worldedit.brush.brush.none")); return; } if (maskArg == null) { - player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.source.mask.disabled")); + player.print(Caption.of("fawe.worldedit.brush.brush.source.mask.disabled")); tool.setSourceMask(null); return; } @@ -355,7 +354,7 @@ public class ToolUtilCommands { settings.addSetting(BrushSettings.SettingType.SOURCE_MASK, lastArg); settings.setSourceMask(maskArg); tool.update(); - player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.source.mask")); + player.print(Caption.of("fawe.worldedit.brush.brush.source.mask")); } // TODO: Ping @MattBDev to reimplement 2020-02-04 diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 50700b8b9..0b184b615 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -67,7 +67,6 @@ import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.formatting.component.SubtleFormat; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BlockTypes; @@ -217,7 +216,7 @@ public class UtilityCommands { BlockVector3 pos = session.getPlacementPosition(actor); int affected = editSession.fillDirection(pos, pattern, radius, depth, direction); - actor.printInfo(TranslatableComponent.of("worldedit.fill.created", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.fill.created", TextComponent.of(affected))); return affected; } @@ -315,7 +314,7 @@ public class UtilityCommands { BlockVector3 pos = session.getPlacementPosition(actor); int affected = editSession.fillXZ(pos, pattern, radius, depth, true); - actor.printInfo(TranslatableComponent.of("worldedit.fillr.created", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.fillr.created", TextComponent.of(affected))); return affected; } @@ -336,7 +335,7 @@ public class UtilityCommands { radius = Math.max(0, radius); we.checkMaxRadius(radius); int affected = editSession.drainArea(session.getPlacementPosition(actor), radius, waterlogged, plants); - actor.printInfo(TranslatableComponent.of("worldedit.drain.drained", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.drain.drained", TextComponent.of(affected))); return affected; } @@ -353,7 +352,7 @@ public class UtilityCommands { radius = Math.max(0, radius); we.checkMaxRadius(radius); int affected = editSession.fixLiquid(session.getPlacementPosition(actor), radius, BlockTypes.LAVA); - actor.printInfo(TranslatableComponent.of("worldedit.fixlava.fixed", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.fixlava.fixed", TextComponent.of(affected))); return affected; } @@ -370,7 +369,7 @@ public class UtilityCommands { radius = Math.max(0, radius); we.checkMaxRadius(radius); int affected = editSession.fixLiquid(session.getPlacementPosition(actor), radius, BlockTypes.WATER); - actor.printInfo(TranslatableComponent.of("worldedit.fixwater.fixed", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.fixwater.fixed", TextComponent.of(affected))); return affected; } @@ -391,7 +390,7 @@ public class UtilityCommands { height = height != null ? Math.min((world.getMaxY() + 1), height + 1) : (world.getMaxY() + 1); int affected = editSession.removeAbove(session.getPlacementPosition(actor), size, height); - actor.printInfo(TranslatableComponent.of("worldedit.removeabove.removed", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.removeabove.removed", TextComponent.of(affected))); return affected; } @@ -412,7 +411,7 @@ public class UtilityCommands { height = height != null ? Math.min((world.getMaxY() + 1), height + 1) : (world.getMaxY() + 1); int affected = editSession.removeBelow(session.getPlacementPosition(actor), size, height); - actor.printInfo(TranslatableComponent.of("worldedit.removebelow.removed", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.removebelow.removed", TextComponent.of(affected))); return affected; } @@ -432,7 +431,7 @@ public class UtilityCommands { we.checkMaxRadius(radius); int affected = editSession.removeNear(session.getPlacementPosition(actor), mask, radius); - actor.printInfo(TranslatableComponent.of("worldedit.removenear.removed", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.removenear.removed", TextComponent.of(affected))); return affected; } @@ -463,7 +462,7 @@ public class UtilityCommands { } int affected = editSession.replaceBlocks(region, from, to); - actor.printInfo(TranslatableComponent.of("worldedit.replacenear.replaced", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.replacenear.replaced", TextComponent.of(affected))); return affected; } @@ -494,7 +493,7 @@ public class UtilityCommands { CylinderRegion region = new CylinderRegion(position, Vector2.at(size, size), position.getBlockY() - height, position.getBlockY() + height); int affected = editSession.simulateSnow(region, stack); - actor.printInfo(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.snow.created", TextComponent.of(affected) )); return affected; @@ -521,7 +520,7 @@ public class UtilityCommands { we.checkMaxRadius(size); int affected = editSession.thaw(session.getPlacementPosition(actor), size, height); - actor.printInfo(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.thaw.removed", TextComponent.of(affected) )); return affected; @@ -553,7 +552,7 @@ public class UtilityCommands { final int affected = editSession.green( session.getPlacementPosition(actor), size, height, onlyNormalDirt ); - actor.printInfo(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.green.changed", TextComponent.of(affected) )); return affected; @@ -578,7 +577,7 @@ public class UtilityCommands { Mask mask = new BlockTypeMask(editSession, BlockTypes.FIRE); int affected = editSession.removeNear(session.getPlacementPosition(actor), mask, size); - actor.printInfo(TranslatableComponent.of("worldedit.extinguish.removed", TextComponent.of(affected))); + actor.print(Caption.of("worldedit.extinguish.removed", TextComponent.of(affected))); return affected; } @@ -615,7 +614,7 @@ public class UtilityCommands { if (radius == null) { radius = config.butcherDefaultRadius; } else if (radius < -1) { - actor.printError(TranslatableComponent.of("worldedit.butcher.explain-all")); + actor.print(Caption.of("worldedit.butcher.explain-all")); return 0; } else if (radius == -1) { if (config.butcherMaxRadius != -1) { @@ -639,7 +638,7 @@ public class UtilityCommands { int killed = killMatchingEntities(radius, actor, flags::createFunction); - actor.printInfo(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.butcher.killed", TextComponent.of(killed), TextComponent.of(radius) @@ -661,12 +660,12 @@ public class UtilityCommands { @Arg(desc = "The radius of the cuboid to remove from") int radius) throws WorldEditException { if (radius < -1) { - actor.printError(TranslatableComponent.of("worldedit.remove.explain-all")); + actor.print(Caption.of("worldedit.remove.explain-all")); return 0; } int removed = killMatchingEntities(radius, actor, remover::createFunction); - actor.printInfo(TranslatableComponent.of("worldedit.remove.removed", TextComponent.of(removed))); + actor.print(Caption.of("worldedit.remove.removed", TextComponent.of(removed))); return removed; } @@ -716,7 +715,7 @@ public class UtilityCommands { try { expression = Expression.compile(String.join(" ", input)); } catch (ExpressionException e) { - actor.printError(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.calc.invalid.with-error", TextComponent.of(String.join(" ", input)), TextComponent.of(e.getMessage()) @@ -755,7 +754,7 @@ public class UtilityCommands { @CommandPermissions(value = "fawe.confirm", queued = false) public void confirm(Player player) throws WorldEditException { if (!player.confirm()) { - player.print(TranslatableComponent.of("fawe.worldedit.utility.nothing.confirmed")); + player.print(Caption.of("fawe.worldedit.utility.nothing.confirmed")); } } @@ -819,7 +818,7 @@ public class UtilityCommands { getFiles(dir, actor, args, formatName, playerFolder, fileList::add); if (fileList.isEmpty()) { - actor.print(TranslatableComponent.of("fawe.worldedit.schematic.schematic.none")); + actor.print(Caption.of("fawe.worldedit.schematic.schematic.none")); return Collections.emptyList(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java index 25d2bd554..8ebe8a88e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/WorldEditCommands.java @@ -21,6 +21,7 @@ package com.sk89q.worldedit.command; import com.boydti.fawe.Fawe; import com.boydti.fawe.FaweVersion; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.config.Settings; import com.intellectualsites.paster.IncendoPaster; import com.sk89q.worldedit.LocalSession; @@ -92,7 +93,7 @@ public class WorldEditCommands { TextComponent buildArg = TextComponent.of(version.build); TextComponent platformArg = TextComponent.of(Settings.IMP.PLATFORM); - actor.printInfo(TranslatableComponent.of("worldedit.version.version", dateArg, commitArg, buildArg, platformArg)); + actor.print(Caption.of("worldedit.version.version", dateArg, commitArg, buildArg, platformArg)); } actor.printInfo(TextComponent.of("Wiki: https://wiki.intellectualsites.com/FastAsyncWorldEdit/index")); @@ -132,7 +133,7 @@ public class WorldEditCommands { we.getPlatformManager().queryCapability(Capability.CONFIGURATION).reload(); we.getEventBus().post(new ConfigurationLoadEvent(we.getPlatformManager().queryCapability(Capability.CONFIGURATION).getConfiguration())); Fawe.get().setupConfigs(); - actor.printInfo(TranslatableComponent.of("worldedit.reload.config")); + actor.print(Caption.of("worldedit.reload.config")); } @Command( @@ -151,7 +152,7 @@ public class WorldEditCommands { actor.printInfo(TextComponent.of(e.getMessage())); return; } - actor.printInfo(TranslatableComponent.of("worldedit.report.written", TextComponent.of(dest).clickEvent( + actor.print(Caption.of("worldedit.report.written", TextComponent.of(dest).clickEvent( ClickEvent.openUrl(dest)))); } @@ -164,7 +165,7 @@ public class WorldEditCommands { Map stacks = Thread.getAllStackTraces(); for (Map.Entry entry : stacks.entrySet()) { Thread thread = entry.getKey(); - actor.printDebug(TranslatableComponent.of( + actor.printDebug(TextComponent.of( "--------------------------------------------------------------------------------------------")); actor.printDebug("Thread: " + thread.getName() + " | Id: " + thread.getId() + " | Alive: " + thread.isAlive()); for (StackTraceElement elem : entry.getValue()) { @@ -194,13 +195,13 @@ public class WorldEditCommands { try { ZoneId tz = ZoneId.of(timezone); session.setTimezone(tz); - actor.printInfo(TranslatableComponent.of("worldedit.timezone.set", TextComponent.of(tz.getDisplayName( + actor.print(Caption.of("worldedit.timezone.set", TextComponent.of(tz.getDisplayName( TextStyle.FULL, actor.getLocale() )))); - actor.printInfo(TranslatableComponent.of("worldedit.timezone.current", + actor.print(Caption.of("worldedit.timezone.current", TextComponent.of(dateFormat.withLocale(actor.getLocale()).format(ZonedDateTime.now(tz))))); } catch (ZoneRulesException e) { - actor.printError(TranslatableComponent.of("worldedit.timezone.invalid")); + actor.print(Caption.of("worldedit.timezone.invalid")); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java index 465957dee..00a981d7b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/AreaPickaxe.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command.tool; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; @@ -80,7 +81,7 @@ public class AreaPickaxe implements BlockTool { } editSession.flushQueue(); } catch (MaxChangedBlocksException e) { - player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes")); + player.print(Caption.of("worldedit.tool.max-block-changes")); } finally { session.remember(editSession); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java index 582ae437b..042810c9e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockDataCyler.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command.tool; +import com.boydti.fawe.config.Caption; import com.google.common.collect.Lists; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; @@ -65,12 +66,12 @@ public class BlockDataCyler implements DoubleActionBlockTool { if (!config.allowedDataCycleBlocks.isEmpty() && !player.hasPermission("worldedit.override.data-cycler") && !config.allowedDataCycleBlocks.contains(block.getBlockType().getId())) { - player.printError(TranslatableComponent.of("worldedit.tool.data-cycler.block-not-permitted")); + player.print(Caption.of("worldedit.tool.data-cycler.block-not-permitted")); return true; } if (block.getStates().keySet().isEmpty()) { - player.printError(TranslatableComponent.of("worldedit.tool.data-cycler.cant-cycle")); + player.print(Caption.of("worldedit.tool.data-cycler.cant-cycle")); } else { Property currentProperty = selectedProperties.get(player.getUniqueId()); @@ -92,13 +93,13 @@ public class BlockDataCyler implements DoubleActionBlockTool { try { editSession.setBlock(blockPoint, newBlock); - player.printInfo(TranslatableComponent.of( + player.print(Caption.of( "worldedit.tool.data-cycler.new-value", TextComponent.of(currentProperty.getName()), TextComponent.of(String.valueOf(currentProperty.getValues().get(index))) )); } catch (MaxChangedBlocksException e) { - player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes")); + player.print(Caption.of("worldedit.tool.max-block-changes")); } finally { session.remember(editSession); } @@ -109,7 +110,7 @@ public class BlockDataCyler implements DoubleActionBlockTool { index = (index + 1) % properties.size(); currentProperty = properties.get(index); selectedProperties.put(player.getUniqueId(), currentProperty); - player.printInfo(TranslatableComponent.of("worldedit.tool.data-cycler.cycling", TextComponent.of(currentProperty.getName()))); + player.print(Caption.of("worldedit.tool.data-cycler.cycling", TextComponent.of(currentProperty.getName()))); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java index 5c3aabb9e..0b12833ba 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BlockReplacer.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command.tool; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; @@ -78,7 +79,7 @@ public class BlockReplacer implements DoubleActionBlockTool { if (targetBlock != null) { pattern = targetBlock; - player.printInfo(TranslatableComponent.of("worldedit.tool.repl.switched", targetBlock.getBlockType().getRichName())); + player.print(Caption.of("worldedit.tool.repl.switched", targetBlock.getBlockType().getRichName())); } return true; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BrushTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BrushTool.java index 91d1079c9..931aae93c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BrushTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/BrushTool.java @@ -446,7 +446,7 @@ public class BrushTool if (target == null) { editSession.cancel(); - player.printError(TranslatableComponent.of("worldedit.tool.no-block")); + player.print(Caption.of("worldedit.tool.no-block")); return true; } BlockBag bag = session.getBlockBag(player); @@ -481,7 +481,7 @@ public class BrushTool WorldEdit.getInstance().checkMaxBrushRadius(size); brush.build(editSession, target.toBlockPoint(), current.getMaterial(), size); } catch (MaxChangedBlocksException e) { - player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes")); + player.print(Caption.of("worldedit.tool.max-block-changes")); } finally { session.remember(editSession); if (bag != null) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java index 5d62d7abd..9dde1c967 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/DistanceWand.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command.tool; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.entity.Player; @@ -79,7 +80,7 @@ public class DistanceWand extends BrushTool implements DoubleActionTraceTool { } if (target == null) { - player.printError(TranslatableComponent.of("worldedit.tool.no-block")); + player.print(Caption.of("worldedit.tool.no-block")); return null; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java index fd98f0bd0..5217537dd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloatingTreeRemover.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command.tool; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.object.collection.LocalBlockVectorSet; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; @@ -75,7 +76,7 @@ public class FloatingTreeRemover implements BlockTool { final BlockState state = world.getBlock(clicked.toVector().toBlockPoint()); if (!isTreeBlock(state.getBlockType())) { - player.printError(TranslatableComponent.of("worldedit.tool.deltree.not-tree")); + player.print(Caption.of("worldedit.tool.deltree.not-tree")); return true; } @@ -83,7 +84,7 @@ public class FloatingTreeRemover implements BlockTool { try { final Set blockSet = bfs(world, clicked.toVector().toBlockPoint()); if (blockSet == null) { - player.printError(TranslatableComponent.of("worldedit.tool.deltree.not-floating")); + player.print(Caption.of("worldedit.tool.deltree.not-floating")); return true; } @@ -94,7 +95,7 @@ public class FloatingTreeRemover implements BlockTool { } } } catch (MaxChangedBlocksException e) { - player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes")); + player.print(Caption.of("worldedit.tool.max-block-changes")); } finally { session.remember(editSession); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java index ca631c79f..21700fca0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/FloodFillTool.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command.tool; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; @@ -83,7 +84,7 @@ public class FloodFillTool implements BlockTool { visitor.visit(origin); Operations.completeLegacy(visitor); } catch (MaxChangedBlocksException e) { - player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes")); + player.print(Caption.of("worldedit.tool.max-block-changes")); } finally { session.remember(editSession); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java index eec483eeb..b5d080ad5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/LongRangeBuildTool.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command.tool; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; @@ -121,7 +122,7 @@ public class LongRangeBuildTool extends BrushTool implements DoubleActionTraceTo } if (target == null) { - player.printError(TranslatableComponent.of("worldedit.tool.no-block")); + player.print(Caption.of("worldedit.tool.no-block")); return null; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/NavigationWand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/NavigationWand.java index 9a3ab6d8a..88f71d595 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/NavigationWand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/NavigationWand.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command.tool; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.entity.Player; @@ -43,7 +44,7 @@ public enum NavigationWand implements DoubleActionTraceTool { if (pos != null) { player.findFreePosition(pos); } else { - player.printError(TranslatableComponent.of("worldedit.jumpto.none")); + player.print(Caption.of("worldedit.jumpto.none")); } return true; } @@ -59,7 +60,7 @@ public enum NavigationWand implements DoubleActionTraceTool { } if (!player.passThroughForwardWall(Math.max(1, maxDist - 10))) { - player.printError(TranslatableComponent.of("worldedit.thru.obstructed")); + player.print(Caption.of("worldedit.thru.obstructed")); } return true; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java index ebce5559e..dad1281e0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/QueryTool.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command.tool; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; @@ -61,21 +62,21 @@ public class QueryTool implements BlockTool { builder.append(TextComponent.of("@" + clicked.toVector().toBlockPoint() + ": ", TextColor.BLUE)); builder.append(block.getBlockType().getRichName().color(TextColor.YELLOW)); builder.append(TextComponent.of(" (" + block + ") ", TextColor.GRAY) - .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TranslatableComponent.of("worldedit.tool.info.blockstate.hover")))); + .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, Caption.of("worldedit.tool.info.blockstate.hover")))); final int internalId = BlockStateIdAccess.getBlockStateId(block.toImmutableState()); if (BlockStateIdAccess.isValidInternalId(internalId)) { builder.append(TextComponent.of(" (" + internalId + ") ", TextColor.DARK_GRAY) - .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TranslatableComponent.of("worldedit.tool.info.internalid.hover")))); + .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, Caption.of("worldedit.tool.info.internalid.hover")))); } final int[] legacy = LegacyMapper.getInstance().getLegacyFromBlock(block.toImmutableState()); if (legacy != null) { builder.append(TextComponent.of(" (" + legacy[0] + ":" + legacy[1] + ") ", TextColor.DARK_GRAY) - .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TranslatableComponent.of("worldedit.tool.info.legacy.hover")))); + .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, Caption.of("worldedit.tool.info.legacy.hover")))); } builder.append(TextComponent.of(" (" + world.getBlockLightLevel(blockPoint) + "/" + world.getBlockLightLevel(blockPoint.add(0, 1, 0)) + ")", TextColor.WHITE) - .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TranslatableComponent.of("worldedit.tool.info.light.hover")))); + .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, Caption.of("worldedit.tool.info.light.hover")))); player.print(builder.build()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java index 8bbd64d78..14c353bbf 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/SinglePickaxe.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command.tool; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; @@ -57,7 +58,7 @@ public class SinglePickaxe implements BlockTool { editSession.setBlock(blockPoint, BlockTypes.AIR.getDefaultState()); session.remember(editSession); } catch (MaxChangedBlocksException e) { - player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes")); + player.print(Caption.of("worldedit.tool.max-block-changes")); } return true; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java index cd3b641f1..24debf5d8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/tool/TreePlanter.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command.tool; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; @@ -63,10 +64,10 @@ public class TreePlanter implements BlockTool { } if (!successful) { - player.printError(TranslatableComponent.of("worldedit.tool.tree.obstructed")); + player.print(Caption.of("worldedit.tool.tree.obstructed")); } } catch (MaxChangedBlocksException e) { - player.printError(TranslatableComponent.of("worldedit.tool.max-block-changes")); + player.print(Caption.of("worldedit.tool.max-block-changes")); } finally { session.remember(editSession); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/PrintCommandHelp.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/PrintCommandHelp.java index 0d3c21ba8..80ed1ba85 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/PrintCommandHelp.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/PrintCommandHelp.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.command.util; +import com.boydti.fawe.config.Caption; import com.google.common.base.Joiner; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; @@ -79,7 +80,7 @@ public class PrintCommandHelp { List visited = new ArrayList<>(); Command currentCommand = detectCommand(manager, commandPath.get(0)); if (currentCommand == null) { - actor.printError(TranslatableComponent.of("worldedit.help.command-not-found", TextComponent.of(commandPath.get(0)))); + actor.print(Caption.of("worldedit.help.command-not-found", TextComponent.of(commandPath.get(0)))); return; } visited.add(currentCommand); @@ -90,7 +91,7 @@ public class PrintCommandHelp { Map subCommands = getSubCommands(currentCommand); if (subCommands.isEmpty()) { - actor.printError(TranslatableComponent.of("worldedit.help.no-subcommands", + actor.print(Caption.of("worldedit.help.no-subcommands", TextComponent.of(toCommandString(visited)), TextComponent.of(subCommand))); // full help for single command CommandUsageBox box = new CommandUsageBox(visited, visited.stream() @@ -103,7 +104,7 @@ public class PrintCommandHelp { currentCommand = subCommands.get(subCommand); visited.add(currentCommand); } else { - actor.printError(TranslatableComponent.of("worldedit.help.subcommand-not-found", + actor.print(Caption.of("worldedit.help.subcommand-not-found", TextComponent.of(subCommand), TextComponent.of(toCommandString(visited)))); // list subcommands for currentCommand printCommands(page, getSubCommands(Iterables.getLast(visited)).values().stream(), actor, visited, helpRootCommand); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/annotation/Confirm.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/annotation/Confirm.java index cf712a476..0ea63631a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/annotation/Confirm.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/util/annotation/Confirm.java @@ -14,7 +14,6 @@ import com.sk89q.worldedit.internal.util.Substring; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import org.enginehub.piston.exception.StopExecutionException; import org.enginehub.piston.inject.InjectAnnotation; import org.enginehub.piston.inject.InjectedValueAccess; @@ -102,7 +101,7 @@ public @interface Confirm { if (checkExisting(context)) { return true; } - actor.print(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.confirm")); + actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason.confirm")); return confirm(actor, context); } }; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java index 4513ce56c..b12abc4c4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/entity/Player.java @@ -20,6 +20,7 @@ package com.sk89q.worldedit.entity; import com.boydti.fawe.Fawe; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.brush.visualization.VirtualWorld; import com.boydti.fawe.object.clipboard.DiskOptimizedClipboard; @@ -47,14 +48,13 @@ import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.gamemode.GameMode; -import java.io.File; import javax.annotation.Nullable; +import java.io.File; /** * Represents a player. @@ -431,12 +431,12 @@ public interface Player extends Entity, Actor { getSession().setClipboard(holder); } } catch (Exception event) { - printError(TranslatableComponent.of("====== INVALID CLIPBOARD ======")); + printError(TextComponent.of("====== INVALID CLIPBOARD ======")); event.printStackTrace(); - printError(TranslatableComponent.of("fawe.error.stacktrace")); - printError(TranslatableComponent.of("fawe.error.no-failure")); - printError(TranslatableComponent.of("File: ", TextComponent.of(file.getName()), TextComponent.of(" (len:"), TextComponent.of(file.length()), TextComponent.of(")"))); - printError(TranslatableComponent.of("fawe.error.stacktrace")); + printError(Caption.of("fawe.error.stacktrace")); + printError(Caption.of("fawe.error.no-failure")); + printError(Caption.of("File: ", TextComponent.of(file.getName()), TextComponent.of(" (len:"), TextComponent.of(file.length()), TextComponent.of(")"))); + printError(Caption.of("fawe.error.stacktrace")); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/MaskFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/MaskFactory.java index d41f92849..1462a9520 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/MaskFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/MaskFactory.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.factory; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.factory.parser.mask.AdjacentMaskParser; import com.sk89q.worldedit.extension.factory.parser.mask.AirMaskParser; @@ -138,14 +139,14 @@ public final class MaskFactory extends AbstractFactory { } } if (match == null) { - throw new NoMatchException(TranslatableComponent.of("worldedit.error.no-match", TextComponent.of(component))); + throw new NoMatchException(Caption.of("worldedit.error.no-match", TextComponent.of(component))); } masks.add(match); } switch (masks.size()) { case 0: - throw new NoMatchException(TranslatableComponent.of("worldedit.error.no-match", TextComponent.of(input))); + throw new NoMatchException(Caption.of("worldedit.error.no-match", TextComponent.of(input))); case 1: return masks.get(0).optimize(); default: diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java index ff339510c..3fc907f5c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultBlockParser.java @@ -84,10 +84,10 @@ public class DefaultBlockParser extends InputParser { } catch (NotABlockException e) { throw new InputParseException(e.getRichMessage()); } catch (WorldEditException e) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.unknown", e.getRichMessage()), e); + throw new InputParseException(Caption.of("worldedit.error.unknown", e.getRichMessage()), e); } } else { - throw new InputParseException(TranslatableComponent.of( + throw new InputParseException(Caption.of( "worldedit.error.parser.player-only", TextComponent.of(handSide == HandSide.MAIN_HAND ? "hand" : "offhand") )); @@ -181,7 +181,7 @@ public class DefaultBlockParser extends InputParser { String[] parts = parseableData.split("="); if (parts.length != 2) { throw new InputParseException( - TranslatableComponent.of("worldedit.error.parser.bad-state-format", + Caption.of("worldedit.error.parser.bad-state-format", TextComponent.of(parseableData)) ); } @@ -190,7 +190,7 @@ public class DefaultBlockParser extends InputParser { Property propertyKey = (Property) type.getPropertyMap().get(parts[0]); if (propertyKey == null) { if (context.getActor() != null) { - throw new NoMatchException(TranslatableComponent.of( + throw new NoMatchException(Caption.of( "worldedit.error.parser.unknown-property", TextComponent.of(parts[0]), TextComponent.of(type.getId()) @@ -201,7 +201,7 @@ public class DefaultBlockParser extends InputParser { return Maps.newHashMap(); } if (blockStates.containsKey(propertyKey)) { - throw new InputParseException(TranslatableComponent.of( + throw new InputParseException(Caption.of( "worldedit.error.parser.duplicate-property", TextComponent.of(parts[0]) )); @@ -210,7 +210,7 @@ public class DefaultBlockParser extends InputParser { try { value = propertyKey.getValueFor(parts[1]); } catch (IllegalArgumentException e) { - throw new NoMatchException(TranslatableComponent.of( + throw new NoMatchException(Caption.of( "worldedit.error.parser.unknown-value", TextComponent.of(parts[1]), TextComponent.of(propertyKey.getName()) @@ -221,7 +221,7 @@ public class DefaultBlockParser extends InputParser { } catch (NoMatchException e) { throw e; // Pass-through } catch (Exception e) { - throw new InputParseException(TranslatableComponent.of( + throw new InputParseException(Caption.of( "worldedit.error.parser.bad-state-format", TextComponent.of(parseableData) )); @@ -264,14 +264,14 @@ public class DefaultBlockParser extends InputParser { try { String[] split = blockAndExtraData[0].split(":", 2); if (split.length == 0) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.invalid-colon")); + throw new InputParseException(Caption.of("worldedit.error.parser.invalid-colon")); } else if (split.length == 1) { state = LegacyMapper.getInstance().getBlockFromLegacy(Integer.parseInt(split[0])); } else if (MathMan.isInteger(split[0])) { int id = Integer.parseInt(split[0]); int data = Integer.parseInt(split[1]); if (data < 0 || data >= 16) { - throw new InputParseException(TranslatableComponent.of("fawe.error.parser.invalid-data", TextComponent.of(data))); + throw new InputParseException(Caption.of("fawe.error.parser.invalid-data", TextComponent.of(data))); } state = LegacyMapper.getInstance().getBlockFromLegacy(id, data); } else { @@ -279,7 +279,7 @@ public class DefaultBlockParser extends InputParser { if (type != null) { int data = Integer.parseInt(split[1]); if (data < 0 || data >= 16) { - throw new InputParseException(TranslatableComponent.of("fawe.error.parser.invalid-data", TextComponent.of(data))); + throw new InputParseException(Caption.of("fawe.error.parser.invalid-data", TextComponent.of(data))); } state = LegacyMapper.getInstance().getBlockFromLegacy(type.getLegacyCombinedId() >> 4, data); } @@ -298,11 +298,11 @@ public class DefaultBlockParser extends InputParser { } else { typeString = blockAndExtraData[0].substring(0, stateStart); if (stateStart + 1 >= blockAndExtraData[0].length()) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.hanging-lbracket", TextComponent.of(stateStart))); + throw new InputParseException(Caption.of("worldedit.error.parser.hanging-lbracket", TextComponent.of(stateStart))); } int stateEnd = blockAndExtraData[0].lastIndexOf(']'); if (stateEnd < 0) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.missing-rbracket")); + throw new InputParseException(Caption.of("worldedit.error.parser.missing-rbracket")); } stateString = blockAndExtraData[0].substring(stateStart + 1, blockAndExtraData[0].length() - 1); } @@ -311,7 +311,7 @@ public class DefaultBlockParser extends InputParser { stateProperties = stateString.split(","); } if (typeString.isEmpty()) { - throw new InputParseException(TranslatableComponent.of( + throw new InputParseException(Caption.of( "worldedit.error.parser.bad-state-format", TextComponent.of(blockAndExtraData[0]) )); @@ -334,25 +334,25 @@ public class DefaultBlockParser extends InputParser { try { primaryPosition = context.requireSession().getRegionSelector(world).getVertices().get(index - 1); } catch (IncompleteRegionException e) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.incomplete-region")); + throw new InputParseException(Caption.of("worldedit.error.incomplete-region")); } state = world.getBlock(primaryPosition); } else if (typeString.matches("slot[0-9]+")) { int slot = Integer.parseInt(typeString.substring(4)) - 1; Actor actor = context.requireActor(); if (!(actor instanceof Player)) { - throw new InputParseException(TranslatableComponent.of("worldedit.command.player-only")); + throw new InputParseException(Caption.of("worldedit.command.player-only")); } Player player = (Player) actor; BlockBag bag = player.getInventoryBlockBag(); if (!(bag instanceof SlottableBlockBag)) { - throw new InputParseException(TranslatableComponent.of("fawe.error.unsupported")); + throw new InputParseException(Caption.of("fawe.error.unsupported")); } SlottableBlockBag slottable = (SlottableBlockBag) bag; BaseItem item = slottable.getItem(slot); if (!item.getType().hasBlockType()) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.not-a-block")); + throw new InputParseException(Caption.of("worldedit.error.not-a-block")); } state = item.getType().getBlockType().getDefaultState(); nbt = item.getNbtData(); @@ -363,7 +363,7 @@ public class DefaultBlockParser extends InputParser { state = type.getDefaultState(); } if (state == null) { - throw new NoMatchException(TranslatableComponent.of("fawe.error.invalid-block-type", TextComponent.of(input))); + throw new NoMatchException(Caption.of("fawe.error.invalid-block-type", TextComponent.of(input))); } } if (nbt == null) { @@ -394,7 +394,7 @@ public class DefaultBlockParser extends InputParser { } // this should be impossible but IntelliJ isn't that smart if (state == null) { - throw new NoMatchException(TranslatableComponent.of("fawe.error.invalid-block-type", TextComponent.of(input))); + throw new NoMatchException(Caption.of("fawe.error.invalid-block-type", TextComponent.of(input))); } if (blockAndExtraData.length > 1 && blockAndExtraData[1].startsWith("{")) { @@ -402,7 +402,7 @@ public class DefaultBlockParser extends InputParser { try { nbt = JSON2NBT.getTagFromJson(joined); } catch (NBTException e) { - throw new NoMatchException(TranslatableComponent.of(e.getMessage())); + throw new NoMatchException(Caption.of(e.getMessage())); } } @@ -413,7 +413,7 @@ public class DefaultBlockParser extends InputParser { Actor actor = context.requireActor(); if (actor != null && !actor.hasPermission("worldedit.anyblock") && worldEdit.getConfiguration().disallowedBlocks.contains(blockType.getId())) { - throw new DisallowedUsageException(TranslatableComponent.of("fawe.error.block.not.allowed", TextComponent.of(input))); + throw new DisallowedUsageException(Caption.of("fawe.error.block.not.allowed", TextComponent.of(input))); } } @@ -436,11 +436,11 @@ public class DefaultBlockParser extends InputParser { String mobName = blockAndExtraData[1]; EntityType ent = EntityTypes.get(mobName.toLowerCase(Locale.ROOT)); if (ent == null) { - throw new NoMatchException(TranslatableComponent.of("worldedit.error.unknown-entity", TextComponent.of(mobName))); + throw new NoMatchException(Caption.of("worldedit.error.unknown-entity", TextComponent.of(mobName))); } mobName = ent.getId(); if (!worldEdit.getPlatformManager().queryCapability(Capability.USER_COMMANDS).isValidMobType(mobName)) { - throw new NoMatchException(TranslatableComponent.of("worldedit.error.unknown-mob", TextComponent.of(mobName))); + throw new NoMatchException(Caption.of("worldedit.error.unknown-mob", TextComponent.of(mobName))); } return validate(context, new MobSpawnerBlock(state, mobName)); } else { @@ -465,12 +465,12 @@ public class DefaultBlockParser extends InputParser { if (context.isRestricted()) { Actor actor = context.requireActor(); if (!actor.hasPermission("worldedit.anyblock") && worldEdit.getConfiguration().checkDisallowedBlocks(holder)) { - throw new DisallowedUsageException(TranslatableComponent.of("fawe.error.block.not.allowed", TextComponent.of(String.valueOf(holder)))); + throw new DisallowedUsageException(Caption.of("fawe.error.block.not.allowed", TextComponent.of(String.valueOf(holder)))); } CompoundTag nbt = holder.getNbtData(); if (nbt != null) { if (!actor.hasPermission("worldedit.anyblock")) { - throw new DisallowedUsageException(TranslatableComponent.of("fawe.error.nbt.forbidden")); + throw new DisallowedUsageException(Caption.of("fawe.error.nbt.forbidden")); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultItemParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultItemParser.java index e5f16fc52..77336af89 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultItemParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/DefaultItemParser.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.factory.parser; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.blocks.BaseItem; import com.sk89q.worldedit.blocks.BaseItemStack; @@ -58,7 +59,7 @@ public class DefaultItemParser extends InputParser { String[] split = input.split(":"); ItemType type; if (split.length == 0) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.invalid-colon")); + throw new InputParseException(Caption.of("worldedit.error.parser.invalid-colon")); } else if (split.length == 1) { type = LegacyMapper.getInstance().getItemFromLegacy(Integer.parseInt(split[0])); } else { @@ -85,7 +86,7 @@ public class DefaultItemParser extends InputParser { } if (item == null) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.unknown-item", TextComponent.of(input))); + throw new InputParseException(Caption.of("worldedit.error.unknown-item", TextComponent.of(input))); } else { return item; } @@ -95,7 +96,7 @@ public class DefaultItemParser extends InputParser { if (actor instanceof Player) { return ((Player) actor).getItemInHand(handSide); } else { - throw new InputParseException(TranslatableComponent.of( + throw new InputParseException(Caption.of( "worldedit.error.parser.player-only", TextComponent.of(handSide == HandSide.MAIN_HAND ? "hand" : "offhand") )); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/RichParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/RichParser.java index 8cff76f2f..3c55119ef 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/RichParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/RichParser.java @@ -1,5 +1,6 @@ package com.sk89q.worldedit.extension.factory.parser; +import com.boydti.fawe.config.Caption; import com.google.common.base.Preconditions; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.input.InputParseException; @@ -143,7 +144,7 @@ public abstract class RichParser extends InputParser { arguments.add(input.substring(openIndex + 1)); } if (requireClosing && open != 0) { - throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-bracketing", TextComponent.of("'[' or ']'?"))); + throw new InputParseException(Caption.of("fawe.error.invalid-bracketing", TextComponent.of("'[' or ']'?"))); } return arguments.toArray(new String[0]); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AngleMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AngleMaskParser.java index f2d9867ee..4c68bce07 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AngleMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/AngleMaskParser.java @@ -1,5 +1,6 @@ package com.sk89q.worldedit.extension.factory.parser.mask; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.object.mask.AngleMask; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.command.util.SuggestionHelper; @@ -40,7 +41,7 @@ public class AngleMaskParser extends RichParser { String maxArg = arguments[1]; boolean degree = minArg.endsWith("d"); if (degree ^ maxArg.endsWith("d")) { - throw new InputParseException(TranslatableComponent.of("fawe.error.mask.angle")); + throw new InputParseException(Caption.of("fawe.error.mask.angle")); } boolean overlay = false; if (arguments.length > 2) { @@ -49,7 +50,7 @@ public class AngleMaskParser extends RichParser { if (flag.equals("-o")) { overlay = true; } else { - throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-flag", + throw new InputParseException(Caption.of("fawe.error.invalid-flag", TextComponent.of(flag))); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BiomeMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BiomeMaskParser.java index 8e487f45a..13edf1880 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BiomeMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BiomeMaskParser.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.factory.parser.mask; +import com.boydti.fawe.config.Caption; import com.google.common.base.Splitter; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.command.util.SuggestionHelper; @@ -74,7 +75,7 @@ public class BiomeMaskParser extends InputParser { for (String biomeName : Splitter.on(",").split(input.substring(1))) { BiomeType biome = BiomeType.REGISTRY.get(biomeName); if (biome == null) { - throw new NoMatchException(TranslatableComponent.of("worldedit.error.unknown-biome", TextComponent.of(biomeName))); + throw new NoMatchException(Caption.of("worldedit.error.unknown-biome", TextComponent.of(biomeName))); } biomes.add(biome); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BlockCategoryMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BlockCategoryMaskParser.java index 234fc6dc5..2fb05e254 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BlockCategoryMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BlockCategoryMaskParser.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.factory.parser.mask; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.command.util.SuggestionHelper; import com.sk89q.worldedit.extension.input.InputParseException; @@ -53,7 +54,7 @@ public class BlockCategoryMaskParser extends InputParser { // This means it's a tag mask. BlockCategory category = BlockCategory.REGISTRY.get(input.substring(2).toLowerCase(Locale.ROOT)); if (category == null) { - throw new InputParseException(TranslatableComponent.of("fawe.error.unrecognised-tag", TextComponent.of(input.substring(2)), TextComponent.of("\\"))); + throw new InputParseException(Caption.of("fawe.error.unrecognised-tag", TextComponent.of(input.substring(2)), TextComponent.of("\\"))); } else { return new BlockCategoryMask(context.requireExtent(), category); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BlockStateMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BlockStateMaskParser.java index d4d3447ce..cef2ef89b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BlockStateMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/BlockStateMaskParser.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.factory.parser.mask; +import com.boydti.fawe.config.Caption; import com.google.common.base.Splitter; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.input.InputParseException; @@ -58,7 +59,7 @@ public class BlockStateMaskParser extends InputParser { Splitter.on(',').omitEmptyStrings().trimResults().withKeyValueSeparator('=').split(states), strict); } catch (Exception e) { - throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-states", TextComponent.of(String.valueOf(e)))); + throw new InputParseException(Caption.of("fawe.error.invalid-states", TextComponent.of(String.valueOf(e)))); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ExpressionMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ExpressionMaskParser.java index f230da13d..b101a363d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ExpressionMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ExpressionMaskParser.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.factory.parser.mask; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.ParserContext; @@ -68,7 +69,7 @@ public class ExpressionMaskParser extends InputParser { } return new ExpressionMask(exp); } catch (ExpressionException e) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.invalid-expression", TextComponent.of(e.getMessage()))); + throw new InputParseException(Caption.of("worldedit.error.parser.invalid-expression", TextComponent.of(e.getMessage()))); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ExtremaMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ExtremaMaskParser.java index 479b6f71c..5551eeaa8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ExtremaMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ExtremaMaskParser.java @@ -1,5 +1,6 @@ package com.sk89q.worldedit.extension.factory.parser.mask; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.object.mask.ExtremaMask; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.command.util.SuggestionHelper; @@ -40,7 +41,7 @@ public class ExtremaMaskParser extends RichParser { String maxArg = arguments[1]; boolean degree = minArg.endsWith("d"); if (degree ^ maxArg.endsWith("d")) { - throw new InputParseException(TranslatableComponent.of("fawe.error.mask.angle")); + throw new InputParseException(Caption.of("fawe.error.mask.angle")); } double min; double max; @@ -51,7 +52,7 @@ public class ExtremaMaskParser extends RichParser { if (flag.equals("-o")) { overlay = true; } else { - throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-flag", + throw new InputParseException(Caption.of("fawe.error.invalid-flag", TextComponent.of(flag))); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/NegateMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/NegateMaskParser.java index d27cf86e2..2d4b9a0ca 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/NegateMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/NegateMaskParser.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.factory.parser.mask; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.ParserContext; @@ -55,7 +56,7 @@ public class NegateMaskParser extends InputParser { if (input.length() > 1) { return Masks.negate(worldEdit.getMaskFactory().parseFromInput(input.substring(1), context)); } else { - throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.negate-nothing")); + throw new InputParseException(Caption.of("worldedit.error.parser.negate-nothing")); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ROCAngleMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ROCAngleMaskParser.java index b99274084..27407ca4a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ROCAngleMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/ROCAngleMaskParser.java @@ -1,5 +1,6 @@ package com.sk89q.worldedit.extension.factory.parser.mask; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.object.mask.ROCAngleMask; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.command.util.SuggestionHelper; @@ -40,7 +41,7 @@ public class ROCAngleMaskParser extends RichParser { String maxArg = arguments[1]; boolean degree = minArg.endsWith("d"); if (degree ^ maxArg.endsWith("d")) { - throw new InputParseException(TranslatableComponent.of("fawe.error.mask.angle")); + throw new InputParseException(Caption.of("fawe.error.mask.angle")); } double min; double max; @@ -51,7 +52,7 @@ public class ROCAngleMaskParser extends RichParser { if (flag.equals("-o")) { overlay = true; } else { - throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-flag", + throw new InputParseException(Caption.of("fawe.error.invalid-flag", TextComponent.of(flag))); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/RegionMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/RegionMaskParser.java index 524d8b2cf..73bc7c438 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/RegionMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/RegionMaskParser.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.factory.parser.mask; +import com.boydti.fawe.config.Caption; import com.google.common.collect.ImmutableList; import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.WorldEdit; @@ -49,7 +50,7 @@ public class RegionMaskParser extends SimpleInputParser { try { return new RegionMask(context.requireSession().getSelection(context.requireWorld()).clone()); } catch (IncompleteRegionException e) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.incomplete-region")); + throw new InputParseException(Caption.of("worldedit.error.incomplete-region")); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BiomePatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BiomePatternParser.java index 1d26d72d7..66792d610 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BiomePatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BiomePatternParser.java @@ -1,5 +1,6 @@ package com.sk89q.worldedit.extension.factory.parser.pattern; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.object.pattern.BiomeApplyingPattern; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.factory.parser.RichParser; @@ -34,7 +35,7 @@ public class BiomePatternParser extends RichParser { String biomeId = input.substring(1); BiomeType biomeType = BiomeTypes.get(biomeId); if (biomeType == null) { - throw new NoMatchException(TranslatableComponent.of("worldedit.error.unknown-biome", TextComponent.of(biomeId))); + throw new NoMatchException(Caption.of("worldedit.error.unknown-biome", TextComponent.of(biomeId))); } return new BiomeApplyingPattern(context.requireExtent(), biomeType); } else { @@ -63,11 +64,11 @@ public class BiomePatternParser extends RichParser { @Override protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException { if (arguments.length != 1) { - throw new InputParseException(TranslatableComponent.of("fawe.error.invalid-arguments", TextComponent.of("#biome[]"))); + throw new InputParseException(Caption.of("fawe.error.invalid-arguments", TextComponent.of("#biome[]"))); } BiomeType biomeType = BiomeTypes.get(arguments[0]); if (biomeType == null) { - throw new NoMatchException(TranslatableComponent.of("worldedit.error.unknown-biome", TextComponent.of(arguments[0]))); + throw new NoMatchException(Caption.of("worldedit.error.unknown-biome", TextComponent.of(arguments[0]))); } return new BiomeApplyingPattern(context.requireExtent(), biomeType); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BlockCategoryPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BlockCategoryPatternParser.java index 8b94d12c4..7ab2f29e2 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BlockCategoryPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BlockCategoryPatternParser.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.factory.parser.pattern; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.command.util.SuggestionHelper; import com.sk89q.worldedit.extension.input.InputParseException; @@ -60,13 +61,13 @@ public class BlockCategoryPatternParser extends InputParser { BlockCategory category = BlockCategory.REGISTRY.get(tag); if (category == null) { - throw new InputParseException(TranslatableComponent.of("fawe.error.unknown-block-tag", TextComponent.of(tag))); + throw new InputParseException(Caption.of("fawe.error.unknown-block-tag", TextComponent.of(tag))); } RandomPattern randomPattern = new RandomPattern(); Set blocks = category.getAll(); if (blocks.isEmpty()) { - throw new InputParseException(TranslatableComponent.of("fawe.error.block-tag-no-blocks", TextComponent.of(category.getId()))); + throw new InputParseException(Caption.of("fawe.error.block-tag-no-blocks", TextComponent.of(category.getId()))); } if (anyState) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BufferedPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BufferedPatternParser.java index d7e48ccf8..13b8498eb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BufferedPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/BufferedPatternParser.java @@ -1,5 +1,6 @@ package com.sk89q.worldedit.extension.factory.parser.pattern; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.object.pattern.BufferedPattern; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.factory.parser.RichParser; @@ -34,7 +35,7 @@ public class BufferedPatternParser extends RichParser { @Override protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException { if (arguments.length != 1) { - throw new InputParseException(TranslatableComponent.of("fawe.error.command.syntax", + throw new InputParseException(Caption.of("fawe.error.command.syntax", TextComponent.of(getPrefix() + "[pattern] (e.g. " + getPrefix() + "[stone,dirt])"))); } Pattern inner = this.worldEdit.getPatternFactory().parseFromInput(arguments[0], context); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/ClipboardPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/ClipboardPatternParser.java index 995f05dfb..a0ef5b786 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/ClipboardPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/ClipboardPatternParser.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.factory.parser.pattern; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.EmptyClipboardException; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; @@ -80,11 +81,11 @@ public class ClipboardPatternParser extends InputParser { String coords = offsetParts[1]; if (coords.length() < 7 // min length of `[x,y,z]` || coords.charAt(0) != '[' || coords.charAt(coords.length() - 1) != ']') { - throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.clipboard.missing-offset")); + throw new InputParseException(Caption.of("worldedit.error.parser.clipboard.missing-offset")); } String[] offsetSplit = coords.substring(1, coords.length() - 1).split(","); if (offsetSplit.length != 3) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.clipboard.missing-coordinates")); + throw new InputParseException(Caption.of("worldedit.error.parser.clipboard.missing-coordinates")); } offset = BlockVector3.at( Integer.valueOf(offsetSplit[0]), @@ -99,10 +100,10 @@ public class ClipboardPatternParser extends InputParser { Clipboard clipboard = holder.getClipboard(); return new ClipboardPattern(clipboard, offset); } catch (EmptyClipboardException e) { - throw new InputParseException(TranslatableComponent.of("fawe.error.empty-clipboard", TextComponent.of("#clipboard"))); + throw new InputParseException(Caption.of("fawe.error.empty-clipboard", TextComponent.of("#clipboard"))); } } else { - throw new InputParseException(TranslatableComponent.of("fawe.error.no-session")); + throw new InputParseException(Caption.of("fawe.error.no-session")); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/Linear2DPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/Linear2DPatternParser.java index 34922b994..3893e8633 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/Linear2DPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/Linear2DPatternParser.java @@ -1,5 +1,6 @@ package com.sk89q.worldedit.extension.factory.parser.pattern; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.object.pattern.Linear2DBlockPattern; import com.google.common.base.Preconditions; import com.sk89q.worldedit.WorldEdit; @@ -44,7 +45,7 @@ public class Linear2DPatternParser extends RichParser { @Override protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException { if (arguments.length == 0 || arguments.length > 3) { - throw new InputParseException(TranslatableComponent.of("fawe.error.command.syntax", + throw new InputParseException(Caption.of("fawe.error.command.syntax", TextComponent.of(getPrefix() + "[pattern] (e.g. " + getPrefix() + "[stone,dirt])"))); } Pattern inner = this.worldEdit.getPatternFactory().parseFromInput(arguments[0], context); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/Linear3DPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/Linear3DPatternParser.java index 72b8480ea..7950f980f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/Linear3DPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/Linear3DPatternParser.java @@ -1,5 +1,6 @@ package com.sk89q.worldedit.extension.factory.parser.pattern; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.object.pattern.Linear3DBlockPattern; import com.google.common.base.Preconditions; import com.sk89q.worldedit.WorldEdit; @@ -45,7 +46,7 @@ public class Linear3DPatternParser extends RichParser { @Override protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) throws InputParseException { if (arguments.length == 0 || arguments.length > 4) { - throw new InputParseException(TranslatableComponent.of("fawe.error.command.syntax", + throw new InputParseException(Caption.of("fawe.error.command.syntax", TextComponent.of(getPrefix() + "[pattern] (e.g. " + getPrefix() + "[stone,dirt])"))); } Pattern inner = this.worldEdit.getPatternFactory().parseFromInput(arguments[0], context); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/NoisePatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/NoisePatternParser.java index d9b0ee56a..ac9ce347d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/NoisePatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/NoisePatternParser.java @@ -1,5 +1,6 @@ package com.sk89q.worldedit.extension.factory.parser.pattern; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.object.random.NoiseRandom; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.command.util.SuggestionHelper; @@ -49,7 +50,7 @@ public abstract class NoisePatternParser extends RichParser { @Override protected Pattern parseFromInput(@NotNull String[] arguments, ParserContext context) { if (arguments.length != 2) { - throw new InputParseException(TranslatableComponent.of("fawe.error.command.syntax", + throw new InputParseException(Caption.of("fawe.error.command.syntax", TextComponent.of(getPrefix() + "[scale][pattern] (e.g. " + getPrefix() + "[5][dirt,stone])"))); } double scale = parseScale(arguments[0]); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/RandomPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/RandomPatternParser.java index bc640d707..dc1d8526e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/RandomPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/RandomPatternParser.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.factory.parser.pattern; +import com.boydti.fawe.config.Caption; import com.sk89q.util.StringUtil; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.input.InputParseException; @@ -81,7 +82,7 @@ public class RandomPatternParser extends InputParser { String[] p = token.split("%", 2); if (p.length < 2) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.missing-random-type", TextComponent.of(input))); + throw new InputParseException(Caption.of("worldedit.error.parser.missing-random-type", TextComponent.of(input))); } else { chance = Double.parseDouble(p[0]); innerPattern = worldEdit.getPatternFactory().parseFromInput(p[1], context); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/TypeOrStateApplyingPatternParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/TypeOrStateApplyingPatternParser.java index d2c9a85ec..ac77e88cb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/TypeOrStateApplyingPatternParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/pattern/TypeOrStateApplyingPatternParser.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.factory.parser.pattern; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.command.util.SuggestionHelper; import com.sk89q.worldedit.extension.input.InputParseException; @@ -85,28 +86,28 @@ public class TypeOrStateApplyingPatternParser extends InputParser { } else { // states given if (!parts[1].endsWith("]")) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.missing-rbracket")); + throw new InputParseException(Caption.of("worldedit.error.parser.missing-rbracket")); } final String[] states = parts[1].substring(0, parts[1].length() - 1).split(","); Map statesToSet = new HashMap<>(); for (String state : states) { if (state.isEmpty()) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.empty-state")); + throw new InputParseException(Caption.of("worldedit.error.parser.empty-state")); } String[] propVal = state.split("=", 2); if (propVal.length != 2) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.missing-equals-separator")); + throw new InputParseException(Caption.of("worldedit.error.parser.missing-equals-separator")); } final String prop = propVal[0]; if (prop.isEmpty()) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.empty-property")); + throw new InputParseException(Caption.of("worldedit.error.parser.empty-property")); } final String value = propVal[1]; if (value.isEmpty()) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.empty-value")); + throw new InputParseException(Caption.of("worldedit.error.parser.empty-value")); } if (statesToSet.put(prop, value) != null) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.parser.duplicate-property", TextComponent.of(prop))); + throw new InputParseException(Caption.of("worldedit.error.parser.duplicate-property", TextComponent.of(prop))); } } if (type.isEmpty()) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/ParserContext.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/ParserContext.java index 8e1df01c1..f85ac35d6 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/ParserContext.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/input/ParserContext.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.input; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.extension.factory.MaskFactory; import com.sk89q.worldedit.extension.platform.Actor; @@ -157,7 +158,7 @@ public class ParserContext { public Extent requireExtent() throws InputParseException { Extent extent = getExtent(); if (extent == null) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.missing-extent")); + throw new InputParseException(Caption.of("worldedit.error.missing-extent")); } return extent; } @@ -171,7 +172,7 @@ public class ParserContext { public LocalSession requireSession() throws InputParseException { LocalSession session = getSession(); if (session == null) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.missing-session")); + throw new InputParseException(Caption.of("worldedit.error.missing-session")); } return session; } @@ -185,7 +186,7 @@ public class ParserContext { public World requireWorld() throws InputParseException { World world = getWorld(); if (world == null) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.missing-world")); + throw new InputParseException(Caption.of("worldedit.error.missing-world")); } return world; } @@ -199,7 +200,7 @@ public class ParserContext { public Actor requireActor() throws InputParseException { Actor actor = getActor(); if (actor == null) { - throw new InputParseException(TranslatableComponent.of("worldedit.error.missing-actor")); + throw new InputParseException(Caption.of("worldedit.error.missing-actor")); } return actor; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractNonPlayerActor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractNonPlayerActor.java index 841643d87..e146990ce 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractNonPlayerActor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractNonPlayerActor.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.platform; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.object.exception.FaweException; import com.boydti.fawe.object.task.AsyncNotifyQueue; import com.boydti.fawe.util.TaskManager; @@ -71,7 +72,7 @@ public abstract class AbstractNonPlayerActor implements Actor { throwable = throwable.getCause(); } if (throwable instanceof WorldEditException) { - printError(TranslatableComponent.of(throwable.getLocalizedMessage())); + printError(Caption.of(throwable.getLocalizedMessage())); } else { FaweException fe = FaweException.get(throwable); if (fe != null) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java index 54e796155..138e0f830 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/AbstractPlayerActor.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.platform; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.object.exception.FaweException; import com.boydti.fawe.object.task.AsyncNotifyQueue; import com.boydti.fawe.regions.FaweMaskManager; @@ -86,7 +87,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { throwable = throwable.getCause(); } if (throwable instanceof WorldEditException) { - printError(TranslatableComponent.of(throwable.getLocalizedMessage())); + printError(Caption.of(throwable.getLocalizedMessage())); } else { FaweException fe = FaweException.get(throwable); if (fe != null) { @@ -666,13 +667,13 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable { @Override public File openFileOpenDialog(String[] extensions) { - printError(TranslatableComponent.of("worldedit.platform.no-file-dialog")); + printError(Caption.of("worldedit.platform.no-file-dialog")); return null; } @Override public File openFileSaveDialog(String[] extensions) { - printError(TranslatableComponent.of("worldedit.platform.no-file-dialog")); + printError(Caption.of("worldedit.platform.no-file-dialog")); return null; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformCommandManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformCommandManager.java index 9b1dd7bfe..34c44342a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformCommandManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformCommandManager.java @@ -354,7 +354,7 @@ public final class PlatformCommandManager { additionalConfig.accept(manager); final List subCommands = manager.getAllCommands().collect(Collectors.toList()); - cmd.addPart(SubCommandPart.builder(TranslatableComponent.of("worldedit.argument.action"), + cmd.addPart(SubCommandPart.builder(Caption.of("worldedit.argument.action"), TextComponent.of("Sub-command to run.")) .withCommands(subCommands) .required() @@ -384,7 +384,7 @@ public final class PlatformCommandManager { additionalConfig.accept(manager); final List subCommands = manager.getAllCommands().collect(Collectors.toList()); - cmd.addPart(SubCommandPart.builder(TranslatableComponent.of("worldedit.argument.action"), + cmd.addPart(SubCommandPart.builder(Caption.of("worldedit.argument.action"), TextComponent.of("Sub-command to run.")) .withCommands(subCommands) .required() @@ -724,16 +724,16 @@ public final class PlatformCommandManager { actor.print(e.getRichMessage()); } } catch (FaweException e) { - actor.printError(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason", e.getComponent())); + actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason", e.getComponent())); } catch (UsageException e) { ImmutableList cmd = e.getCommands(); if (!cmd.isEmpty()) { - actor.printError(TranslatableComponent.of("fawe.error.command.syntax", HelpGenerator.create(e.getCommandParseResult()).getFullHelp())); + actor.print(Caption.of("fawe.error.command.syntax", HelpGenerator.create(e.getCommandParseResult()).getFullHelp())); } actor.printError(e.getRichMessage()); } catch (CommandExecutionException e) { if (e.getCause() instanceof FaweException) { - actor.printError(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason", ((FaweException)e.getCause()).getComponent())); + actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason", ((FaweException)e.getCause()).getComponent())); } else { handleUnknownException(actor, e.getCause()); } @@ -741,7 +741,6 @@ public final class PlatformCommandManager { Component msg = e.getRichMessage(); if (msg != TextComponent.empty()) { actor.print(TextComponent.builder("") - .color(TextColor.RED) .append(e.getRichMessage()) .build()); List argList = parseArgs(event.getArguments()).map(Substring::getSubstring).collect(Collectors.toList()); @@ -765,7 +764,7 @@ public final class PlatformCommandManager { int changed = editSession.getBlockChangeCount(); double throughput = timeS == 0 ? changed : changed / timeS; if (time > 1000) { - actor.printDebug(TranslatableComponent.of( + actor.print(Caption.of( "worldedit.command.time-elapsed", TextComponent.of(timeS), TextComponent.of(changed), @@ -807,7 +806,7 @@ public final class PlatformCommandManager { store.injectValue(Key.of(Player.class), ValueProvider.constant((Player) actor)); } else { store.injectValue(Key.of(Player.class), context -> { - throw new CommandException(TranslatableComponent.of("worldedit.command.player-only"), ImmutableList.of()); + throw new CommandException(Caption.of("worldedit.command.player-only"), ImmutableList.of()); }); } store.injectValue(Key.of(Arguments.class), ValueProvider.constant(arguments)); @@ -826,7 +825,7 @@ public final class PlatformCommandManager { } private void handleUnknownException(Actor actor, Throwable t) { - actor.printError(TranslatableComponent.of("worldedit.command.error.report")); + actor.print(Caption.of("worldedit.command.error.report")); actor.print(TextComponent.of(t.getClass().getName() + ": " + t.getMessage())); LOGGER.error("An unexpected error while handling a WorldEdit command", t); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java index f765ac7bf..8e54cc89a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlatformManager.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.extension.platform; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.brush.visualization.VirtualWorld; import com.boydti.fawe.object.exception.FaweException; @@ -407,10 +408,10 @@ public class PlatformManager { public void handleThrowable(Throwable e, Actor actor) { FaweException faweException = FaweException.get(e); if (faweException != null) { - actor.print(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason", faweException.getComponent())); + actor.print(Caption.of("fawe.cancel.worldedit.cancel.reason", faweException.getComponent())); } else { - actor.printError(TranslatableComponent.of("worldedit.command.error.report")); - actor.print(TranslatableComponent.of(e.getClass().getName(), TextComponent.of(": "), TextComponent.of(e.getMessage()))); + actor.print(Caption.of("worldedit.command.error.report")); + actor.print(Caption.of(e.getClass().getName(), TextComponent.of(": "), TextComponent.of(e.getMessage()))); e.printStackTrace(); } } @@ -462,10 +463,10 @@ public class PlatformManager { } catch (Throwable e) { FaweException faweException = FaweException.get(e); if (faweException != null) { - player.print(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason", faweException.getComponent())); + player.print(Caption.of("fawe.cancel.worldedit.cancel.reason", faweException.getComponent())); } else { - player.printError(TranslatableComponent.of("worldedit.command.error.report")); - player.print(TranslatableComponent.of(e.getClass().getName() + ": " + e.getMessage())); + player.print(Caption.of("worldedit.command.error.report")); + player.print(Caption.of(e.getClass().getName() + ": " + e.getMessage())); e.printStackTrace(); } } finally { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/ConsumeBindings.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/ConsumeBindings.java index 08b17811b..73baadbb3 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/ConsumeBindings.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/ConsumeBindings.java @@ -116,7 +116,7 @@ public class ConsumeBindings extends Bindings { uuid = Fawe.imp().getUUID(argument); } if (uuid == null) { - throw new InputParseException(TranslatableComponent.of("fawe.error.player.not.found", TextComponent.of(argument))); + throw new InputParseException(Caption.of("fawe.error.player.not.found", TextComponent.of(argument))); } return uuid; } @@ -156,7 +156,7 @@ public class ConsumeBindings extends Bindings { try { return getWorldEdit().getBlockFactory().parseFromInput(argument, parserContext); } catch (NoMatchException e) { - throw new InputParseException(TranslatableComponent.of(e.getMessage())); + throw new InputParseException(Caption.of(e.getMessage())); } } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/ProvideBindings.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/ProvideBindings.java index 9058bc377..9d0e0d7fa 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/ProvideBindings.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/binding/ProvideBindings.java @@ -86,7 +86,7 @@ public class ProvideBindings extends Bindings { public Region[] regions(Player player, FaweMaskManager.MaskType type) { Region[] regions = player.getCurrentRegions(type); if (regions == null) { - throw new IllegalArgumentException(Caption.toString(TranslatableComponent.of("fawe.error.no.region"))); + throw new IllegalArgumentException(Caption.toString(Caption.of("fawe.error.no.region"))); } return regions; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormats.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormats.java index cc2289b4f..86d3285b9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormats.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/ClipboardFormats.java @@ -35,8 +35,8 @@ import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; +import javax.annotation.Nullable; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -58,7 +58,6 @@ import java.util.Map.Entry; import java.util.regex.Pattern; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; -import javax.annotation.Nullable; import static com.google.common.base.Preconditions.checkNotNull; @@ -210,7 +209,7 @@ public class ClipboardFormats { f = player.openFileOpenDialog(extensions); if (f == null || !f.exists()) { if (message) { - player.printError(TranslatableComponent.of("worldedit.schematic.load.does-not-exist", TextComponent.of(input))); + player.print(Caption.of("worldedit.schematic.load.does-not-exist", TextComponent.of(input))); } return null; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java index 84bc7e88d..83413bf40 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/world/ChunkLoadingExtent.java @@ -22,7 +22,6 @@ package com.sk89q.worldedit.extent.world; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BiomeType; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Deform.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Deform.java index a3daa31f3..25161690b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Deform.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/factory/Deform.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.function.factory; +import com.boydti.fawe.config.Caption; import com.google.common.collect.ImmutableList; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalSession; @@ -198,8 +199,8 @@ public class Deform implements Contextual { @Override public Iterable getStatusMessages() { - return ImmutableList.of(TranslatableComponent.of("worldedit.operation.deform.expression", - TextComponent.of(expression).color(TextColor.LIGHT_PURPLE))); + return ImmutableList.of(Caption.of("worldedit.operation.deform.expression", + TextComponent.of(expression))); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMaskBuilder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMaskBuilder.java index 03e4e69de..47ba5ebe8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMaskBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/mask/BlockMaskBuilder.java @@ -1,6 +1,7 @@ package com.sk89q.worldedit.function.mask; import com.boydti.fawe.command.SuggestInputParseException; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.object.collection.FastBitSet; import com.boydti.fawe.object.string.MutableCharSequence; import com.boydti.fawe.util.StringMan; @@ -127,7 +128,7 @@ public class BlockMaskBuilder { } } if (blockTypeList.isEmpty()) { - throw new InputParseException(TranslatableComponent.of("fawe.error.no-block-found", TextComponent.of(input))); + throw new InputParseException(Caption.of("fawe.error.no-block-found", TextComponent.of(input))); } if (blockTypeList.size() == 1) { type = blockTypeList.get(0); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java index ae7fd5dcc..35c04265f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.function.operation; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.object.extent.BlockTranslateExtent; import com.boydti.fawe.object.extent.PositionTransformExtent; import com.boydti.fawe.object.function.block.BiomeCopy; @@ -425,12 +426,12 @@ public class ForwardExtentCopy implements Operation { @Override public Iterable getStatusMessages() { return ImmutableList.of( - TranslatableComponent.of("worldedit.operation.affected.block", - TextComponent.of(affectedBlocks)).color(TextColor.LIGHT_PURPLE), - TranslatableComponent.of("worldedit.operation.affected.biome", - TextComponent.of(affectedBiomeCols)).color(TextColor.LIGHT_PURPLE), - TranslatableComponent.of("worldedit.operation.affected.entity", - TextComponent.of(affectedEntities)).color(TextColor.LIGHT_PURPLE) + Caption.of("worldedit.operation.affected.block", + TextComponent.of(affectedBlocks)), + Caption.of("worldedit.operation.affected.biome", + TextComponent.of(affectedBiomeCols)), + Caption.of("worldedit.operation.affected.entity", + TextComponent.of(affectedEntities)) ); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java index e73407b38..15128a99d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/BreadthFirstSearch.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.function.visitor; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.object.collection.BlockVectorSet; import com.google.common.collect.ImmutableList; import com.google.common.collect.Sets; @@ -281,10 +282,10 @@ public abstract class BreadthFirstSearch implements Operation { @Override public Iterable getStatusMessages() { - return ImmutableList.of(TranslatableComponent.of( + return ImmutableList.of(Caption.of( "worldedit.operation.affected.block", TextComponent.of(getAffected()) - ).color(TextColor.GRAY)); + )); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/EntityVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/EntityVisitor.java index a521926ea..86dbb0f44 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/EntityVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/EntityVisitor.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.function.visitor; +import com.boydti.fawe.config.Caption; import com.google.common.collect.ImmutableList; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Entity; @@ -82,10 +83,10 @@ public class EntityVisitor implements Operation { @Override public Iterable getStatusMessages() { - return ImmutableList.of(TranslatableComponent.of( + return ImmutableList.of(Caption.of( "worldedit.operation.affected.entity", TextComponent.of(getAffected()) - ).color(TextColor.GRAY)); + )); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/FlatRegionVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/FlatRegionVisitor.java index 8108bf30b..bf7c73628 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/FlatRegionVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/FlatRegionVisitor.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.function.visitor; +import com.boydti.fawe.config.Caption; import com.google.common.collect.ImmutableList; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.FlatRegionFunction; @@ -82,10 +83,10 @@ public class FlatRegionVisitor implements Operation { @Override public Iterable getStatusMessages() { - return ImmutableList.of(TranslatableComponent.of( + return ImmutableList.of(Caption.of( "worldedit.operation.affected.column", TextComponent.of(getAffected()) - ).color(TextColor.GRAY)); + )); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RegionVisitor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RegionVisitor.java index a685716a7..7303eb789 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RegionVisitor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/function/visitor/RegionVisitor.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.function.visitor; +import com.boydti.fawe.config.Caption; import com.google.common.collect.ImmutableList; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.RegionFunction; @@ -77,10 +78,10 @@ public class RegionVisitor implements Operation { @Override public Iterable getStatusMessages() { - return ImmutableList.of(TranslatableComponent.of( + return ImmutableList.of(Caption.of( "worldedit.operation.affected.block", TextComponent.of(getAffected()) - ).color(TextColor.LIGHT_PURPLE)); + )); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/exception/WorldEditExceptionConverter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/exception/WorldEditExceptionConverter.java index 473608f8b..24904afbc 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/exception/WorldEditExceptionConverter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/command/exception/WorldEditExceptionConverter.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.internal.command.exception; +import com.boydti.fawe.config.Caption; import com.google.common.collect.ImmutableList; import com.sk89q.worldedit.DisallowedItemException; import com.sk89q.worldedit.EmptyClipboardException; @@ -76,15 +77,15 @@ public class WorldEditExceptionConverter extends ExceptionConverterHelper { final Matcher matcher = numberFormat.matcher(e.getMessage()); if (matcher.matches()) { - throw newCommandException(TranslatableComponent.of("worldedit.error.invalid-number.matches", TextComponent.of(matcher.group(1))), e); + throw newCommandException(Caption.of("worldedit.error.invalid-number.matches", TextComponent.of(matcher.group(1))), e); } else { - throw newCommandException(TranslatableComponent.of("worldedit.error.invalid-number"), e); + throw newCommandException(Caption.of("worldedit.error.invalid-number"), e); } } @ExceptionMatch public void convert(IncompleteRegionException e) throws CommandException { - throw newCommandException(TranslatableComponent.of("worldedit.error.incomplete-region"), e); + throw newCommandException(Caption.of("worldedit.error.incomplete-region"), e); } @ExceptionMatch @@ -94,7 +95,7 @@ public class WorldEditExceptionConverter extends ExceptionConverterHelper { @ExceptionMatch public void convert(UnknownItemException e) throws CommandException { - throw newCommandException(TranslatableComponent.of("worldedit.error.unknown-block", TextComponent.of(e.getID())), e); + throw newCommandException(Caption.of("worldedit.error.unknown-block", TextComponent.of(e.getID())), e); } @ExceptionMatch @@ -104,18 +105,18 @@ public class WorldEditExceptionConverter extends ExceptionConverterHelper { @ExceptionMatch public void convert(DisallowedItemException e) throws CommandException { - throw newCommandException(TranslatableComponent.of("worldedit.error.disallowed-block", TextComponent.of(e.getID())), e); + throw newCommandException(Caption.of("worldedit.error.disallowed-block", TextComponent.of(e.getID())), e); } @ExceptionMatch public void convert(MaxChangedBlocksException e) throws CommandException { - throw newCommandException(TranslatableComponent.of("worldedit.error.max-changes", TextComponent.of(e.getBlockLimit())), e); + throw newCommandException(Caption.of("worldedit.error.max-changes", TextComponent.of(e.getBlockLimit())), e); } @ExceptionMatch public void convert(MaxBrushRadiusException e) throws CommandException { throw newCommandException( - TranslatableComponent.of("worldedit.error.max-brush-radius", TextComponent.of(worldEdit.getConfiguration().maxBrushRadius)), + Caption.of("worldedit.error.max-brush-radius", TextComponent.of(worldEdit.getConfiguration().maxBrushRadius)), e ); } @@ -123,7 +124,7 @@ public class WorldEditExceptionConverter extends ExceptionConverterHelper { @ExceptionMatch public void convert(MaxRadiusException e) throws CommandException { throw newCommandException( - TranslatableComponent.of("worldedit.error.max-radius", TextComponent.of(worldEdit.getConfiguration().maxRadius)), + Caption.of("worldedit.error.max-radius", TextComponent.of(worldEdit.getConfiguration().maxRadius)), e ); } @@ -150,13 +151,13 @@ public class WorldEditExceptionConverter extends ExceptionConverterHelper { @ExceptionMatch public void convert(EmptyClipboardException e) throws CommandException { - throw newCommandException(TranslatableComponent.of("worldedit.error.empty-clipboard"), e); + throw newCommandException(Caption.of("worldedit.error.empty-clipboard"), e); } @ExceptionMatch public void convert(InvalidFilenameException e) throws CommandException { throw newCommandException( - TranslatableComponent.of("worldedit.error.invalid-filename", TextComponent.of(e.getFilename()), e.getRichMessage()), + Caption.of("worldedit.error.invalid-filename", TextComponent.of(e.getFilename()), e.getRichMessage()), e ); } @@ -164,7 +165,7 @@ public class WorldEditExceptionConverter extends ExceptionConverterHelper { @ExceptionMatch public void convert(FilenameResolutionException e) throws CommandException { throw newCommandException( - TranslatableComponent.of("worldedit.error.file-resolution", TextComponent.of(e.getFilename()), e.getRichMessage()), + Caption.of("worldedit.error.file-resolution", TextComponent.of(e.getFilename()), e.getRichMessage()), e ); } @@ -172,14 +173,14 @@ public class WorldEditExceptionConverter extends ExceptionConverterHelper { @ExceptionMatch public void convert(InvalidToolBindException e) throws CommandException { throw newCommandException( - TranslatableComponent.of("worldedit.tool.error.cannot-bind", e.getItemType().getRichName(), e.getRichMessage()), + Caption.of("worldedit.tool.error.cannot-bind", e.getItemType().getRichName(), e.getRichMessage()), e ); } @ExceptionMatch public void convert(FileSelectionAbortedException e) throws CommandException { - throw newCommandException(TranslatableComponent.of("worldedit.error.file-aborted"), e); + throw newCommandException(Caption.of("worldedit.error.file-aborted"), e); } @ExceptionMatch diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java index f7625de31..6a04e9e08 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/internal/registry/AbstractFactory.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.internal.registry; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.NoMatchException; @@ -81,7 +82,7 @@ public abstract class AbstractFactory { } } - throw new NoMatchException(TranslatableComponent.of("worldedit.error.no-match", TextComponent.of(input))); + throw new NoMatchException(Caption.of("worldedit.error.no-match", TextComponent.of(input))); } public List getSuggestions(String input) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/DelegateBlockVector3.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/DelegateBlockVector3.java index edc62f15f..538f38220 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/DelegateBlockVector3.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/DelegateBlockVector3.java @@ -2,7 +2,6 @@ package com.sk89q.worldedit.math; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.extent.Extent; -import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockState; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/KochanekBartelsInterpolation.java b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/KochanekBartelsInterpolation.java index 3024e8a2f..b9182bfa9 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/KochanekBartelsInterpolation.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/math/interpolation/KochanekBartelsInterpolation.java @@ -21,7 +21,6 @@ package com.sk89q.worldedit.math.interpolation; -import com.sk89q.worldedit.math.MutableBlockVector3; import com.sk89q.worldedit.math.MutableVector3; import com.sk89q.worldedit.math.Vector3; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CylinderRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CylinderRegion.java index 50f3d94af..9f67a5530 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CylinderRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/CylinderRegion.java @@ -24,6 +24,7 @@ import com.boydti.fawe.beta.IChunk; import com.boydti.fawe.beta.IChunkGet; import com.boydti.fawe.beta.IChunkSet; import com.boydti.fawe.beta.implementation.filter.block.ChunkFilterBlock; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; @@ -234,7 +235,7 @@ public class CylinderRegion extends AbstractRegion implements FlatRegion { } if ((diff.getBlockX() & 1) + (diff.getBlockZ() & 1) != 0) { - throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.cylinder.error.even-horizontal")); + throw new RegionOperationException(Caption.of("worldedit.selection.cylinder.error.even-horizontal")); } return diff.divide(2).floor(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/EllipsoidRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/EllipsoidRegion.java index a51efb29e..90c257ee7 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/EllipsoidRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/EllipsoidRegion.java @@ -25,6 +25,7 @@ import com.boydti.fawe.beta.IChunk; import com.boydti.fawe.beta.IChunkGet; import com.boydti.fawe.beta.IChunkSet; import com.boydti.fawe.beta.implementation.filter.block.ChunkFilterBlock; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.util.MathMan; import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; @@ -126,7 +127,7 @@ public class EllipsoidRegion extends AbstractRegion { BlockVector3 diff = BlockVector3.ZERO.add(changes); if ((diff.getBlockX() & 1) + (diff.getBlockY() & 1) + (diff.getBlockZ() & 1) != 0) { - throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.ellipsoid.error.even-horizontal")); + throw new RegionOperationException(Caption.of("worldedit.selection.ellipsoid.error.even-horizontal")); } return diff.divide(2).floor(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/NullRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/NullRegion.java index b3e80ca26..4a4fad71c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/NullRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/NullRegion.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.regions; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector3; @@ -75,17 +76,17 @@ public class NullRegion implements Region { @Override public void expand(BlockVector3... changes) throws RegionOperationException { - throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.null.error.immutable")); + throw new RegionOperationException(Caption.of("worldedit.selection.null.error.immutable")); } @Override public void contract(BlockVector3... changes) throws RegionOperationException { - throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.null.error.immutable")); + throw new RegionOperationException(Caption.of("worldedit.selection.null.error.immutable")); } @Override public void shift(BlockVector3 change) throws RegionOperationException { - throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.null.error.immutable")); + throw new RegionOperationException(Caption.of("worldedit.selection.null.error.immutable")); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java index a9d33dd7f..dac71da29 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.regions; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.iterator.FlatRegion3DIterator; @@ -246,7 +247,7 @@ public class Polygonal2DRegion extends AbstractRegion implements FlatRegion { public void expand(BlockVector3... changes) throws RegionOperationException { for (BlockVector3 change : changes) { if (change.getBlockX() != 0 || change.getBlockZ() != 0) { - throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.polygon2d.error.expand-only-vertical")); + throw new RegionOperationException(Caption.of("worldedit.selection.polygon2d.error.expand-only-vertical")); } int changeY = change.getBlockY(); if (changeY > 0) { @@ -262,7 +263,7 @@ public class Polygonal2DRegion extends AbstractRegion implements FlatRegion { public void contract(BlockVector3... changes) throws RegionOperationException { for (BlockVector3 change : changes) { if (change.getBlockX() != 0 || change.getBlockZ() != 0) { - throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.polygon2d.error.contract-only-vertical")); + throw new RegionOperationException(Caption.of("worldedit.selection.polygon2d.error.contract-only-vertical")); } int changeY = change.getBlockY(); if (changeY > 0) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionIntersection.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionIntersection.java index 03ddff3f4..4bb5d17ed 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionIntersection.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/RegionIntersection.java @@ -22,6 +22,7 @@ package com.sk89q.worldedit.regions; import com.boydti.fawe.beta.IChunk; import com.boydti.fawe.beta.IChunkGet; import com.boydti.fawe.beta.IChunkSet; +import com.boydti.fawe.config.Caption; import com.google.common.collect.Iterators; import com.google.common.collect.Sets; import com.sk89q.worldedit.math.BlockVector2; @@ -118,13 +119,13 @@ public class RegionIntersection extends AbstractRegion { @Override public void expand(BlockVector3... changes) throws RegionOperationException { checkNotNull(changes); - throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.intersection.error.cannot-expand")); + throw new RegionOperationException(Caption.of("worldedit.selection.intersection.error.cannot-expand")); } @Override public void contract(BlockVector3... changes) throws RegionOperationException { checkNotNull(changes); - throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.intersection.error.cannot-contract")); + throw new RegionOperationException(Caption.of("worldedit.selection.intersection.error.cannot-contract")); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java index 4aa5754f9..ebe01f001 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/TransformRegion.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.regions; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector3; @@ -134,17 +135,17 @@ public class TransformRegion extends AbstractRegion { @Override public void expand(BlockVector3... changes) throws RegionOperationException { - throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.transform.error.cannot-expand")); + throw new RegionOperationException(Caption.of("worldedit.selection.transform.error.cannot-expand")); } @Override public void contract(BlockVector3... changes) throws RegionOperationException { - throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.transform.error.cannot-contract")); + throw new RegionOperationException(Caption.of("worldedit.selection.transform.error.cannot-contract")); } @Override public void shift(BlockVector3 change) throws RegionOperationException { - throw new RegionOperationException(TranslatableComponent.of("worldedit.selection.transform.error.cannot-change")); + throw new RegionOperationException(Caption.of("worldedit.selection.transform.error.cannot-change")); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java index c47c2d1bb..f95537119 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ConvexPolyhedralRegionSelector.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.regions.selector; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.extension.platform.Actor; @@ -192,8 +193,8 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion public List getSelectionInfoLines() { List ret = new ArrayList<>(); - ret.add(TranslatableComponent.of("worldedit.selection.convex.info.vertices", TextComponent.of(region.getVertices().size()))); - ret.add(TranslatableComponent.of("worldedit.selection.convex.info.triangles", TextComponent.of(region.getTriangles().size()))); + ret.add(Caption.of("worldedit.selection.convex.info.vertices", TextComponent.of(region.getVertices().size()))); + ret.add(Caption.of("worldedit.selection.convex.info.triangles", TextComponent.of(region.getTriangles().size()))); return ret; } @@ -206,7 +207,7 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion session.describeCUI(player); - player.printInfo(TranslatableComponent.of("worldedit.selection.convex.explain.primary", TextComponent.of(pos.toString()))); + player.print(Caption.of("worldedit.selection.convex.explain.primary", TextComponent.of(pos.toString()))); } @Override @@ -217,7 +218,7 @@ public class ConvexPolyhedralRegionSelector implements RegionSelector, CUIRegion session.describeCUI(player); - player.printInfo(TranslatableComponent.of("worldedit.selection.convex.explain.secondary", TextComponent.of(pos.toString()))); + player.print(Caption.of("worldedit.selection.convex.explain.secondary", TextComponent.of(pos.toString()))); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java index cb90aacd3..0dc5f722b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CuboidRegionSelector.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.regions.selector; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.extension.platform.Actor; @@ -159,13 +160,13 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion { checkNotNull(pos); if (position1 != null && position2 != null) { - player.printInfo(TranslatableComponent.of( + player.print(Caption.of( "worldedit.selection.cuboid.explain.primary-area", TextComponent.of(position1.toString()), TextComponent.of(region.getVolume()) )); } else if (position1 != null) { - player.printInfo(TranslatableComponent.of("worldedit.selection.cuboid.explain.primary", TextComponent.of(position1.toString()))); + player.print(Caption.of("worldedit.selection.cuboid.explain.primary", TextComponent.of(position1.toString()))); } session.dispatchCUIEvent(player, new SelectionPointEvent(0, pos, getVolume())); @@ -178,13 +179,13 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion { checkNotNull(pos); if (position1 != null && position2 != null) { - player.printInfo(TranslatableComponent.of( + player.print(Caption.of( "worldedit.selection.cuboid.explain.secondary-area", TextComponent.of(position2.toString()), TextComponent.of(region.getVolume()) )); } else if (position2 != null) { - player.printInfo(TranslatableComponent.of("worldedit.selection.cuboid.explain.secondary", TextComponent.of(position2.toString()))); + player.print(Caption.of("worldedit.selection.cuboid.explain.secondary", TextComponent.of(position2.toString()))); } session.dispatchCUIEvent(player, new SelectionPointEvent(1, pos, getVolume())); @@ -258,13 +259,13 @@ public class CuboidRegionSelector implements RegionSelector, CUIRegion { final List lines = new ArrayList<>(); if (position1 != null) { - lines.add(TranslatableComponent.of("worldedit.selection.cuboid.info.pos1", TextComponent.of(position1.toString()) + lines.add(Caption.of("worldedit.selection.cuboid.info.pos1", TextComponent.of(position1.toString()) .clickEvent(ClickEvent.of(ClickEvent.Action.COPY_TO_CLIPBOARD, position1.toParserString())) .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to copy"))))); } if (position2 != null) { - lines.add(TranslatableComponent.of("worldedit.selection.cuboid.info.pos2", TextComponent.of(position2.toString()) + lines.add(Caption.of("worldedit.selection.cuboid.info.pos2", TextComponent.of(position2.toString()) .clickEvent(ClickEvent.of(ClickEvent.Action.COPY_TO_CLIPBOARD, position2.toParserString())) .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to copy"))))); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java index 43df6ef09..b99142675 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/CylinderRegionSelector.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.regions.selector; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.extension.platform.Actor; @@ -175,7 +176,7 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion { @Override public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) { - player.printInfo(TranslatableComponent.of("worldedit.selection.cylinder.explain.primary", TextComponent.of(pos.toString()))); + player.print(Caption.of("worldedit.selection.cylinder.explain.primary", TextComponent.of(pos.toString()))); session.describeCUI(player); } @@ -185,14 +186,14 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion { Vector3 center = region.getCenter(); if (!center.equals(Vector3.ZERO)) { - player.printInfo(TranslatableComponent.of( + player.print(Caption.of( "worldedit.selection.cylinder.explain.secondary", TextComponent.of(NUMBER_FORMAT.format(region.getRadius().getX())), TextComponent.of(NUMBER_FORMAT.format(region.getRadius().getZ())), TextComponent.of(region.getVolume()) )); } else { - player.printError(TranslatableComponent.of("worldedit.selection.cylinder.explain.secondary-missing")); + player.print(Caption.of("worldedit.selection.cylinder.explain.secondary-missing")); return; } @@ -252,12 +253,12 @@ public class CylinderRegionSelector implements RegionSelector, CUIRegion { if (!region.getCenter().equals(Vector3.ZERO)) { Vector3 center = region.getCenter(); - lines.add(TranslatableComponent.of("worldedit.selection.cylinder.info.center", TextComponent.of(center.toString()) + lines.add(Caption.of("worldedit.selection.cylinder.info.center", TextComponent.of(center.toString()) .clickEvent(ClickEvent.of(ClickEvent.Action.COPY_TO_CLIPBOARD, center.toParserString())) .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to copy"))))); } if (!region.getRadius().equals(Vector2.ZERO)) { - lines.add(TranslatableComponent.of("worldedit.selection.cylinder.info.radius", TextComponent.of(region.getRadius().toString()))); + lines.add(Caption.of("worldedit.selection.cylinder.info.radius", TextComponent.of(region.getRadius().toString()))); } return lines; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java index 8d7a87a14..52a0921e5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/EllipsoidRegionSelector.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.regions.selector; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.extension.platform.Actor; @@ -151,13 +152,13 @@ public class EllipsoidRegionSelector implements RegionSelector, CUIRegion { @Override public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) { if (isDefined()) { - player.printInfo(TranslatableComponent.of( + player.print(Caption.of( "worldedit.selection.ellipsoid.explain.primary-area", TextComponent.of(region.getCenter().toString()), TextComponent.of(region.getVolume()) )); } else { - player.printInfo(TranslatableComponent.of( + player.print(Caption.of( "worldedit.selection.ellipsoid.explain.primary", TextComponent.of(region.getCenter().toString()) )); @@ -169,13 +170,13 @@ public class EllipsoidRegionSelector implements RegionSelector, CUIRegion { @Override public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) { if (isDefined()) { - player.printInfo(TranslatableComponent.of( + player.print(Caption.of( "worldedit.selection.ellipsoid.explain.secondary-area", TextComponent.of(region.getRadius().toString()), TextComponent.of(region.getVolume()) )); } else { - player.printInfo(TranslatableComponent.of( + player.print(Caption.of( "worldedit.selection.ellipsoid.explain.secondary", TextComponent.of(region.getRadius().toString()) )); @@ -229,14 +230,14 @@ public class EllipsoidRegionSelector implements RegionSelector, CUIRegion { final Vector3 center = region.getCenter(); if (center.lengthSq() > 0) { - lines.add(TranslatableComponent.of("worldedit.selection.ellipsoid.info.center", TextComponent.of(center.toString()) + lines.add(Caption.of("worldedit.selection.ellipsoid.info.center", TextComponent.of(center.toString()) .clickEvent(ClickEvent.of(ClickEvent.Action.COPY_TO_CLIPBOARD, center.toParserString())) .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to copy"))))); } final Vector3 radius = region.getRadius(); if (radius.lengthSq() > 0) { - lines.add(TranslatableComponent.of("worldedit.selection.ellipsoid.info.radius", TextComponent.of(radius.toString()))); + lines.add(Caption.of("worldedit.selection.ellipsoid.info.radius", TextComponent.of(radius.toString()))); } return lines; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ExtendingCuboidRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ExtendingCuboidRegionSelector.java index 82cd540d3..615f0a735 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ExtendingCuboidRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/ExtendingCuboidRegionSelector.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.regions.selector; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.math.BlockVector3; @@ -131,7 +132,7 @@ public class ExtendingCuboidRegionSelector extends CuboidRegionSelector { @Override public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) { - player.printInfo(TranslatableComponent.of( + player.print(Caption.of( "worldedit.selection.extend.explain.primary", TextComponent.of(pos.toString()), TextComponent.of(region.getVolume()) @@ -142,7 +143,7 @@ public class ExtendingCuboidRegionSelector extends CuboidRegionSelector { @Override public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) { - player.printInfo(TranslatableComponent.of( + player.print(Caption.of( "worldedit.selection.extend.explain.secondary", TextComponent.of(pos.toString()), TextComponent.of(region.getVolume()) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/Polygonal2DRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/Polygonal2DRegionSelector.java index 9290a60e9..8307e2d01 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/Polygonal2DRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/Polygonal2DRegionSelector.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.regions.selector; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.extension.platform.Actor; @@ -170,7 +171,7 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion { @Override public void explainPrimarySelection(Actor player, LocalSession session, BlockVector3 pos) { - player.printInfo(TranslatableComponent.of("worldedit.selection.polygon2d.explain.primary", TextComponent.of(pos.toString()))); + player.print(Caption.of("worldedit.selection.polygon2d.explain.primary", TextComponent.of(pos.toString()))); session.dispatchCUIEvent(player, new SelectionShapeEvent(getTypeID())); session.dispatchCUIEvent(player, new SelectionPoint2DEvent(0, pos, getVolume())); @@ -179,7 +180,7 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion { @Override public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) { - player.printInfo(TranslatableComponent.of( + player.print(Caption.of( "worldedit.selection.polygon2d.explain.secondary", TextComponent.of(region.size()), TextComponent.of(pos.toString()) @@ -242,7 +243,7 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion { @Override public List getSelectionInfoLines() { - return Collections.singletonList(TranslatableComponent.of("worldedit.selection.polygon2d.info", TextComponent.of(region.size()))); + return Collections.singletonList(Caption.of("worldedit.selection.polygon2d.info", TextComponent.of(region.size()))); } @Override diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/SphereRegionSelector.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/SphereRegionSelector.java index 3bb99356c..130e82f4f 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/SphereRegionSelector.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/selector/SphereRegionSelector.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.regions.selector; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.math.BlockVector3; @@ -90,13 +91,13 @@ public class SphereRegionSelector extends EllipsoidRegionSelector { @Override public void explainSecondarySelection(Actor player, LocalSession session, BlockVector3 pos) { if (isDefined()) { - player.printInfo(TranslatableComponent.of( + player.print(Caption.of( "worldedit.selection.sphere.explain.secondary-defined", TextComponent.of(region.getRadius().getX()), TextComponent.of(region.getVolume()) )); } else { - player.printInfo(TranslatableComponent.of("worldedit.selection.sphere.explain.secondary", TextComponent.of(region.getRadius().getX()))); + player.print(Caption.of("worldedit.selection.sphere.explain.secondary", TextComponent.of(region.getRadius().getX()))); } session.describeCUI(player); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java index abf979d15..d3443dcf0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/scripting/CraftScriptContext.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.scripting; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; @@ -149,7 +150,7 @@ public class CraftScriptContext extends CraftScriptEnvironment { public void checkArgs(int min, int max, String usage) throws InsufficientArgumentsException { if (args.length <= min || (max != -1 && args.length - 1 > max)) { - throw new InsufficientArgumentsException(TranslatableComponent.of("worldedit.error.incorrect-usage", TextComponent.of(usage))); + throw new InsufficientArgumentsException(Caption.of("worldedit.error.incorrect-usage", TextComponent.of(usage))); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/PaginationBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/PaginationBox.java index 423350d9e..4b4d7fedb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/PaginationBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/PaginationBox.java @@ -19,13 +19,12 @@ package com.sk89q.worldedit.util.formatting.component; +import com.boydti.fawe.config.Caption; import com.google.common.base.Function; import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableList; -import com.sk89q.worldedit.history.changeset.ChangeSet; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.event.ClickEvent; import com.sk89q.worldedit.util.formatting.text.event.HoverEvent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; @@ -33,7 +32,6 @@ import com.sk89q.worldedit.util.formatting.text.format.TextColor; import javax.annotation.Nullable; import java.util.Collection; import java.util.List; -import java.util.function.Supplier; import java.util.stream.Collectors; public abstract class PaginationBox extends MessageBox { @@ -95,7 +93,7 @@ public abstract class PaginationBox extends MessageBox { } int pageCount = (int) Math.ceil(getComponentsSize() / (double) componentsPerPage); if (page < 1 || page > pageCount) { - throw new InvalidComponentException(TranslatableComponent.of("worldedit.error.invalid-page")); + throw new InvalidComponentException(Caption.of("worldedit.error.invalid-page")); } currentPage = page; final int lastComp = Math.min(page * componentsPerPage, getComponentsSize()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SideEffectBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SideEffectBox.java index dc0272e1e..42a82b908 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SideEffectBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SideEffectBox.java @@ -19,12 +19,12 @@ package com.sk89q.worldedit.util.formatting.component; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.util.SideEffect; import com.sk89q.worldedit.util.SideEffectSet; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.event.ClickEvent; import com.sk89q.worldedit.util.formatting.text.event.HoverEvent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; @@ -65,15 +65,15 @@ public class SideEffectBox extends PaginationBox { SideEffect.State state = this.sideEffectSet.getState(effect); TextComponent.Builder builder = TextComponent.builder(); - builder = builder.append(TranslatableComponent.of(effect.getDisplayName(), TextColor.YELLOW) - .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TranslatableComponent.of(effect.getDescription())))); + builder = builder.append(Caption.of(effect.getDisplayName(), TextColor.YELLOW) + .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, Caption.of(effect.getDescription())))); for (SideEffect.State uiState : SHOWN_VALUES) { builder = builder.append(TextComponent.space()); - builder = builder.append(TranslatableComponent.of(uiState.getDisplayName(), uiState == state ? TextColor.WHITE : TextColor.GRAY) + builder = builder.append(Caption.of(uiState.getDisplayName(), uiState == state ? TextColor.WHITE : TextColor.GRAY) .clickEvent(ClickEvent.runCommand("//perf -h " + effect.name().toLowerCase(Locale.US) + " " + uiState.name().toLowerCase(Locale.US))) .hoverEvent(HoverEvent.showText(uiState == state - ? TranslatableComponent.of("worldedit.sideeffect.box.current") - : TranslatableComponent.of("worldedit.sideeffect.box.change-to", TranslatableComponent.of(uiState.getDisplayName())) + ? Caption.of("worldedit.sideeffect.box.current") + : Caption.of("worldedit.sideeffect.box.change-to", Caption.of(uiState.getDisplayName())) )) ); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/paste/ActorCallbackPaste.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/paste/ActorCallbackPaste.java index 8816359ec..0e4f79048 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/paste/ActorCallbackPaste.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/paste/ActorCallbackPaste.java @@ -19,6 +19,7 @@ package com.sk89q.worldedit.util.paste; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.command.util.AsyncCommandBuilder; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.util.formatting.text.TextComponent; @@ -71,7 +72,7 @@ public final class ActorCallbackPaste { AsyncCommandBuilder.wrap(task, sender) .registerWithSupervisor(supervisor, "Submitting content to a pastebin service.") - .sendMessageAfterDelay(TranslatableComponent.of("worldedit.pastebin.uploading")) + .sendMessageAfterDelay(Caption.of("worldedit.pastebin.uploading")) .onSuccess((String) null, url -> sender.printInfo(successMessage.args(TextComponent.of(url.toString())).build())) .onFailure("Failed to submit paste", null) .buildAndExec(Pasters.getExecutor()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/WorldUnloadedException.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/WorldUnloadedException.java index 01f6023c3..51cb6a5c8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/WorldUnloadedException.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/WorldUnloadedException.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit.world; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; /** * Thrown if the world has been unloaded. @@ -31,6 +31,6 @@ public class WorldUnloadedException extends WorldEditException { * Create a new instance. */ public WorldUnloadedException() { - super(TranslatableComponent.of("worldedit.error.world-unloaded")); + super(Caption.of("worldedit.error.world-unloaded")); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java index 25e0b999b..4a87dcb97 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledBlockRegistry.java @@ -19,18 +19,18 @@ package com.sk89q.worldedit.world.registry; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.translation.TranslationManager; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockType; +import javax.annotation.Nullable; import java.util.Collections; import java.util.Map; import java.util.OptionalInt; -import javax.annotation.Nullable; /** * A block registry that uses {@link BundledBlockData} to serve information @@ -48,7 +48,7 @@ public class BundledBlockRegistry implements BlockRegistry { // too much! return TextComponent.of(blockEntry.localizedName); } - return TranslatableComponent.of( + return Caption.of( TranslationManager.makeTranslationKey("block", blockType.getId()) ); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java index 13e6bb8b0..257c7480d 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/BundledItemRegistry.java @@ -19,9 +19,9 @@ package com.sk89q.worldedit.world.registry; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.translation.TranslationManager; import com.sk89q.worldedit.world.item.ItemType; @@ -47,7 +47,7 @@ public class BundledItemRegistry implements ItemRegistry { // too much! return TextComponent.of(itemEntry.localizedName); } - return TranslatableComponent.of( + return Caption.of( TranslationManager.makeTranslationKey("item", itemType.getId()) ); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBiomeRegistry.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBiomeRegistry.java index 7951b25a0..bbf00c21b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBiomeRegistry.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/registry/NullBiomeRegistry.java @@ -19,8 +19,8 @@ package com.sk89q.worldedit.world.registry; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.util.formatting.text.Component; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.translation.TranslationManager; import com.sk89q.worldedit.world.biome.BiomeData; import com.sk89q.worldedit.world.biome.BiomeType; @@ -40,7 +40,7 @@ public class NullBiomeRegistry implements BiomeRegistry { @Override public Component getRichName(BiomeType biomeType) { - return TranslatableComponent.of( + return Caption.of( TranslationManager.makeTranslationKey("biome", biomeType.getId()) ); }