From 19de815ab48c2125cd7de674e719b243f3860a9b Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Wed, 29 Dec 2021 17:13:20 +0100 Subject: [PATCH] chore: Format our loggers properly --- .../fastasyncworldedit/bukkit/listener/ChunkListener.java | 6 +++--- .../com/sk89q/worldedit/bukkit/BukkitServerInterface.java | 2 +- .../main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java | 8 ++++---- .../java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java | 4 ++-- .../main/java/com/sk89q/worldedit/cli/CLIWorldEdit.java | 2 +- .../core/extent/clipboard/io/FastSchematicReader.java | 2 +- .../main/java/com/sk89q/worldedit/EditSessionBuilder.java | 2 +- .../extent/clipboard/io/MCEditSchematicReader.java | 6 +++--- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/listener/ChunkListener.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/listener/ChunkListener.java index 345a0abc9..f3051536d 100644 --- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/listener/ChunkListener.java +++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/listener/ChunkListener.java @@ -377,8 +377,8 @@ public abstract class ChunkListener implements Listener { if (Math.abs(velocity.getX()) > vertical || Math.abs(velocity.getZ()) > vertical) { LOGGER.warn( - "[FAWE `tick-limiter`] Detected and cancelled rogue FireWork at " - + ent.getLocation()); + "[FAWE `tick-limiter`] Detected and cancelled rogue FireWork at {}", + ent.getLocation()); ent.remove(); } } @@ -408,7 +408,7 @@ public abstract class ChunkListener implements Listener { if (rateLimit <= 0) { rateLimit = 20; LOGGER.warn( - "[FAWE `tick-limiter`] Detected and cancelled item lag source at " + loc); + "[FAWE `tick-limiter`] Detected and cancelled item lag source at {}", loc); } event.setCancelled(true); } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java index 10df72cef..44414ffc4 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitServerInterface.java @@ -275,7 +275,7 @@ public class BukkitServerInterface extends AbstractPlatform implements MultiUser RelighterFactory getRelighterFactory() { if (this.relighterFactory == null) { this.relighterFactory = this.plugin.getBukkitImplAdapter().getRelighterFactory(); - LOGGER.info("Using " + this.relighterFactory.getClass().getCanonicalName() + " as relighter factory."); + LOGGER.info("Using {} as relighter factory.", this.relighterFactory.getClass().getCanonicalName()); } return this.relighterFactory; } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 91ffb6674..379476ec8 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -301,10 +301,10 @@ public class BukkitWorld extends AbstractWorld { if (treeTypeMapping.get(type) == null) { LOGGER.error("No TreeType mapping for TreeGenerator.TreeType." + type); //FAWE start - LOGGER.info("The above message is displayed because your FAWE version is newer than " + Bukkit.getVersion() + - " and contains features of future minecraft versions which do not exist in " - + Bukkit.getVersion() + ", hence the tree type " + type + " is not available. This is not an error. " + - "This version will work on your version of Minecraft. This is an informative message only"); + LOGGER.info("The above message is displayed because your FAWE version is newer than {}" + + " and contains features of future minecraft versions which do not exist in {} hence the tree type" + + "{} is not available. This is not an error. This version will work on your version of Minecraft." + + "This is an informative message only.", Bukkit.getVersion(), Bukkit.getVersion(), type); //FAWE end } } diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index 3fe92e41d..37f743e1c 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -367,8 +367,8 @@ public class WorldEditPlugin extends JavaPlugin { } else { //FAWE start - Identify as FAWE LOGGER.info("FastAsyncWorldEdit could not find a Bukkit adapter for this MC version, " - + "but it seems that you have another implementation of FastAsyncWorldEdit installed (" + platform.getPlatformName() + ") " - + "that handles the world editing."); + + "but it seems that you have another implementation of FastAsyncWorldEdit installed ({}) " + + "that handles the world editing.", platform.getPlatformName()); //FAWE end } this.adapter.invalidate(); diff --git a/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIWorldEdit.java b/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIWorldEdit.java index a9a57877a..73eb307ec 100644 --- a/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIWorldEdit.java +++ b/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/CLIWorldEdit.java @@ -190,7 +190,7 @@ public class CLIWorldEdit { this.commandSender = new CLICommandSender(this, LOGGER); this.platform = new CLIPlatform(this); //FAWE start - identify as Fawe - LOGGER.info("FastAsyncWorldEdit CLI (version " + getInternalVersion() + ") is loaded"); + LOGGER.info("FastAsyncWorldEdit CLI (version {}) is loaded", getInternalVersion()); //FAWE end } diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReader.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReader.java index 5c60b91c5..87ca68044 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReader.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReader.java @@ -178,7 +178,7 @@ public class FastSchematicReader extends NBTSchematicReader { try { state = BlockState.get(palettePart); } catch (InputParseException ignored) { - LOGGER.warn("Invalid BlockState in palette: " + palettePart + ". Block will be replaced with air."); + LOGGER.warn("Invalid BlockState in palette: {}. Block will be replaced with air.", palettePart); state = BlockTypes.AIR.getDefaultState(); } int index = (int) entry.getValue(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionBuilder.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionBuilder.java index e8af94c69..11e49f878 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionBuilder.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSessionBuilder.java @@ -722,7 +722,7 @@ public final class EditSessionBuilder { "FAWE config.yml to let FAWE recognize the extent:")); event.getActor().print(toReturn.getClass().getName()); } else { - LOGGER.warn("Potentially unsafe extent blocked: " + toReturn.getClass().getName()); + LOGGER.warn("Potentially unsafe extent blocked: {}", toReturn.getClass().getName()); LOGGER.warn( " - For area restrictions and block logging, it is recommended that third party plugins use the FAWE API"); LOGGER.warn( diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java index 2c743fd74..760598ad5 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java @@ -206,7 +206,7 @@ public class MCEditSchematicReader extends NBTSchematicReader { //FAWE start - tile entity safety - perhaps caused by the old issue with tile entities created in the wrong // position in schematics? if (index >= blocks.length) { - LOGGER.warn("Skipping corrupt tile entity at position " + x + " " + y + " " + z + " in schematic."); + LOGGER.warn("Skipping corrupt tile entity at position {} {} {} in schematic.", x, y, z); continue; } @@ -275,8 +275,8 @@ public class MCEditSchematicReader extends NBTSchematicReader { byte data = blockData[index]; int combined = block << 8 | data; if (unknownBlocks.add(combined)) { - LOGGER.warn("Unknown block when loading schematic: " - + block + ":" + data + ". This is most likely a bad schematic."); + LOGGER.warn("Unknown block when loading schematic: {} {}. This is most likely a" + + "bad schematic.", block, data); } } } catch (WorldEditException ignored) { // BlockArrayClipboard won't throw this