From 0c85db920c97549ab4a88eb6b1be50fad828873a Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Thu, 21 Nov 2019 20:37:56 +0000 Subject: [PATCH] save strings.json --- .../com/boydti/fawe/bukkit/BukkitCommand.java | 5 +- .../sk89q/worldedit/bukkit/BukkitPlayer.java | 25 +- .../src/main/java/com/boydti/fawe/Fawe.java | 29 +- .../main/java/com/boydti/fawe/FaweAPI.java | 12 +- .../main/java/com/boydti/fawe/FaweCache.java | 1 - .../com/boydti/fawe/command/CFICommands.java | 1 - .../com/boydti/fawe/command/Rollback.java | 1 - .../main/java/com/boydti/fawe/config/BBC.java | 570 ------------------ .../java/com/boydti/fawe/config/Caption.java | 56 ++ .../java/com/boydti/fawe/config/Settings.java | 2 +- .../com/boydti/fawe/object/FaweCommand.java | 1 - .../fawe/object/brush/CatenaryBrush.java | 1 - .../fawe/object/brush/CopyPastaBrush.java | 1 - .../boydti/fawe/object/brush/HeightBrush.java | 3 - .../fawe/object/brush/InspectBrush.java | 3 - .../boydti/fawe/object/brush/LineBrush.java | 1 - .../boydti/fawe/object/brush/SplineBrush.java | 3 - .../fawe/object/brush/SurfaceSpline.java | 1 - .../fawe/object/brush/scroll/Scroll.java | 1 - .../fawe/object/brush/sweep/SweepBrush.java | 1 - .../exception/FaweBlockBagException.java | 1 - .../exception/FaweChunkLoadException.java | 1 - .../fawe/object/exception/FaweException.java | 3 - .../object/extent/MemoryCheckingExtent.java | 2 - .../boydti/fawe/object/extent/NullExtent.java | 2 - .../progress/DefaultProgressTracker.java | 1 - .../regions/selector/FuzzyRegionSelector.java | 1 - .../fawe/object/visitor/DFSVisitor.java | 1 - .../boydti/fawe/util/EditSessionBuilder.java | 1 - .../java/com/boydti/fawe/util/MainUtil.java | 3 - .../java/com/sk89q/worldedit/EditSession.java | 15 - .../worldedit/command/BiomeCommands.java | 3 - .../worldedit/command/BrushCommands.java | 3 - .../worldedit/command/ClipboardCommands.java | 3 - .../worldedit/command/GeneralCommands.java | 3 - .../worldedit/command/GenerationCommands.java | 6 +- .../worldedit/command/HistoryCommands.java | 4 +- .../worldedit/command/NavigationCommands.java | 2 - .../worldedit/command/RegionCommands.java | 7 - .../worldedit/command/SchematicCommands.java | 4 - .../worldedit/command/ScriptingCommands.java | 5 +- .../worldedit/command/SelectionCommands.java | 2 - .../worldedit/command/SnapshotCommands.java | 2 - .../command/SuperPickaxeCommands.java | 2 - .../sk89q/worldedit/command/ToolCommands.java | 3 - .../worldedit/command/ToolUtilCommands.java | 2 - .../worldedit/command/UtilityCommands.java | 2 - .../worldedit/command/WorldEditCommands.java | 3 - .../command/tool/BlockDataCyler.java | 2 - .../worldedit/command/tool/BrushTool.java | 7 - .../worldedit/command/tool/DistanceWand.java | 2 - .../command/tool/FloatingTreeRemover.java | 2 - .../command/tool/LongRangeBuildTool.java | 2 - .../worldedit/command/tool/TreePlanter.java | 2 - .../command/util/annotation/Confirm.java | 2 - .../factory/parser/DefaultBlockParser.java | 4 - .../parser/mask/DefaultMaskParser.java | 5 - .../platform/AbstractPlayerActor.java | 8 - .../worldedit/extension/platform/Actor.java | 30 +- .../platform/PlatformCommandManager.java | 3 - .../extension/platform/PlatformManager.java | 2 - .../extension/platform/PlayerProxy.java | 17 +- .../extent/clipboard/io/ClipboardFormats.java | 1 - .../function/visitor/BreadthFirstSearch.java | 2 - .../function/visitor/EntityVisitor.java | 2 - .../function/visitor/FlatRegionVisitor.java | 2 - .../function/visitor/RegionVisitor.java | 2 - .../ConvexPolyhedralRegionSelector.java | 2 - .../selector/CylinderRegionSelector.java | 2 - .../selector/EllipsoidRegionSelector.java | 2 - .../ExtendingCuboidRegionSelector.java | 2 - .../selector/Polygonal2DRegionSelector.java | 2 - .../text/TranslatableComponent.java | 2 +- .../util/translation/TranslationManager.java | 2 +- .../src/main/resources/lang/strings.json | 4 +- 75 files changed, 107 insertions(+), 813 deletions(-) delete mode 100644 worldedit-core/src/main/java/com/boydti/fawe/config/BBC.java create mode 100644 worldedit-core/src/main/java/com/boydti/fawe/config/Caption.java diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/BukkitCommand.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/BukkitCommand.java index ae622c7b6..ce2b4efb7 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/BukkitCommand.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/BukkitCommand.java @@ -1,12 +1,11 @@ package com.boydti.fawe.bukkit; -import com.boydti.fawe.config.BBC; +import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.FaweCommand; import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.bukkit.BukkitBlockCommandSender; import com.sk89q.worldedit.bukkit.BukkitCommandSender; -import com.sk89q.worldedit.bukkit.BukkitPlayer; import com.sk89q.worldedit.bukkit.WorldEditPlugin; import com.sk89q.worldedit.extension.platform.Actor; import org.bukkit.command.BlockCommandSender; @@ -28,7 +27,7 @@ public class BukkitCommand implements CommandExecutor { public boolean onCommand(@NotNull CommandSender sender, Command cmd, String label, String[] args) { final Actor plr = wrapCommandSender(sender); if (!sender.hasPermission(this.cmd.getPerm()) && !sender.isOp()) { - BBC.NO_PERM.send(plr, this.cmd.getPerm()); + plr.printError(TranslatableComponent.of("fawe.error.no.perm", TextComponent.of(this.cmd.getPerm()))); return true; } this.cmd.executeSafe(plr, args); diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java index 3da921251..10236f5f6 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitPlayer.java @@ -21,7 +21,7 @@ package com.sk89q.worldedit.bukkit; import com.boydti.fawe.Fawe; import com.boydti.fawe.bukkit.FaweBukkit; -import com.boydti.fawe.config.BBC; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.RunnableVal; @@ -43,22 +43,16 @@ import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.formatting.WorldEditText; 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.adapter.bukkit.TextAdapter; -import com.sk89q.worldedit.util.formatting.text.serializer.gson.GsonComponentSerializer; -import com.sk89q.worldedit.util.formatting.text.serializer.legacy.LegacyComponentSerializer; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BaseBlock; import com.sk89q.worldedit.world.block.BlockStateHolder; -import java.util.ArrayList; -import java.util.List; import java.util.Locale; import com.sk89q.worldedit.world.block.BlockTypes; import com.sk89q.worldedit.world.gamemode.GameMode; import com.sk89q.worldedit.world.gamemode.GameModes; import org.bukkit.Bukkit; -import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Item; @@ -173,26 +167,11 @@ public class BukkitPlayer extends AbstractPlayerActor { } } - @Override - public void print(String msg) { - print(LegacyComponentSerializer.legacy().deserialize("&7" + msg, '&')); - } - - @Override - public void printDebug(String msg) { - print(LegacyComponentSerializer.legacy().deserialize("&3" + msg, '&')); - } - - @Override - public void printError(String msg) { - print(LegacyComponentSerializer.legacy().deserialize("&c" + msg, '&')); - } - @Override public void print(Component component) { Component prefix = TranslatableComponent.of("fawe.prefix"); component = TextComponent.builder().append(prefix).append(component).build(); - component = BBC.color(component, getLocale()); + component = Caption.color(component, getLocale()); TextAdapter.sendComponent(player, component); } diff --git a/worldedit-core/src/main/java/com/boydti/fawe/Fawe.java b/worldedit-core/src/main/java/com/boydti/fawe/Fawe.java index 820696abe..8e8ba17c6 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/Fawe.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/Fawe.java @@ -1,8 +1,7 @@ package com.boydti.fawe; import com.boydti.fawe.beta.implementation.queue.QueueHandler; -import com.boydti.fawe.config.BBC; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; +import com.boydti.fawe.config.Caption; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.brush.visualization.VisualQueue; import com.boydti.fawe.regions.general.integrations.plotquared.PlotSquaredFeature; @@ -32,6 +31,7 @@ import java.lang.management.MemoryPoolMXBean; import java.lang.management.MemoryUsage; import java.util.Date; import java.util.List; +import java.util.Locale; import java.util.Objects; import java.util.concurrent.TimeUnit; import javax.annotation.Nullable; @@ -284,16 +284,17 @@ public class Fawe { } public void setupConfigs() { - MainUtil.copyFile(MainUtil.getJarFile(), "de/message.yml", null); - MainUtil.copyFile(MainUtil.getJarFile(), "ru/message.yml", null); - MainUtil.copyFile(MainUtil.getJarFile(), "ru/commands.yml", null); - MainUtil.copyFile(MainUtil.getJarFile(), "tr/message.yml", null); - MainUtil.copyFile(MainUtil.getJarFile(), "es/message.yml", null); - MainUtil.copyFile(MainUtil.getJarFile(), "es/commands.yml", null); - MainUtil.copyFile(MainUtil.getJarFile(), "nl/message.yml", null); - MainUtil.copyFile(MainUtil.getJarFile(), "fr/message.yml", null); - MainUtil.copyFile(MainUtil.getJarFile(), "cn/message.yml", null); - MainUtil.copyFile(MainUtil.getJarFile(), "it/message.yml", null); + MainUtil.copyFile(MainUtil.getJarFile(), "lang/strings.json", null); +// MainUtil.copyFile(MainUtil.getJarFile(), "de/message.yml", null); +// MainUtil.copyFile(MainUtil.getJarFile(), "ru/message.yml", null); +// MainUtil.copyFile(MainUtil.getJarFile(), "ru/commands.yml", null); +// MainUtil.copyFile(MainUtil.getJarFile(), "tr/message.yml", null); +// MainUtil.copyFile(MainUtil.getJarFile(), "es/message.yml", null); +// MainUtil.copyFile(MainUtil.getJarFile(), "es/commands.yml", null); +// MainUtil.copyFile(MainUtil.getJarFile(), "nl/message.yml", null); +// MainUtil.copyFile(MainUtil.getJarFile(), "fr/message.yml", null); +// MainUtil.copyFile(MainUtil.getJarFile(), "cn/message.yml", null); +// MainUtil.copyFile(MainUtil.getJarFile(), "it/message.yml", null); // Setting up config.yml File file = new File(this.IMP.getDirectory(), "config.yml"); Settings.IMP.PLATFORM = IMP.getPlatform().replace("\"", ""); @@ -312,7 +313,9 @@ public class Fawe { Settings.IMP.reload(file); // Setting up message.yml String lang = Objects.toString(Settings.IMP.LANGUAGE); - BBC.load(new File(this.IMP.getDirectory(), (lang.isEmpty() ? "" : lang + File.separator) + "message.yml")); + if (!lang.isEmpty()) { + getWorldEdit().getTranslationManager().setDefaultLocale(Locale.forLanguageTag(lang)); + } } catch (Throwable e) { debug("====== Failed to load config ======"); debug("Please validate your yaml files:"); diff --git a/worldedit-core/src/main/java/com/boydti/fawe/FaweAPI.java b/worldedit-core/src/main/java/com/boydti/fawe/FaweAPI.java index d513718e1..c2ac04cd8 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/FaweAPI.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/FaweAPI.java @@ -1,9 +1,8 @@ package com.boydti.fawe; import com.boydti.fawe.beta.IQueueExtent; -import com.boydti.fawe.config.BBC; +import com.boydti.fawe.config.Caption; import com.sk89q.worldedit.util.formatting.text.Component; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.RegionWrapper; import com.boydti.fawe.object.changeset.DiskStorageHistory; @@ -40,6 +39,8 @@ import java.net.URL; import java.util.ArrayList; import java.util.HashSet; import java.util.List; +import java.util.Locale; +import java.util.Map; import java.util.Set; import java.util.UUID; import javax.annotation.Nullable; @@ -456,11 +457,10 @@ public class FaweAPI { } /** - * @return - * @see BBC + * @return Map of translation ket to value */ - public static BBC[] getTranslations() { - return BBC.values(); + public static Map getTranslations(Locale locale) { + return WorldEdit.getInstance().getTranslationManager().getTranslationMap(locale); } } 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 e15476b1f..70ec97f17 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/FaweCache.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/FaweCache.java @@ -4,7 +4,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import static org.slf4j.LoggerFactory.getLogger; import com.boydti.fawe.beta.Trimable; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.collection.BitArray4096; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/command/CFICommands.java b/worldedit-core/src/main/java/com/boydti/fawe/command/CFICommands.java index 0cec178df..52b7a5f1c 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/command/CFICommands.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/command/CFICommands.java @@ -7,7 +7,6 @@ import static com.sk89q.worldedit.util.formatting.text.TextComponent.newline; import com.boydti.fawe.Fawe; import com.boydti.fawe.FaweAPI; import com.boydti.fawe.beta.implementation.filter.block.SingleFilterBlock; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.RunnableVal; import com.boydti.fawe.object.brush.visualization.cfi.HeightMapMCAGenerator; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/command/Rollback.java b/worldedit-core/src/main/java/com/boydti/fawe/command/Rollback.java index 2ed1d0f54..3723d9cd7 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/command/Rollback.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/command/Rollback.java @@ -2,7 +2,6 @@ package com.boydti.fawe.command; import com.boydti.fawe.Fawe; import com.boydti.fawe.FaweAPI; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.FaweCommand; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/config/BBC.java b/worldedit-core/src/main/java/com/boydti/fawe/config/BBC.java deleted file mode 100644 index 51b31c43e..000000000 --- a/worldedit-core/src/main/java/com/boydti/fawe/config/BBC.java +++ /dev/null @@ -1,570 +0,0 @@ -package com.boydti.fawe.config; - -import static org.slf4j.LoggerFactory.getLogger; - -import com.boydti.fawe.configuration.MemorySection; -import com.boydti.fawe.configuration.file.YamlConfiguration; -import com.sk89q.worldedit.WorldEdit; -import com.sk89q.worldedit.extension.platform.Actor; -import com.sk89q.worldedit.util.formatting.WorldEditText; -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.serializer.legacy.LegacyComponentSerializer; - -import java.io.File; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Set; -import java.util.concurrent.ThreadLocalRandom; - -public enum BBC { - - /* - * Things to note about this class: - * Can use multiple arguments %s, %s1, %s2, %s3 etc - */ - PREFIX("&4&lFAWE&7: ", "Info"), - FILE_DELETED("%s0 has been deleted.", "Info"), - SCHEMATIC_PASTING("&7The schematic is pasting. This cannot be undone.", "Info"), - LIGHTING_PROPAGATE_SELECTION("Lighting has been propogated in %s0 chunks. (Note: To remove light use //removelight)", "Info"), - UPDATED_LIGHTING_SELECTION("Lighting has been updated in %s0 chunks. (It may take a second for the packets to send)", "Info"), - SET_REGION("Selection set to your current allowed region", "Info"), - WORLDEDIT_COMMAND_LIMIT("Please wait until your current action completes", "Info"), - WORLDEDIT_DELAYED("Please wait while we process your FAWE action...", "Info"), - WORLDEDIT_RUN("Apologies for the delay. Now executing: %s", "Info"), - WORLDEDIT_COMPLETE("Edit completed.", "Info"), - REQUIRE_SELECTION_IN_MASK("&7%s of your selection is not within your mask. You can only make edits within allowed regions.", "Info"), - WORLDEDIT_VOLUME("&7You cannot select a volume of %current%. The maximum volume you can modify is %max%.", "Info"), - WORLDEDIT_ITERATIONS("You cannot iterate %current% times. The maximum number of iterations allowed is %max%.", "Info"), - WORLDEDIT_UNSAFE("&7Access to that command has been blocked", "Info"), - WORLDEDIT_DANGEROUS_WORLDEDIT("&cProcessed unsafe edit at %s0 by %s1", "Info"), - WORLDEDIT_EXTEND("&cYour edit may have extended outside your allowed region.", "Error"), - WORLDEDIT_TOGGLE_TIPS_ON("Disabled FAWE tips.", "Info"), - WORLDEDIT_TOGGLE_TIPS_OFF("Enabled FAWE tips.", "Info"), - - WORLDEDIT_BYPASSED("Currently bypassing FAWE restriction.", "Info"), - WORLDEDIT_UNMASKED("&6Your FAWE edits are now unrestricted.", "Info"), - - WORLDEDIT_RESTRICTED("Your FAWE edits are now restricted.", "Info"), - WORLDEDIT_OOM_ADMIN("Possible options:\n - //fast\n - Do smaller edits\n - Allocate more memory\n - Disable `max-memory-percent`", "Info"), - COMPRESSED("History compressed. Saved ~ %s0b (%s1x smaller)", "Info"), - - WEB_UNAUTHORIZED("Only links from the configured web host is allowed: %s0", "Error"), - ACTION_COMPLETE("Action completed in %s0 seconds", "Info"), - GENERATING_LINK("Uploading %s, please wait...", "Web"), - GENERATING_LINK_FAILED("Failed to generate download link!", "Web"), - DOWNLOAD_LINK("%s", "Web"), - - MASK_DISABLED("Global mask disabled", "WorldEdit.General"), - MASK("Global mask set", "WorldEdit.General"), - TEXTURE_DISABLED("Texturing reset", "WorldEdit.General"), - TEXTURE_SET("Set texturing to %s1", "WorldEdit.General"), - SOURCE_MASK_DISABLED("Global source mask disabled", "WorldEdit.General"), - SOURCE_MASK("Global source mask set", "WorldEdit.General"), - TRANSFORM_DISABLED("Global transform disabled", "WorldEdit.General"), - TRANSFORM("Global transform set", "WorldEdit.General"), - - COMMAND_COPY("%s0 blocks were copied.", "WorldEdit.Copy"), - - COMMAND_CUT_SLOW("%s0 blocks were cut.", "WorldEdit.Cut"), - COMMAND_CUT_LAZY("%s0 blocks will be removed on paste", "WorldEdit.Cut"), - - COMMAND_PASTE("The clipboard has been pasted at %s0", "WorldEdit.Paste"), - - COMMAND_ROTATE("The clipboard has been rotated", "WorldEdit.Rotate"), - - COMMAND_FLIPPED("The clipboard has been flipped", "WorldEdit.Flip"), - COMMAND_REGEN_0("Region regenerated.", "WorldEdit.Regen"), - COMMAND_REGEN_1("Region regenerated.", "WorldEdit.Regen"), - COMMAND_REGEN_2("Region regenerated.", "WorldEdit.Regen"), - - COMMAND_TREE("%s0 trees created.", "WorldEdit.Tree"), - COMMAND_PUMPKIN("%s0 pumpkin patches created.", "WorldEdit.Tree"), - COMMAND_FLORA("%s0 flora created.", "WorldEdit.Flora"), - COMMAND_HISTORY_CLEAR("History cleared", "WorldEdit.History"), - COMMAND_REDO_ERROR("Nothing left to redo. (See also `/inspect` and `/frb`)", "WorldEdit.History"), - COMMAND_HISTORY_OTHER_ERROR("Unable to find session for %s0.", "WorldEdit.History"), - COMMAND_REDO_SUCCESS("Redo successful%s0.", "WorldEdit.History"), - COMMAND_UNDO_ERROR("Nothing left to undo. (See also `/inspect` and `/frb`)", "WorldEdit.History"), - COMMAND_UNDO_DISABLED("Undo disabled, use: //fast", "WorldEdit.History"), - COMMAND_UNDO_SUCCESS("Undo successful%s0.", "WorldEdit.History"), - - OPERATION("Operation queued (%s0)", "WorldEdit.Operation"), - - SELECTION_WAND("Left click: select pos #1; Right click: select pos #2", "WorldEdit.Selection"), - NAVIGATION_WAND_ERROR("Nothing to pass through", "WorldEdit.Navigation"), - - SELECTION_WAND_DISABLE("Edit wand disabled.", "WorldEdit.Selection"), - SELECTION_WAND_ENABLE("Edit wand enabled.", "WorldEdit.Selection"), - SELECTION_CHUNK("Chunk selected (%s0)", "WorldEdit.Selection"), - SELECTION_CHUNKS("Chunks selected (%s0) - (%s1)", "WorldEdit.Selection"), - SELECTION_CONTRACT("Region contracted %s0 blocks.", "WorldEdit.Selection"), - SELECTION_COUNT("Counted %s0 blocks.", "WorldEdit.Selection"), - SELECTION_DISTR("# total blocks: %s0", "WorldEdit.Selection"), - SELECTION_EXPAND("Region expanded %s0 blocks", "WorldEdit.Selection"), - SELECTION_EXPAND_VERT("Region expanded %s0 blocks (top to bottom)", "WorldEdit.Selection"), - SELECTION_INSET("Region inset", "WorldEdit.Selection"), - SELECTION_OUTSET("Region outset", "WorldEdit.Selection"), - SELECTION_SHIFT("Region shifted", "WorldEdit.Selection"), - SELECTION_CLEARED("Selection cleared", "WorldEdit.Selection"), - - WORLD_IS_LOADED("The world shouldn't be in use when executing. Unload the world, or use use -f to override (save first)", "WorldEdit.Anvil"), - - BRUSH_RESET("Reset your brush. (SHIFT + Click)", "WorldEdit.Brush"), - BRUSH_NONE("You aren't holding a brush!", "WorldEdit.Brush"), - BRUSH_SCROLL_ACTION_SET("Set scroll action to %s0", "WorldEdit.Brush"), - BRUSH_SCROLL_ACTION_UNSET("Removed scroll action", "WorldEdit.Brush"), - BRUSH_VISUAL_MODE_SET("Set visual mode to %s0", "WorldEdit.Brush"), - BRUSH_TARGET_MODE_SET("Set target mode to %s0", "WorldEdit.Brush"), - BRUSH_TARGET_MASK_SET("Set target mask to %s0", "WorldEdit.Brush"), - BRUSH_TARGET_OFFSET_SET("Set target offset to %s0", "WorldEdit.Brush"), - BRUSH_EQUIPPED("Equipped brush %s0", "WorldEdit.Brush"), - BRUSH_TRY_OTHER("There are other more suitable brushes e.g.,\n - //br height [radius=5] [#clipboard|file=null] [rotation=0] [yscale=1.00]", "WorldEdit.Brush"), - BRUSH_COPY("Left click the base of an object to copy, right click to paste. Increase the brush radius if necessary.", "WorldEdit.Brush"), - BRUSH_HEIGHT_INVALID("Invalid height map file (%s0)", "WorldEdit.Brush"), - BRUSH_SMOOTH("Note: Use the blend brush if you want to smooth overhangs or caves.", "WorldEdit.Brush"), - BRUSH_SPLINE("Click to add a point, click the same spot to finish", "WorldEdit.Brush"), - BRUSH_LINE_PRIMARY("Added point %s0, click another position to create the line", "WorldEdit.Brush"), - BRUSH_CATENARY_DIRECTION("Added point %s0, click the direction you want to create the spline", "WorldEdit.Brush"), - BRUSH_LINE_SECONDARY("Created spline", "WorldEdit.Brush"), - BRUSH_SPLINE_PRIMARY_2("Added position, Click the same spot to join!", "WorldEdit.Brush"), - BRUSH_SPLINE_SECONDARY_ERROR("Not enough positions set!", "WorldEdit.Brush"), - BRUSH_SPLINE_SECONDARY("Created spline", "WorldEdit.Brush"), - BRUSH_SIZE("Brush size set", "WorldEdit.Brush"), - BRUSH_RANGE("Brush size set", "WorldEdit.Brush"), - BRUSH_MASK_DISABLED("Brush mask disabled", "WorldEdit.Brush"), - BRUSH_MASK("Brush mask set", "WorldEdit.Brush"), - BRUSH_SOURCE_MASK_DISABLED("Brush source mask disabled", "WorldEdit.Brush"), - BRUSH_SOURCE_MASK("Brush source mask set", "WorldEdit.Brush"), - BRUSH_TRANSFORM_DISABLED("Brush transform disabled", "WorldEdit.Brush"), - BRUSH_TRANSFORM("Brush transform set", "WorldEdit.Brush"), - BRUSH_MATERIAL("Brush material set", "WorldEdit.Brush"), - - ROLLBACK_ELEMENT("Undoing %s0", "WorldEdit.Rollback"), - - TOOL_INSPECT("Inspect tool bound to %s0.", "WorldEdit.Tool"), - TOOL_INSPECT_INFO("%s0 changed %s1 to %s2 %s3 ago", "WorldEdit.Tool"), - TOOL_INSPECT_INFO_FOOTER("Total: %s0 changes", "WorldEdit.Tool"), - TOOL_NONE("Tool unbound from your current item.", "WorldEdit.Tool"), - TOOL_INFO("Info tool bound to %s0.", "WorldEdit.Tool"), - TOOL_TREE("Tree tool bound to %s0.", "WorldEdit.Tool"), - TOOL_TREE_ERROR_BLOCK("A tree can't go here", "WorldEdit.Tool"), - TOOL_TREE_ERROR("Tree type %s0 is unknown.", "WorldEdit.Tool"), - TOOL_REPL("Block replacer tool bound to %s0.", "WorldEdit.Tool"), - TOOL_CYCLER("Block data cycler tool bound to %s0.", "WorldEdit.Tool"), - TOOL_FLOOD_FILL("Block flood fill tool bound to %s0.", "WorldEdit.Tool"), - TOOL_RANGE_ERROR("Maximum range: %s0.", "WorldEdit.Tool"), - TOOL_RADIUS_ERROR("Maximum allowed brush radius: %s0.", "WorldEdit.Tool"), - TOOL_DELTREE("Floating tree remover tool bound to %s0.", "WorldEdit.Tool"), - TOOL_DELTREE_ERROR("That's not a tree", "WorldEdit.Tool"), - TOOL_DELTREE_FLOATING_ERROR("That's not a floating tree", "WorldEdit.Tool"), - TOOL_FARWAND("Far wand tool bound to %s0.", "WorldEdit.Tool"), - TOOL_LRBUILD_BOUND("Long-range building tool bound to %s0.", "WorldEdit.Tool"), - TOOL_LRBUILD_INFO("Left-click set to %s0; right-click set to %s1.", "WorldEdit.Tool"), - SUPERPICKAXE_ENABLED("Super Pickaxe enabled.", "WorldEdit.Tool"), - SUPERPICKAXE_DISABLED("Super Pickaxe disabled.", "WorldEdit.Tool"), - SUPERPICKAXE_AREA_ENABLED("Mode changed. Left click with a pickaxe. // to disable.", "WorldEdit.Tool"), - - SNAPSHOT_LOADED("Snapshot '%s0' loaded; now restoring...", "WorldEdit.Snapshot"), - SNAPSHOT_SET("Snapshot set to: %s0", "WorldEdit.Snapshot"), - SNAPSHOT_NEWEST("Now using newest snapshot.", "WorldEdit.Snapshot"), - SNAPSHOT_LIST_HEADER("Snapshots for world (%s0):", "WorldEdit.Snapshot"), - SNAPSHOT_LIST_FOOTER("Use /snap use [snapshot] or /snap use latest.", "WorldEdit.Snapshot"), - SNAPSHOT_NOT_CONFIGURED("Snapshot/backup restore is not configured.", "WorldEdit.Snapshot"), - SNAPSHOT_NOT_AVAILABLE("No snapshots are available. See console for details.", "WorldEdit.Snapshot"), - SNAPSHOT_NOT_FOUND_WORLD("No snapshots were found for this world.", "WorldEdit.Snapshot"), - SNAPSHOT_NOT_FOUND("No snapshots were found.", "WorldEdit.Snapshot"), - SNAPSHOT_INVALID_INDEX("Invalid index, must be equal or higher then 1.", "WorldEdit.Snapshot"), - SNAPSHOT_ERROR_DATE("Could not detect the date inputted.", "WorldEdit.Snapshot"), - SNAPSHOT_ERROR_RESTORE("Errors prevented any blocks from being restored.", "WorldEdit.Snapshot"), - SNAPSHOT_ERROR_RESTORE_CHUNKS("No chunks could be loaded. (Bad archive?)", "WorldEdit.Snapshot"), - - BIOME_LIST_HEADER("Biomes (page %s0/%s1):", "WorldEdit.Biome"), - BIOME_CHANGED("Biomes were changed in %s0 columns.", "WorldEdit.Biome"), - - FAST_ENABLED("Fast mode enabled. History and edit restrictions will be bypassed.", "WorldEdit.General"), - FAST_DISABLED("Fast mode disabled", "WorldEdit.General"), - - PLACE_ENABLED("Now placing at pos #1.", "WorldEdit.General"), - PLACE_DISABLED("Now placing at the block you stand in.", "WorldEdit.General"), - - KILL_SUCCESS("Killed %s0 entities in a radius of %s1.", "WorldEdit.Utility"), - NOTHING_CONFIRMED("You have no actions pending confirmation.", "WorldEdit.Utility"), - - - SCHEMATIC_PROMPT_CLEAR("You may want to use %s0 to clear your current clipboard first", "Worldedit.Schematic"), - SCHEMATIC_SHOW("Displaying %s0 schematics from %s1:\n" + - " - Left click a structure to set your clipboard\n" + - " - Right click to add a structure to your multi-clipboard\n" + - " - Use %s2 to go back to the world", "Worldedit.Schematic"), - SCHEMATIC_FORMAT("Available formats (Name: Lookup names)", "Worldedit.Schematic"), - SCHEMATIC_MOVE_EXISTS("%s0 already exists", "Worldedit.Schematic"), - SCHEMATIC_MOVE_SUCCESS("%s0 -> %s1", "Worldedit.Schematic"), - SCHEMATIC_MOVE_FAILED("%s0 no moved: %s1", "Worldedit.Schematic"), - SCHEMATIC_LOADED("%s0 loaded. Paste it with //paste", "Worldedit.Schematic"), - SCHEMATIC_SAVED("%s0 saved.", "Worldedit.Schematic"), - SCHEMATIC_PAGE("Page must be %s", "WorldEdit.Schematic"), - SCHEMATIC_NONE("No files found.", "WorldEdit.Schematic"), - SCHEMATIC_LIST("Available files (Filename: Format) [%s0/%s1]:", "Worldedit.Schematic"), - SCHEMATIC_LIST_ELEM(" - %s0 - %s1", "Worldedit.Schematic"), - - CLIPBOARD_URI_NOT_FOUND("You do not have %s0 loaded", "WorldEdit.Clipboard"), - CLIPBOARD_CLEARED("Clipboard cleared", "WorldEdit.Clipboard"), - CLIPBOARD_INVALID_FORMAT("Unknown clipboard format: %s0", "WorldEdit.Clipboard"), - - VISITOR_BLOCK("%s0 blocks affected", "WorldEdit.Visitor"), - VISITOR_ENTITY("%s0 entities affected", "WorldEdit.Visitor"), - VISITOR_FLAT("%s0 columns affected", "WorldEdit.Visitor"), - - SELECTOR_FUZZY_POS1("Region set and expanded from %s0 %s1.", "WorldEdit.Selector"), - SELECTOR_FUZZY_POS2("Added expansion of %s0 %s1.", "WorldEdit.Selector"), - SELECTOR_POS("pos%s0 set to %s1 (%s2).", "WorldEdit.Selector"), - SELECTOR_CENTER("Center set to %s0 (%s1).", "WorldEdit.Selector"), - SELECTOR_RADIUS("Radius set to %s0 (%s1).", "WorldEdit.Selector"), - SELECTOR_EXPANDED("Expanded region to %s0 (%s1)", "WorldEdit.Selector"), - SELECTOR_INVALID_COORDINATES("Invalid coordinates %s0", "WorldEdit.Selector"), - SELECTOR_ALREADY_SET("Position already set.", "WorldEdit.Selector"), - SELECTOR_SET_DEFAULT("Your default region selector is now %s0.", "WorldEdit.Selector"), - - TIMEZONE_SET("Timezone set for this session to: %s0", "WorldEdit.Timezone"), - TIMEZONE_DISPLAY("The current time in that timezone is: %s0", "WorldEdit.Timezone"), - - BLOCK_CYCLER_CANNOT_CYCLE("That block's data cannot be cycled!", "WorldEdit.Cycler"), - BLOCK_CYCLER_LIMIT("Max blocks change limit reached.", "WorldEdit.Cycler"), - BLOCK_CYCLER_NO_PERM("You are not permitted to cycle the data value of that block.", "WorldEdit.Cycler"), - - COMMAND_INVALID_SYNTAX("The command was not used properly (no more help available).", "WorldEdit.Command"), - - COMMAND_CLARIFYING_BRACKET("Added clarifying bracket for %s0", "WorldEdit.Help"), - HELP_SUGGEST("Couldn't find %s0. Maybe try one of %s1 ?", "WorldEdit.Help"), - HELP_HEADER_CATEGORIES("Command Types", "WorldEdit.Help"), - HELP_HEADER_SUBCOMMANDS("Subcommands", "WorldEdit.Help"), - HELP_HEADER_COMMAND("Help for: %s0", "WorldEdit.Help"), - HELP_ITEM_ALLOWED("%s0 - %s1", "WorldEdit.Help"), - HELP_ITEM_DENIED("%s0 - %s1", "WorldEdit.Help"), - HELP_HEADER("Help: page %s0/%s1", "WorldEdit.Help"), - HELP_FOOTER("Wiki: https://git.io/vSKE5", "WorldEdit.Help"), - PAGE_FOOTER("Use %s0 to go to the next page", "WorldEdit.Utility"), - - PROGRESS_MESSAGE("%s1/%s0 (%s2%) @%s3cps %s4s left", "Progress"), - PROGRESS_FINISHED("[ Done! ]", "Progress"), - - COMMAND_SYNTAX("Usage: %s0", "Error"), - NO_PERM("You are lacking the permission node: %s0", "Error"), - BLOCK_NOT_ALLOWED("You are not allowed to use", "Error"), - SETTING_DISABLE("Lacking setting: %s0", "Error"), - BRUSH_NOT_FOUND("Available brushes: %s0", "Error"), - BRUSH_INCOMPATIBLE("Brush not compatible with this version", "Error"), - SCHEMATIC_NOT_FOUND("Schematic not found: %s0", "Error"), - NO_REGION("You have no current allowed region", "Error"), - NO_MASK("You have no current mask set", "Error"), - NOT_PLAYER("You must be a player to perform this action!", "Error"), - PLAYER_NOT_FOUND("Player not found: %s0", "Error"), - OOM( - "[Critical] Detected low memory i.e. < 1%. We will take the following actions:\n - Terminate WE block placement\n - Clear WE history\n - Unload non essential chunks\n - Kill entities\n - Garbage collect\nIgnore this if trying to crash server.\nNote: Low memory is likely (but not necessarily) caused by WE", - "Error"), - - WORLDEDIT_SOME_FAILS("%s0 blocks weren't placed because they were outside your allowed region.", "Error"), - WORLDEDIT_SOME_FAILS_BLOCKBAG("Missing blocks: %s0", "Error"), - - WORLDEDIT_CANCEL_COUNT("Cancelled %s0 edits.", "Cancel"), - WORLDEDIT_CANCEL_REASON_CONFIRM("Use //confirm to execute %s2", "Cancel"), - WORLDEDIT_CANCEL_REASON_CONFIRM_REGION("Your selection is large (%s0 -> %s1, containing %s3 blocks). Use //confirm to execute %s2", "Cancel"), - WORLDEDIT_CANCEL_REASON("Your WorldEdit action was cancelled: %s0.", "Cancel"), - WORLDEDIT_CANCEL_REASON_MANUAL("Manual cancellation", "Cancel"), - WORLDEDIT_CANCEL_REASON_LOW_MEMORY("Low memory", "Cancel"), - WORLDEDIT_CANCEL_REASON_MAX_CHANGES("Too many blocks changed", "Cancel"), - WORLDEDIT_CANCEL_REASON_MAX_CHECKS("Too many block checks", "Cancel"), - WORLDEDIT_CANCEL_REASON_MAX_TILES("Too many blockstates", "Cancel"), - WORLDEDIT_CANCEL_REASON_MAX_ENTITIES("Too many entities", "Cancel"), - WORLDEDIT_CANCEL_REASON_MAX_ITERATIONS("Max iterations", "Cancel"), - WORLDEDIT_CANCEL_REASON_OUTSIDE_LEVEL("Outside world", "Cancel"), - WORLDEDIT_CANCEL_REASON_OUTSIDE_REGION("Outside allowed region (bypass with /wea, or disable `region-restrictions` in config.yml)", "Cancel"), - WORLDEDIT_CANCEL_REASON_NO_REGION("No allowed region (bypass with /wea, or disable `region-restrictions` in config.yml)", "Cancel"), - WORLDEDIT_FAILED_LOAD_CHUNK("Skipped loading chunk: %s0;%s1. Try increasing chunk-wait.", "Cancel"), - - ASCEND_FAIL("No free spot above you found.", "Navigation"), - ASCENDED_PLURAL("Ascended %s0 levels.", "Navigation"), - ASCENDED_SINGULAR("Ascended a level.", "Navigation"), - UNSTUCK("There you go!", "Navigation"), - DESCEND_FAIL("No free spot below you found.", "Navigation"), - DESCEND_PLURAL("Descended %s0 levels.", "Navigation"), - DESCEND_SINGULAR("Descended a level.", "Navigation"), - WHOOSH("Whoosh!", "Navigation"), - POOF("Poof!", "Navigation"), - THRU_FAIL("No free spot ahead of you found.", "Navigation"), - NO_BLOCK("No block in sight! (or too far)", "Navigation"), - UP_FAIL("You would hit something above you.", "Navigation"), - - SEL_CUBOID("Cuboid: left click for point 1, right click for point 2", "Selection"), - SEL_CUBOID_EXTEND("Cuboid: left click for a starting point, right click to extend", "Selection"), - SEL_2D_POLYGON("2D polygon selector: Left/right click to add a point.", "Selection"), - SAL_ELLIPSOID("Ellipsoid selector: left click=center, right click to extend", "Selection"), - SEL_SPHERE("Sphere selector: left click=center, right click to set radius", "Selection"), - SEL_CYLINDRICAL("Cylindrical selector: Left click=center, right click to extend.", "Selection"), - SEL_MAX("%s0 points maximum.", "Selection"), - SEL_FUZZY("Fuzzy selector: Left click to select all contingent blocks, right click to add. To select an air cavity, use //pos1.", "Selection"), - SEL_CONVEX_POLYHEDRAL("Convex polyhedral selector: Left click=First vertex, right click to add more.", "Selection"), - SEL_LIST("For a list of selection types use: //sel list", "Selection"), - SEL_MODES("Select one of the modes below:", "Selection"), - - SCRIPTING_NO_PERM("You do not have permission to execute this craft script", "WorldEdit.Scripting"), - SCRIPTING_CS("Use /cs with a script name first.", "WorldEdit.Scripting"), - SCRIPTING_ERROR("An error occured while executing a craft script", "WorldEdit.Scripting"), - - - - TIP_SEL_LIST("Tip: See the different selection modes with //sel list", "Tips"), - TIP_SELECT_CONNECTED("Tip: Select all connected blocks with //sel fuzzy", "Tips"), - TIP_SET_POS1("Tip: Use pos1 as a pattern with //set pos1", "Tips"), - TIP_FARWAND("Tip: Select distant points with //farwand", "Tips"), - TIP_DISCORD("Need help using FAWE? https://discord.gg/ngZCzbU", "Tips"), - - // cut - TIP_LAZYCUT("Tip: It is safer to use //lazycut", "Tips"), - // set - TIP_FAST("Tip: Set fast and without undo using //fast", "Tips"), - TIP_CANCEL("Tip: You can //cancel an edit in progress", "Tips"), - TIP_MASK("Tip: Set a global destination mask with /gmask", "Tips"), - TIP_MASK_ANGLE("Tip: Replace upward slopes of 3-20 blocks using //replace /[-20][-3] bedrock", "Tips"), - TIP_SET_LINEAR("Tip: Set blocks linearly with //set #l3d[wood,bedrock]", "Tips"), - TIP_SURFACE_SPREAD("Tip: Spread a flat surface with //set #surfacespread[5][0][5][#existing]", "Tips"), - TIP_SET_HAND("Tip: Use your current hand with //set hand", "Tips"), - - // replace - TIP_REPLACE_REGEX("Tip: Replace using regex: //replace .*_log ", "Tips"), - TIP_REPLACE_REGEX_2("Tip: Replace using regex: //replace .*stairs[facing=(north|south)] ", "Tips"), - TIP_REPLACE_REGEX_3("Tip: Replace using operators: //replace water[level>2] sand", "Tips"), - TIP_REPLACE_REGEX_4("Tip: Replace using operators: //replace true *[waterlogged=false]", "Tips"), - TIP_REPLACE_REGEX_5("Tip: Replace using operators: //replace true *[level-=1]", "Tips"), - - TIP_REPLACE_ID("Tip: Replace only the block id: //replace woodenstair #id[cobblestair]", "Tips"), - TIP_REPLACE_LIGHT("Tip: Remove light sources with //replace #brightness[1][15] 0", "Tips"), - TIP_TAB_COMPLETE("Tip: The replace command supports tab completion", "Tips"), - - // clipboard - TIP_FLIP("Tip: Mirror with //flip", "Tips"), - TIP_DEFORM("Tip: Reshape with //deform", "Tips"), - TIP_TRANSFORM("Tip: Set a transform with //gtransform", "Tips"), - TIP_COPYPASTE("Tip: Paste on click with //br copypaste", "Tips"), - TIP_SOURCE_MASK("Tip: Set a source mask with /gsmask ", "Tips"), - TIP_REPLACE_MARKER("Tip: Replace a block with your full clipboard using //replace wool #fullcopy", "Tips"), - TIP_PASTE("Tip: Place with //paste", "Tips"), - TIP_LAZYCOPY("Tip: lazycopy is faster", "Tips"), - TIP_DOWNLOAD("Tip: Try out //download", "Tips"), - TIP_ROTATE("Tip: Orientate with //rotate", "Tips"), - TIP_COPY_PATTERN("Tip: To use as a pattern try #copy", "Tips"), - - // regen - TIP_REGEN_0("Tip: Use a biome with /regen [biome]", "Tips"), - TIP_REGEN_1("Tip: Use a seed with /regen [biome] [seed]", "Tips"), - - TIP_BIOME_PATTERN("Tip: The #biome[forest] pattern can be used in any command", "Tips"), - TIP_BIOME_MASK("Tip: Restrict to a biome with the `$jungle` mask", "Tips"),; - - /** - * Translated - */ - private String translatedMessage; - /** - * Default - */ - private String defaultMessage; - /** - * What locale category should this translation fall under - */ - private String category; - - /** - * Constructor - * - * @param defaultMessage default - */ - BBC(String defaultMessage, String category) { - this.defaultMessage = defaultMessage; - setTranslated(defaultMessage); - this.category = category.toLowerCase(Locale.ROOT); - } - - public String format(Object... args) { - String m = this.translatedMessage; - for (int i = args.length - 1; i >= 0; i--) { - if (args[i] == null) { - continue; - } - m = m.replace("%s" + i, args[i].toString()); - } - if (args.length > 0) { - m = m.replace("%s", args[0].toString()); - } - return m; - } - - public static void load(File file) { - try { - if (!file.exists()) { - file.getParentFile().mkdirs(); - file.createNewFile(); - } - final YamlConfiguration yml = YamlConfiguration.loadConfiguration(file); - final Set keys = yml.getKeys(true); - final EnumSet all = EnumSet.allOf(BBC.class); - final HashSet allNames = new HashSet<>(); - final HashSet allCats = new HashSet<>(); - final HashSet toRemove = new HashSet<>(); - for (BBC c : all) { - allNames.add(c.name()); - allCats.add(c.category.toLowerCase()); - } - final EnumSet captions = EnumSet.noneOf(BBC.class); - boolean changed = false; - for (String key : keys) { - final Object value = yml.get(key); - if (value instanceof MemorySection) { - continue; - } - final String[] split = key.split("\\."); - final String node = split[split.length - 1].toUpperCase(Locale.ROOT); - final BBC caption = allNames.contains(node) ? valueOf(node) : null; - if (caption != null) { - if (!split[0].equalsIgnoreCase(caption.category)) { - changed = true; - yml.set(key, null); - yml.set(caption.category + "." + caption.name().toLowerCase(Locale.ROOT), value); - } - captions.add(caption); - caption.setTranslated((String) value); - } else { - toRemove.add(key); - } - } - for (String remove : toRemove) { - changed = true; - yml.set(remove, null); - } - for (BBC caption : all) { - if (!captions.contains(caption)) { - changed = true; - yml.set(caption.category + "." + caption.name().toLowerCase(Locale.ROOT), caption.defaultMessage); - } - } - if (changed) { - yml.save(file); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void setTranslated(String msg) { - this.translatedMessage = msg; - } - - @Override - public String toString() { - return s(); - } - - public boolean isEmpty() { - return length() == 0; - } - - public int length() { - return toString().length(); - } - - public String s() { - return this.translatedMessage; - } - - public String original() { - return defaultMessage; - } - - public String getCategory() { - return this.category; - } - - public BBC or(BBC... others) { - int index = ThreadLocalRandom.current().nextInt(others.length + 1); - return index == 0 ? this : others[index - 1]; - } - - public void send(Object actor, Object... args) { - if (isEmpty()) { - return; - } - if (actor == null) { - getLogger(BBC.class).debug(this.format(args)); - } else { - try { - Method method = actor.getClass().getMethod("print", String.class); - method.setAccessible(true); - method.invoke(actor, this.format(args)); - } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { - e.printStackTrace(); - } - } - } - - public void send(Actor player, Object... args) { - if (isEmpty()) { - return; - } - if (player == null) { - getLogger(BBC.class).debug(this.format(args)); - } else { - player.print(this.format(args)); - } - } - - /** - * Colorize a component with legacy color codes - * @param parent - * @param locale - * @return Component - */ - public static Component color(Component component, Locale locale) { - return color(WorldEditText.format(component, locale)); - } - - public static Component color(Component parent) { - if (parent instanceof TextComponent) { - TextComponent text = (TextComponent) parent; - String content = text.content(); - if (content.indexOf('&') != -1) { - Component legacy = LegacyComponentSerializer.legacy().deserialize(content, '&'); - legacy = legacy.style(parent.style()); - if (!parent.children().isEmpty()) { - parent = TextComponent.builder().append(legacy).append(parent.children()).build(); - } else { - parent = legacy; - } - } - } - List children = parent.children(); - if (!children.isEmpty()) { - for (int i = 0; i < children.size(); i++) { - Component child = children.get(i); - Component coloredChild = color(child); - if (coloredChild != child) { - if (!(children instanceof ArrayList)) { - children = new ArrayList<>(children); - } - children.set(i, coloredChild); - } - } - if (children instanceof ArrayList) { - parent = parent.children(children); - } - } - return parent; - } - -} diff --git a/worldedit-core/src/main/java/com/boydti/fawe/config/Caption.java b/worldedit-core/src/main/java/com/boydti/fawe/config/Caption.java new file mode 100644 index 000000000..448138069 --- /dev/null +++ b/worldedit-core/src/main/java/com/boydti/fawe/config/Caption.java @@ -0,0 +1,56 @@ +package com.boydti.fawe.config; + +import com.sk89q.worldedit.util.formatting.WorldEditText; +import com.sk89q.worldedit.util.formatting.text.Component; +import com.sk89q.worldedit.util.formatting.text.TextComponent; +import com.sk89q.worldedit.util.formatting.text.serializer.legacy.LegacyComponentSerializer; + +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; + +public class Caption { + /** + * Colorize a component with legacy color codes + * @param parent + * @param locale + * @return Component + */ + public static Component color(Component component, Locale locale) { + return color(WorldEditText.format(component, locale)); + } + + public static Component color(Component parent) { + if (parent instanceof TextComponent) { + TextComponent text = (TextComponent) parent; + String content = text.content(); + if (content.indexOf('&') != -1) { + Component legacy = LegacyComponentSerializer.legacy().deserialize(content, '&'); + legacy = legacy.style(parent.style()); + if (!parent.children().isEmpty()) { + parent = TextComponent.builder().append(legacy).append(parent.children()).build(); + } else { + parent = legacy; + } + } + } + List children = parent.children(); + if (!children.isEmpty()) { + for (int i = 0; i < children.size(); i++) { + Component child = children.get(i); + Component coloredChild = color(child); + if (coloredChild != child) { + if (!(children instanceof ArrayList)) { + children = new ArrayList<>(children); + } + children.set(i, coloredChild); + } + } + if (children instanceof ArrayList) { + parent = parent.children(children); + } + } + return parent; + } + +} diff --git a/worldedit-core/src/main/java/com/boydti/fawe/config/Settings.java b/worldedit-core/src/main/java/com/boydti/fawe/config/Settings.java index c8df8d7c9..38189d7da 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/config/Settings.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/config/Settings.java @@ -33,7 +33,7 @@ public class Settings extends Config { @Comment({"Options: cn, de, es, fr, it, nl, ru, tr", "Create a PR to contribute a translation: https://github.com/IntellectualSites/FastAsyncWorldEdit-1.13/tree/master/worldedit-core/src/main/resources",}) - public String LANGUAGE = ""; + public String LANGUAGE = "en"; @Comment("@deprecated - use bstats config.yml") public boolean METRICS = true; @Comment({ diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/FaweCommand.java b/worldedit-core/src/main/java/com/boydti/fawe/object/FaweCommand.java index b096f6260..9564c5271 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/FaweCommand.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/FaweCommand.java @@ -1,6 +1,5 @@ package com.boydti.fawe.object; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.util.TaskManager; import com.sk89q.worldedit.extension.platform.Actor; 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 330f5fd80..3cb9b0e2e 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 @@ -1,6 +1,5 @@ package com.boydti.fawe.object.brush; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.brush.visualization.VisualExtent; import com.sk89q.worldedit.EditSession; 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 aa62f6840..4e6c8ae65 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 @@ -1,6 +1,5 @@ package com.boydti.fawe.object.brush; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.brush.visualization.VisualExtent; import com.boydti.fawe.object.clipboard.ResizableClipboardBuilder; 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 4592720df..4413c7c02 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,9 +1,7 @@ package com.boydti.fawe.object.brush; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.brush.visualization.cfi.HeightMapMCAGenerator; -import com.boydti.fawe.beta.IQueueExtent; import com.boydti.fawe.object.brush.heightmap.HeightMap; import com.boydti.fawe.object.brush.heightmap.RotatableHeightMap; import com.boydti.fawe.object.brush.heightmap.ScalableHeightMap; @@ -19,7 +17,6 @@ import com.sk89q.worldedit.function.mask.Masks; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; -import com.sk89q.worldedit.math.Vector3; import java.io.IOException; import java.io.InputStream; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/InspectBrush.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/InspectBrush.java index 9f3a59e8f..2373c5a54 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/InspectBrush.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/InspectBrush.java @@ -1,7 +1,6 @@ package com.boydti.fawe.object.brush; import com.boydti.fawe.Fawe; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Settings; import com.boydti.fawe.database.DBHandler; @@ -9,7 +8,6 @@ import com.boydti.fawe.database.RollbackDatabase; import com.boydti.fawe.object.RunnableVal; import com.boydti.fawe.object.change.MutableFullBlockChange; import com.boydti.fawe.object.changeset.DiskStorageHistory; -import com.boydti.fawe.util.EditSessionBuilder; import com.boydti.fawe.util.MainUtil; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; @@ -21,7 +19,6 @@ import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.util.Location; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BlockState; import java.io.IOException; 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 ad2017410..f0346bb40 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 @@ -1,6 +1,5 @@ package com.boydti.fawe.object.brush; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.brush.visualization.VisualExtent; import com.sk89q.worldedit.EditSession; 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 f89b8af12..3cb6e5651 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,14 +1,11 @@ package com.boydti.fawe.object.brush; import com.boydti.fawe.FaweCache; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.brush.visualization.VisualExtent; -import com.boydti.fawe.object.exception.FaweException; import com.boydti.fawe.object.mask.IdMask; import com.boydti.fawe.object.visitor.DFSRecursiveVisitor; import com.sk89q.worldedit.EditSession; -import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.command.tool.brush.Brush; import com.sk89q.worldedit.entity.Player; 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 68e0f1f06..1c1e4ba86 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,6 +1,5 @@ package com.boydti.fawe.object.brush; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.brush.visualization.VisualExtent; import com.boydti.fawe.object.collection.LocalBlockVectorSet; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/scroll/Scroll.java b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/scroll/Scroll.java index 1dd9725e2..d221d082d 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/brush/scroll/Scroll.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/brush/scroll/Scroll.java @@ -1,6 +1,5 @@ package com.boydti.fawe.object.brush.scroll; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.clipboard.MultiClipboardHolder; import com.sk89q.worldedit.LocalSession; 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 cc158b811..429078026 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,6 +1,5 @@ package com.boydti.fawe.object.brush.sweep; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.brush.ResettableTool; import com.boydti.fawe.object.brush.visualization.VisualExtent; 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 fc47a608a..ffafd8dec 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,6 +1,5 @@ package com.boydti.fawe.object.exception; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; public class FaweBlockBagException extends FaweException { 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 50588d97f..afbe67b20 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,6 +1,5 @@ package com.boydti.fawe.object.exception; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; public class FaweChunkLoadException extends FaweException { diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/exception/FaweException.java b/worldedit-core/src/main/java/com/boydti/fawe/object/exception/FaweException.java index 962391e49..f97d1c65b 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/exception/FaweException.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/exception/FaweException.java @@ -1,11 +1,8 @@ package com.boydti.fawe.object.exception; -import com.boydti.fawe.config.BBC; -import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.util.formatting.WorldEditText; 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.extent.Extent; import java.util.Locale; 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 3a51d7efc..d5c309a1c 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,8 +1,6 @@ package com.boydti.fawe.object.extent; import com.boydti.fawe.FaweCache; -import com.boydti.fawe.config.BBC; -import com.boydti.fawe.object.exception.FaweException; import com.boydti.fawe.util.MemUtil; import com.boydti.fawe.util.Permission; import com.boydti.fawe.util.WEManager; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/NullExtent.java b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/NullExtent.java index ebd4e1c00..93f31fd29 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/extent/NullExtent.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/extent/NullExtent.java @@ -5,9 +5,7 @@ import com.boydti.fawe.beta.IBatchProcessor; import com.boydti.fawe.beta.IChunk; import com.boydti.fawe.beta.IChunkGet; import com.boydti.fawe.beta.IChunkSet; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.Component; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.FaweLimit; import com.boydti.fawe.object.exception.FaweException; import com.sk89q.worldedit.MaxChangedBlocksException; 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 1d1e67695..8aae28e78 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 @@ -1,6 +1,5 @@ package com.boydti.fawe.object.progress; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/regions/selector/FuzzyRegionSelector.java b/worldedit-core/src/main/java/com/boydti/fawe/object/regions/selector/FuzzyRegionSelector.java index 11d60daca..634a17520 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/regions/selector/FuzzyRegionSelector.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/regions/selector/FuzzyRegionSelector.java @@ -1,6 +1,5 @@ package com.boydti.fawe.object.regions.selector; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.regions.FuzzyRegion; import com.boydti.fawe.util.EditSessionBuilder; diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/visitor/DFSVisitor.java b/worldedit-core/src/main/java/com/boydti/fawe/object/visitor/DFSVisitor.java index 08a771d5c..89f5634de 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/visitor/DFSVisitor.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/visitor/DFSVisitor.java @@ -1,6 +1,5 @@ package com.boydti.fawe.object.visitor; -import com.boydti.fawe.config.BBC; import com.google.common.collect.Lists; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; 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 85c622697..b447a93ea 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 @@ -9,7 +9,6 @@ import com.boydti.fawe.beta.IBatchProcessor; import com.boydti.fawe.beta.IQueueExtent; import com.boydti.fawe.beta.implementation.processors.LimitProcessor; import com.boydti.fawe.beta.implementation.queue.ParallelQueueExtent; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Settings; import com.boydti.fawe.logging.LoggingChangeSet; 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 35b2ae998..b7a4e5a57 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 @@ -4,8 +4,6 @@ import static java.lang.System.arraycopy; import static org.slf4j.LoggerFactory.getLogger; import com.boydti.fawe.Fawe; -import com.boydti.fawe.config.BBC; -import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.util.formatting.WorldEditText; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; @@ -26,7 +24,6 @@ import com.sk89q.jnbt.ListTag; import com.sk89q.jnbt.StringTag; import com.sk89q.jnbt.Tag; import com.sk89q.worldedit.entity.Entity; -import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats; import com.sk89q.worldedit.history.changeset.ChangeSet; 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 ffa458bd8..65ab19910 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -20,7 +20,6 @@ package com.sk89q.worldedit; import com.boydti.fawe.FaweCache; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.FaweLimit; @@ -44,32 +43,20 @@ import com.boydti.fawe.util.TaskManager; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.extent.EditSessionEvent; import com.sk89q.worldedit.extent.AbstractDelegateExtent; -import com.sk89q.worldedit.extension.platform.Capability; -import com.sk89q.worldedit.extension.platform.Watchdog; import com.sk89q.worldedit.extent.ChangeSetExtent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.MaskingExtent; import com.sk89q.worldedit.extent.PassthroughExtent; -import com.sk89q.worldedit.extent.cache.LastAccessExtentCache; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.extent.inventory.BlockBagExtent; -import com.sk89q.worldedit.extent.reorder.ChunkBatchingExtent; -import com.sk89q.worldedit.extent.reorder.MultiStageReorder; -import com.sk89q.worldedit.extent.validation.BlockChangeLimiter; -import com.sk89q.worldedit.extent.validation.DataValidatorExtent; -import com.sk89q.worldedit.extent.world.BlockQuirkExtent; -import com.sk89q.worldedit.extent.world.ChunkLoadingExtent; -import com.sk89q.worldedit.extent.world.FastModeExtent; import com.sk89q.worldedit.extent.world.SurvivalModeExtent; import com.sk89q.worldedit.extent.world.WatchdogTickingExtent; import com.sk89q.worldedit.function.GroundFunction; -import com.sk89q.worldedit.function.biome.BiomeReplace; import com.sk89q.worldedit.function.RegionFunction; import com.sk89q.worldedit.function.block.BlockReplace; import com.sk89q.worldedit.function.block.Naturalizer; import com.sk89q.worldedit.function.generator.ForestGenerator; import com.sk89q.worldedit.function.generator.GardenPatchGenerator; -import com.sk89q.worldedit.function.mask.BlockMask; import com.sk89q.worldedit.function.mask.BlockTypeMask; import com.sk89q.worldedit.function.mask.BoundedHeightMask; import com.sk89q.worldedit.function.mask.ExistingBlockMask; @@ -126,7 +113,6 @@ import com.sk89q.worldedit.util.Countable; import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.TreeGenerator; import com.sk89q.worldedit.util.eventbus.EventBus; -import com.sk89q.worldedit.world.NullWorld; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BaseBlock; @@ -152,7 +138,6 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.UUID; -import java.util.concurrent.ThreadLocalRandom; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; 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 646519715..90bfa057b 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 @@ -21,7 +21,6 @@ package com.sk89q.worldedit.command; import static com.sk89q.worldedit.command.util.Logging.LogMode.REGION; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalSession; @@ -41,7 +40,6 @@ import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.mask.Mask2D; import com.sk89q.worldedit.function.operation.Operations; import com.sk89q.worldedit.function.visitor.FlatRegionVisitor; -import com.sk89q.worldedit.function.visitor.RegionVisitor; import com.sk89q.worldedit.math.BlockVector2; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; @@ -53,7 +51,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.BiomeData; 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 5beb82bb8..22f189787 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 @@ -20,7 +20,6 @@ package com.sk89q.worldedit.command; import com.boydti.fawe.Fawe; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.FaweLimit; @@ -99,7 +98,6 @@ import com.sk89q.worldedit.function.mask.SingleBlockTypeMask; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.internal.annotation.ClipboardMask; -import com.sk89q.worldedit.internal.expression.EvaluationException; import com.sk89q.worldedit.internal.expression.Expression; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector3; @@ -126,7 +124,6 @@ import java.nio.file.FileSystems; import java.util.List; import java.util.zip.GZIPInputStream; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import org.enginehub.piston.annotation.Command; import com.sk89q.worldedit.function.factory.Apply; import org.enginehub.piston.annotation.CommandContainer; 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 0952a7520..4ffc31be6 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 @@ -23,7 +23,6 @@ import com.google.common.collect.Lists; import com.boydti.fawe.FaweAPI; import com.boydti.fawe.FaweCache; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.FaweLimit; @@ -77,13 +76,11 @@ import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.world.World; 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; import org.enginehub.piston.annotation.param.ArgFlag; import org.enginehub.piston.annotation.param.Switch; -import org.enginehub.piston.inject.InjectedValueAccess; import java.io.File; import java.io.IOException; 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 9a69419fd..1cfa44f6c 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 @@ -22,7 +22,6 @@ package com.sk89q.worldedit.command; import static com.google.common.base.Preconditions.checkNotNull; import com.boydti.fawe.Fawe; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.extent.ResettableExtent; import com.boydti.fawe.util.CachedTextureUtil; @@ -39,7 +38,6 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.command.util.CommandPermissions; import com.sk89q.worldedit.command.util.CommandPermissionsConditionGenerator; import com.sk89q.worldedit.command.util.HookMode; -import com.sk89q.worldedit.command.util.WorldEditAsyncCommandBuilder; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.DisallowedUsageException; import com.sk89q.worldedit.extension.input.InputParseException; @@ -52,7 +50,6 @@ import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.util.formatting.component.PaginationBox; 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.Component; import com.sk89q.worldedit.world.World; 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 dee2c2387..d900787d8 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 @@ -18,14 +18,12 @@ */ package com.sk89q.worldedit.command; -import static com.sk89q.worldedit.command.MethodCommands.getArguments; import static com.sk89q.worldedit.command.util.Logging.LogMode.ALL; import static com.sk89q.worldedit.command.util.Logging.LogMode.PLACEMENT; import static com.sk89q.worldedit.command.util.Logging.LogMode.POSITION; import static com.sk89q.worldedit.internal.command.CommandUtil.checkCommandArgument; import com.boydti.fawe.Fawe; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.util.MainUtil; import com.boydti.fawe.util.MathMan; @@ -59,7 +57,7 @@ import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.util.TreeGenerator.TreeType; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BlockType; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; + import java.awt.RenderingHints; import java.awt.image.BufferedImage; import java.io.IOException; @@ -70,7 +68,7 @@ import org.enginehub.piston.annotation.param.Arg; import org.enginehub.piston.annotation.param.Switch; import static com.google.common.base.Preconditions.checkNotNull; -import org.enginehub.piston.inject.InjectedValueAccess; + import org.jetbrains.annotations.Range; /** 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 6b76eb1ad..b8e818863 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 @@ -21,7 +21,6 @@ package com.sk89q.worldedit.command; import com.boydti.fawe.Fawe; import com.boydti.fawe.FaweAPI; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Settings; import com.boydti.fawe.database.DBHandler; @@ -51,12 +50,11 @@ import java.io.File; import java.util.Objects; import java.util.UUID; import java.util.concurrent.atomic.AtomicInteger; -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; import org.enginehub.piston.annotation.param.Switch; -import org.enginehub.piston.inject.InjectedValueAccess; import org.jetbrains.annotations.Range; import static com.google.common.base.Preconditions.checkNotNull; 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 2c4eab0fb..40371da0a 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 @@ -20,7 +20,6 @@ package com.sk89q.worldedit.command; import static com.sk89q.worldedit.command.util.Logging.LogMode.POSITION; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.WorldEdit; @@ -31,7 +30,6 @@ import com.sk89q.worldedit.command.util.Logging; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.util.Location; 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; 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 6bdb5f899..036ddb454 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 @@ -21,7 +21,6 @@ package com.sk89q.worldedit.command; import com.boydti.fawe.FaweAPI; import com.boydti.fawe.FaweCache; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.FaweLimit; import com.sk89q.jnbt.CompoundTag; @@ -63,21 +62,16 @@ import com.sk89q.worldedit.regions.Regions; import static com.sk89q.worldedit.command.util.Logging.LogMode.ALL; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TreeGenerator.TreeType; -import com.sk89q.worldedit.util.formatting.text.serializer.legacy.LegacyComponentSerializer; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BlockStateHolder; -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.world.block.BlockTypes; import org.enginehub.piston.annotation.Command; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.param.Arg; import org.enginehub.piston.annotation.param.ArgFlag; import org.enginehub.piston.annotation.param.Switch; -import org.enginehub.piston.inject.InjectedValueAccess; import org.jetbrains.annotations.Range; import java.util.ArrayList; @@ -86,7 +80,6 @@ import java.util.List; import static com.sk89q.worldedit.command.util.Logging.LogMode.ORIENTATION_REGION; import static com.sk89q.worldedit.command.util.Logging.LogMode.REGION; -import static com.sk89q.worldedit.command.util.annotation.Confirm.Processor.ALWAYS; import static com.sk89q.worldedit.command.util.annotation.Confirm.Processor.RADIUS; import static com.sk89q.worldedit.internal.command.CommandUtil.checkCommandArgument; import static com.sk89q.worldedit.regions.Regions.asFlatRegion; 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 676a00bce..34d1cb871 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 @@ -22,7 +22,6 @@ package com.sk89q.worldedit.command; import static com.boydti.fawe.util.ReflectionUtils.as; import static com.google.common.base.Preconditions.checkNotNull; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.clipboard.MultiClipboardHolder; @@ -41,7 +40,6 @@ import com.sk89q.worldedit.command.argument.Arguments; import com.sk89q.worldedit.command.util.AsyncCommandBuilder; import com.sk89q.worldedit.command.util.CommandPermissions; import com.sk89q.worldedit.command.util.CommandPermissionsConditionGenerator; -import com.sk89q.worldedit.command.util.WorldEditAsyncCommandBuilder; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.event.extent.ActorSaveClipboardEvent; import com.sk89q.worldedit.extension.platform.Actor; @@ -60,9 +58,7 @@ 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.event.ClickEvent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.event.HoverEvent; -import com.sk89q.worldedit.util.formatting.component.CodeFormat; import com.sk89q.worldedit.util.formatting.text.format.TextColor; import com.sk89q.worldedit.util.io.Closer; import com.sk89q.worldedit.util.io.file.FilenameException; 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 5a6bc0d88..f3a07b40a 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 @@ -20,7 +20,6 @@ package com.sk89q.worldedit.command; import static com.sk89q.worldedit.command.util.Logging.LogMode.ALL; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; @@ -29,15 +28,13 @@ 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 com.sk89q.worldedit.extension.platform.PlatformCommandManager; + import java.io.File; import java.util.List; import java.util.stream.Stream; import org.enginehub.piston.annotation.Command; import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.param.Arg; -import org.enginehub.piston.inject.InjectedValueAccess; import static com.google.common.base.Preconditions.checkNotNull; 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 d2e33c6e5..f668a221c 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 @@ -24,7 +24,6 @@ import com.google.common.base.Strings; import static com.sk89q.worldedit.command.util.Logging.LogMode.POSITION; import static com.sk89q.worldedit.command.util.Logging.LogMode.REGION; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.clipboard.URIClipboardHolder; import com.boydti.fawe.object.mask.IdMask; @@ -71,7 +70,6 @@ import com.sk89q.worldedit.util.formatting.component.CommandListBox; import com.sk89q.worldedit.util.formatting.component.SubtleFormat; import com.sk89q.worldedit.util.formatting.component.TextComponentProducer; 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.World; 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 1749e4611..dd4961b45 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,7 +21,6 @@ package com.sk89q.worldedit.command; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; @@ -33,7 +32,6 @@ import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.util.formatting.component.PaginationBox; 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; 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 48b7cb47d..01d8e0cb5 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,7 +19,6 @@ package com.sk89q.worldedit.command; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; @@ -32,7 +31,6 @@ import com.sk89q.worldedit.command.util.CommandPermissions; import com.sk89q.worldedit.command.util.CommandPermissionsConditionGenerator; import com.sk89q.worldedit.entity.Player; 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; 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 62d14ee63..31b06be0e 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 @@ -21,14 +21,12 @@ package com.sk89q.worldedit.command; import com.google.common.collect.Collections2; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.brush.InspectBrush; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; -import com.sk89q.worldedit.blocks.BaseItemStack; import com.sk89q.worldedit.command.tool.BlockDataCyler; import com.sk89q.worldedit.command.tool.BlockReplacer; import com.sk89q.worldedit.command.tool.InvalidToolBindException; @@ -53,7 +51,6 @@ import com.sk89q.worldedit.internal.command.CommandUtil; import org.enginehub.piston.annotation.CommandContainer; import org.enginehub.piston.annotation.param.Arg; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.world.block.BlockStateHolder; import org.enginehub.piston.CommandManager; import org.enginehub.piston.CommandManagerService; 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 2271cc14d..763530935 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 @@ -19,7 +19,6 @@ package com.sk89q.worldedit.command; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.brush.BrushSettings; import com.boydti.fawe.object.brush.TargetMode; @@ -45,7 +44,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; 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 d9eaeb197..254fc107b 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 @@ -22,7 +22,6 @@ package com.sk89q.worldedit.command; import static com.sk89q.worldedit.command.util.Logging.LogMode.PLACEMENT; import com.boydti.fawe.Fawe; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.DelegateConsumer; @@ -73,7 +72,6 @@ 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.format.TextColor; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BlockTypes; import java.awt.RenderingHints; 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 a762ca44a..45d415c28 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,7 +21,6 @@ package com.sk89q.worldedit.command; import com.boydti.fawe.Fawe; import com.boydti.fawe.FaweVersion; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Settings; import com.boydti.fawe.util.IncendoPaster; @@ -40,7 +39,6 @@ import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extension.platform.PlatformManager; import com.sk89q.worldedit.util.formatting.text.format.TextColor; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.component.TextComponentProducer; import com.sk89q.worldedit.util.formatting.component.MessageBox; @@ -52,7 +50,6 @@ import java.time.format.TextStyle; import java.time.zone.ZoneRulesException; import java.util.Date; import java.util.GregorianCalendar; -import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map; import org.enginehub.piston.annotation.Command; 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 1c190767f..42324590b 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,7 +19,6 @@ package com.sk89q.worldedit.command.tool; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.google.common.collect.Lists; import com.sk89q.worldedit.EditSession; @@ -33,7 +32,6 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.registry.state.Property; import com.sk89q.worldedit.util.Location; 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.BlockState; 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 820a7c6ef..ba59ee43c 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 @@ -23,13 +23,10 @@ import static com.google.common.base.Preconditions.checkNotNull; import static org.slf4j.LoggerFactory.getLogger; import com.boydti.fawe.Fawe; -import com.boydti.fawe.beta.IQueueExtent; import com.boydti.fawe.beta.implementation.IChunkExtent; import com.boydti.fawe.beta.implementation.processors.NullProcessor; import com.boydti.fawe.beta.implementation.processors.PersistentChunkSendProcessor; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; -import com.boydti.fawe.object.RunnableVal; import com.boydti.fawe.object.brush.BrushSettings; import com.boydti.fawe.object.brush.MovableTool; import com.boydti.fawe.object.brush.ResettableTool; @@ -46,7 +43,6 @@ import com.boydti.fawe.util.EditSessionBuilder; import com.boydti.fawe.util.ExtentTraverser; import com.boydti.fawe.util.MaskTraverser; import com.boydti.fawe.util.StringMan; -import com.boydti.fawe.util.TaskManager; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.sk89q.minecraft.util.commands.CommandException; @@ -62,7 +58,6 @@ import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Platform; -import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.mask.MaskIntersection; @@ -86,8 +81,6 @@ import java.util.Map; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import java.util.function.Supplier; -import java.util.stream.Stream; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import javax.annotation.Nullable; /** 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 b7e06d257..642a8c4aa 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,7 +19,6 @@ package com.sk89q.worldedit.command.tool; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.LocalConfiguration; import com.sk89q.worldedit.LocalSession; @@ -30,7 +29,6 @@ import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.RegionSelector; import com.sk89q.worldedit.util.Location; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; /** * A wand that can be used at a distance. 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 efc602df1..e2a85f780 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,7 +19,6 @@ package com.sk89q.worldedit.command.tool; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.collection.LocalBlockVectorSet; @@ -33,7 +32,6 @@ import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.Location; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.block.BlockCategories; import com.sk89q.worldedit.world.block.BlockState; 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 eefe8adad..6ef2a6ae8 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,7 +19,6 @@ package com.sk89q.worldedit.command.tool; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.LocalConfiguration; @@ -33,7 +32,6 @@ import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.util.Location; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.world.block.BaseBlock; /** 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 6b5b0019a..6febe4cf4 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,7 +19,6 @@ package com.sk89q.worldedit.command.tool; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.EditSession; @@ -32,7 +31,6 @@ import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TreeGenerator; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; /** * Plants a tree. 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 1eca463b9..5c539343b 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 @@ -1,7 +1,5 @@ package com.sk89q.worldedit.command.util.annotation; -import com.boydti.fawe.Fawe; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.util.task.InterruptableCondition; import com.sk89q.worldedit.IncompleteRegionException; 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 56b472cde..0b59d69da 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 @@ -21,8 +21,6 @@ package com.sk89q.worldedit.extension.factory.parser; import com.google.common.collect.Maps; -import com.boydti.fawe.command.SuggestInputParseException; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.jnbt.JSON2NBT; import com.boydti.fawe.jnbt.NBTException; @@ -45,7 +43,6 @@ import com.sk89q.worldedit.extension.input.InputParseException; import com.sk89q.worldedit.extension.input.NoMatchException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; -import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.extent.inventory.SlottableBlockBag; import com.sk89q.worldedit.internal.registry.InputParser; @@ -69,7 +66,6 @@ import com.sk89q.worldedit.world.entity.EntityType; import com.sk89q.worldedit.world.entity.EntityTypes; import java.util.Map; -import java.util.stream.Collectors; import java.util.stream.Stream; /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/DefaultMaskParser.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/DefaultMaskParser.java index 1af742fc9..b3a1c8035 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/DefaultMaskParser.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/factory/parser/mask/DefaultMaskParser.java @@ -21,18 +21,13 @@ package com.sk89q.worldedit.extension.factory.parser.mask; import com.boydti.fawe.command.FaweParser; import com.boydti.fawe.command.SuggestInputParseException; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.util.StringMan; -import com.google.common.collect.Iterables; -import com.sk89q.minecraft.util.commands.CommandException; import com.sk89q.minecraft.util.commands.CommandLocals; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.extension.input.InputParseException; -import com.sk89q.worldedit.extension.input.NoMatchException; import com.sk89q.worldedit.extension.input.ParserContext; import com.sk89q.worldedit.extension.platform.Actor; -import com.sk89q.worldedit.extension.platform.PlatformCommandManager; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.BlockMaskBuilder; import com.sk89q.worldedit.function.mask.Mask; 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 8777c9e6b..4043dfacf 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 @@ -21,7 +21,6 @@ package com.sk89q.worldedit.extension.platform; import com.sk89q.worldedit.EditSession; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.exception.FaweException; import com.boydti.fawe.object.task.SimpleAsyncNotifyQueue; @@ -32,7 +31,6 @@ import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.entity.Player; -import com.sk89q.worldedit.event.platform.CommandEvent; import com.sk89q.worldedit.extent.Extent; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.internal.cui.CUIEvent; @@ -40,11 +38,9 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.MutableBlockVector3; import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.regions.ConvexPolyhedralRegion; -import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.CylinderRegion; import com.sk89q.worldedit.regions.Polygonal2DRegion; import com.sk89q.worldedit.regions.Region; -import com.sk89q.worldedit.regions.RegionOperationException; import com.sk89q.worldedit.regions.RegionSelector; import com.sk89q.worldedit.regions.selector.ConvexPolyhedralRegionSelector; @@ -57,7 +53,6 @@ import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.TargetBlock; import com.sk89q.worldedit.util.auth.AuthorizationException; -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.BlockState; @@ -71,12 +66,9 @@ import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.registry.BlockMaterial; import java.io.File; -import java.text.NumberFormat; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; -import org.enginehub.piston.inject.InjectedValueAccess; -import org.jetbrains.annotations.NotNull; /** * An abstract implementation of both a {@link Actor} and a {@link Player} diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java index 6cd0015ac..7d6c2eb1b 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/Actor.java @@ -20,7 +20,7 @@ package com.sk89q.worldedit.extension.platform; import com.boydti.fawe.Fawe; -import com.boydti.fawe.config.BBC; +import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.FaweLimit; @@ -29,24 +29,15 @@ import com.boydti.fawe.util.task.InterruptableCondition; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.entity.MapMetadatable; import com.sk89q.worldedit.entity.Player; -import com.sk89q.worldedit.event.platform.CommandEvent; import com.sk89q.worldedit.internal.cui.CUIEvent; -import com.sk89q.worldedit.math.BlockVector3; -import com.sk89q.worldedit.regions.Region; -import com.sk89q.worldedit.regions.RegionOperationException; import com.sk89q.worldedit.session.SessionOwner; import com.sk89q.worldedit.session.request.Request; import com.sk89q.worldedit.util.Identifiable; import com.sk89q.worldedit.util.auth.Subject; import com.sk89q.worldedit.util.formatting.text.Component; -import com.sk89q.worldedit.util.formatting.text.format.TextColor; -import org.enginehub.piston.inject.InjectedValueAccess; -import org.jetbrains.annotations.NotNull; import java.io.File; import java.io.IOException; -import java.text.NumberFormat; -import java.util.concurrent.locks.Condition; import java.util.Locale; /** @@ -86,7 +77,9 @@ public interface Actor extends Identifiable, SessionOwner, Subject, MapMetadatab * @deprecated Use component-based functions (printDebug) */ @Deprecated - void printDebug(String msg); + default void printDebug(String msg) { + printDebug(TextComponent.of(msg)); + } /** * Print a WorldEdit message. @@ -95,7 +88,9 @@ public interface Actor extends Identifiable, SessionOwner, Subject, MapMetadatab * @deprecated Use component-based functions (printInfo) */ @Deprecated - void print(String msg); + default void print(String msg) { + printInfo(TextComponent.of(msg)); + } /** * Print a WorldEdit error. @@ -104,7 +99,10 @@ public interface Actor extends Identifiable, SessionOwner, Subject, MapMetadatab * @deprecated Use component-based functions (printError) */ @Deprecated - void printError(String msg); + default void printError(String msg) { + printError(TextComponent.of(msg)); + } + /** * Print a WorldEdit error. @@ -112,7 +110,7 @@ public interface Actor extends Identifiable, SessionOwner, Subject, MapMetadatab * @param component The component to print */ default void printError(Component component) { - print(component.color(TextColor.RED)); + print(TranslatableComponent.of("error", component)); } /** @@ -121,7 +119,7 @@ public interface Actor extends Identifiable, SessionOwner, Subject, MapMetadatab * @param component The component to print */ default void printInfo(Component component) { - print(component.color(TextColor.GRAY)); + print(TranslatableComponent.of("info", component)); } /** @@ -144,7 +142,7 @@ public interface Actor extends Identifiable, SessionOwner, Subject, MapMetadatab * @param component The component to print */ default void printDebug(Component component) { - print(component.color(TextColor.GRAY)); + print(TranslatableComponent.of("debug", component)); } /** 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 61aa169fa..0e893c58e 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 @@ -24,14 +24,12 @@ import com.boydti.fawe.command.AnvilCommands; import com.boydti.fawe.command.AnvilCommandsRegistration; import com.boydti.fawe.command.CFICommands; import com.boydti.fawe.command.CFICommandsRegistration; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.brush.visualization.cfi.HeightMapMCAGenerator; import com.boydti.fawe.object.changeset.CFIChangeSet; import com.boydti.fawe.object.exception.FaweException; import com.boydti.fawe.object.task.ThrowableSupplier; -import com.boydti.fawe.util.StringMan; import com.boydti.fawe.util.TaskManager; import com.boydti.fawe.wrappers.LocationMaskedPlayerWrapper; import com.google.common.collect.ImmutableList; @@ -136,7 +134,6 @@ import com.sk89q.worldedit.util.auth.AuthorizationException; import com.sk89q.worldedit.util.eventbus.Subscribe; 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.util.logging.DynamicStreamHandler; import com.sk89q.worldedit.util.logging.LogFormat; 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 19c913e1e..f4a90859c 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 @@ -21,7 +21,6 @@ package com.sk89q.worldedit.extension.platform; import static com.google.common.base.Preconditions.checkNotNull; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.brush.visualization.VirtualWorld; import com.boydti.fawe.object.exception.FaweException; @@ -45,7 +44,6 @@ import com.sk89q.worldedit.event.platform.PlatformReadyEvent; import com.sk89q.worldedit.event.platform.PlayerInputEvent; import com.sk89q.worldedit.math.Vector3; import com.sk89q.worldedit.session.request.Request; -import com.sk89q.worldedit.util.HandSide; import com.sk89q.worldedit.util.Location; import com.sk89q.worldedit.util.eventbus.Subscribe; import com.sk89q.worldedit.world.World; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java index a271bdc2b..a71b2b314 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extension/platform/PlayerProxy.java @@ -144,22 +144,7 @@ public class PlayerProxy extends AbstractPlayerActor { @Override public void printRaw(String msg) { - basePlayer.print(TextComponent.of(msg)); - } - - @Override - public void printDebug(String msg) { - basePlayer.printDebug(TextComponent.of(msg)); - } - - @Override - public void print(String msg) { - basePlayer.printInfo(TextComponent.of(msg)); - } - - @Override - public void printError(String msg) { - basePlayer.printError(TextComponent.of(msg)); + basePlayer.printRaw(msg); } @Override 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 dd1734b32..28d5b4248 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 @@ -21,7 +21,6 @@ package com.sk89q.worldedit.extent.clipboard.io; import static com.google.common.base.Preconditions.checkNotNull; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.clipboard.LazyClipboardHolder; 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 3c39d6560..10efa0c9b 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 @@ -23,7 +23,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.collect.Lists; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.boydti.fawe.object.collection.BlockVectorSet; import com.google.common.collect.Sets; @@ -36,7 +35,6 @@ import com.sk89q.worldedit.math.MutableBlockVector3; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.Direction; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.util.formatting.text.format.TextColor; import java.util.ArrayList; import java.util.Arrays; 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 74ab20f9b..bdfb9dcc0 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,7 +19,6 @@ package com.sk89q.worldedit.function.visitor; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import static com.google.common.base.Preconditions.checkNotNull; @@ -35,7 +34,6 @@ import com.sk89q.worldedit.util.formatting.text.Component; import java.util.Iterator; 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; /** 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 37a2c781a..ba43aca0b 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,7 +19,6 @@ package com.sk89q.worldedit.function.visitor; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.google.common.collect.Lists; @@ -33,7 +32,6 @@ import com.sk89q.worldedit.regions.FlatRegion; import static com.google.common.base.Preconditions.checkNotNull; 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; /** 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 260cbf9d6..89f4123b2 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 @@ -21,7 +21,6 @@ package com.sk89q.worldedit.function.visitor; import com.google.common.collect.Lists; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.function.RegionFunction; @@ -31,7 +30,6 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.Region; 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; /** 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 0ca8f4457..7c0cc5632 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 @@ -21,7 +21,6 @@ package com.sk89q.worldedit.regions.selector; import static com.google.common.base.Preconditions.checkNotNull; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.LocalSession; @@ -38,7 +37,6 @@ import com.sk89q.worldedit.regions.polyhedron.Triangle; import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; 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 java.util.ArrayList; 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 5d9a48c6d..1b477f755 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 @@ -21,7 +21,6 @@ package com.sk89q.worldedit.regions.selector; import static com.google.common.base.Preconditions.checkNotNull; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.LocalSession; @@ -40,7 +39,6 @@ import com.sk89q.worldedit.regions.RegionSelector; import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; 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 java.text.NumberFormat; 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 c4bd36efa..a9234c779 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,7 +19,6 @@ package com.sk89q.worldedit.regions.selector; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import static com.google.common.base.Preconditions.checkNotNull; @@ -39,7 +38,6 @@ import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.world.World; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import javax.annotation.Nullable; import java.util.ArrayList; 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 54ee7d8be..82da2c16b 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,7 +19,6 @@ package com.sk89q.worldedit.regions.selector; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.extension.platform.Actor; @@ -27,7 +26,6 @@ import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.RegionSelector; import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; import com.sk89q.worldedit.util.formatting.text.TextComponent; -import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.world.World; import javax.annotation.Nullable; 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 3c67616fa..85dde7a3b 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 @@ -21,7 +21,6 @@ package com.sk89q.worldedit.regions.selector; import static com.google.common.base.Preconditions.checkNotNull; -import com.boydti.fawe.config.BBC; import com.sk89q.worldedit.util.formatting.text.TranslatableComponent; import com.sk89q.worldedit.IncompleteRegionException; import com.sk89q.worldedit.LocalSession; @@ -38,7 +37,6 @@ import com.sk89q.worldedit.regions.RegionSelector; import com.sk89q.worldedit.regions.selector.limit.SelectorLimits; 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 java.util.Collections; diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/text/TranslatableComponent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/text/TranslatableComponent.java index 5752306e2..58ca6cd94 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/text/TranslatableComponent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/text/TranslatableComponent.java @@ -131,7 +131,7 @@ public interface TranslatableComponent extends BuildableComponent components = Arrays.stream(args) .map(arg -> arg instanceof Component ? (Component) arg : TextComponent.of(Objects.toString(arg))) .collect(Collectors.toList()); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/translation/TranslationManager.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/translation/TranslationManager.java index c253d3091..0d04e68d4 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/translation/TranslationManager.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/translation/TranslationManager.java @@ -139,7 +139,7 @@ public class TranslationManager { return false; } - private Map getTranslationMap(Locale locale) { + public Map getTranslationMap(Locale locale) { Map translations = translationMap.get(locale); if (translations == null) { if (tryLoadTranslations(locale)) { diff --git a/worldedit-core/src/main/resources/lang/strings.json b/worldedit-core/src/main/resources/lang/strings.json index 3051d9741..cb821ae5e 100644 --- a/worldedit-core/src/main/resources/lang/strings.json +++ b/worldedit-core/src/main/resources/lang/strings.json @@ -1,6 +1,8 @@ { "fawe.prefix": "&8(&4&lFAWE&8)&7 ", - + "error": "&c", + "info": "&7", + "debug": "&3", "piston.style.help.text": "Help: {0}", "piston.style.text.modifier": "TODO modifier: {0}, {1}, {2}", "piston.style.main.text": "{0}",