From 05a15ac68994b3c94220f971c351e9f9473ca5b9 Mon Sep 17 00:00:00 2001 From: N0tMyFaultOG Date: Mon, 17 Aug 2020 19:39:43 +0200 Subject: [PATCH] Fix a few typos and spaces --- .../plotsquared/bukkit/BukkitPlatform.java | 9 +- .../core/command/SchematicCmd.java | 6 +- .../core/configuration/Settings.java | 9 +- .../plotsquared/core/util/ConsoleColors.java | 111 ------------------ 4 files changed, 6 insertions(+), 129 deletions(-) delete mode 100644 Core/src/main/java/com/plotsquared/core/util/ConsoleColors.java diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java index a76846fed..15344017c 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java @@ -501,12 +501,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl logger.info("[P2] PlaceholderAPI is not in use. Hook deactivated"); } - if (Settings.Enabled_Components.BSTATS) { - this.startMetrics(); - } - else { - logger.info("[P2] bStats is disabled. Please enable it in /plugins/PlotSquared/config/settings.yml. It helps the developers to identify the features most used and organize future updates better. Cheers."); - } + this.startMetrics(); if (Settings.Enabled_Components.WORLDS) { TaskManager.getPlatformImplementation().taskRepeat(this::unload, TaskTime.seconds(1L)); @@ -980,7 +975,7 @@ public final class BukkitPlatform extends JavaPlugin implements Listener, PlotPl return; } this.metricsStarted = true; - Metrics metrics = new Metrics(this, BSTATS_ID);// bstats + Metrics metrics = new Metrics(this, BSTATS_ID); // bstats metrics.addCustomChart(new Metrics.DrilldownPie("area_types", () -> { final Map> map = new HashMap<>(); for (final PlotAreaType plotAreaType : PlotAreaType.values()) { diff --git a/Core/src/main/java/com/plotsquared/core/command/SchematicCmd.java b/Core/src/main/java/com/plotsquared/core/command/SchematicCmd.java index 0a7850be0..6661efdf6 100644 --- a/Core/src/main/java/com/plotsquared/core/command/SchematicCmd.java +++ b/Core/src/main/java/com/plotsquared/core/command/SchematicCmd.java @@ -72,7 +72,7 @@ public class SchematicCmd extends SubCommand { if (args.length < 1) { player.sendMessage( TranslatableCaption.of("commandconfig.command_syntax"), - Template.of("value", "Possible values: save, paste , exportall, list") + Template.of("value", "Possible values: save, paste, exportall, list") ); return true; } @@ -89,7 +89,7 @@ public class SchematicCmd extends SubCommand { if (args.length < 2) { player.sendMessage( TranslatableCaption.of("commandconfig.command_syntax"), - Template.of("value", "Possible values: save, paste , exportall, list") + Template.of("value", "Possible values: save, paste, exportall, list") ); break; } @@ -266,7 +266,7 @@ public class SchematicCmd extends SubCommand { default: player.sendMessage( TranslatableCaption.of("commandconfig.command_syntax"), - Template.of("value", "Possible values: save, paste , exportall, list") + Template.of("value", "Possible values: save, paste, exportall, list") ); break; } diff --git a/Core/src/main/java/com/plotsquared/core/configuration/Settings.java b/Core/src/main/java/com/plotsquared/core/configuration/Settings.java index e1137b4c4..e59c73677 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/Settings.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/Settings.java @@ -186,10 +186,7 @@ public class Settings extends Config { // Miscellaneous DEBUG = config.getBoolean("debug", DEBUG); - Chat.CONSOLE_COLOR = config.getBoolean("console.color", Chat.CONSOLE_COLOR); Chat.INTERACTIVE = config.getBoolean("chat.fancy", Chat.INTERACTIVE); - Enabled_Components.BSTATS = - config.getBoolean("bstats", Enabled_Components.BSTATS); Enabled_Components.DATABASE_PURGER = config.getBoolean("auto-purge", Enabled_Components.DATABASE_PURGER); @@ -284,7 +281,7 @@ public class Settings extends Config { INVALID_BLOCKS = Arrays.asList( // Acacia Stuff "acacia_button", "acacia_fence_gate", "acacia_door", "acacia_pressure_plate", - "acaia_trapdoor", "acacia_sapling", "acacia_sign", "acacia_wall_sign", "acacia_leaves", + "acacia_trapdoor", "acacia_sapling", "acacia_sign", "acacia_wall_sign", "acacia_leaves", // Birch Stuff "birch_button", "birch_fence_gate", "birch_door", "birch_pressure_plate", "birch_trapdoor", "birch_sapling", "birch_sign", "birch_wall_sign", "birch_leaves", @@ -438,8 +435,6 @@ public class Settings extends Config { @Comment("Chat related settings") public static final class Chat { - @Comment("Sometimes console color doesn't work, you can disable it here") - public static boolean CONSOLE_COLOR = true; @Comment("Should the chat be interactive?") public static boolean INTERACTIVE = true; } @@ -592,8 +587,6 @@ public class Settings extends Config { public static boolean EXTENDED_USERNAME_COMPLETION = true; @Comment("Command aliases that will be tab completed") public static List TAB_COMPLETED_ALIASES = Arrays.asList("plot", "plots", "p", "plotsquared", "plot2", "p2", "ps", "2", "plotme", "plotz", "ap"); - @Comment({"Send anonymous PlotSquared statistics to https://bstats.org/.", - "Please keep this setting enabled. It helps us identifying which parts of PlotSquared are used the most to organize future updates better."}) public static boolean BSTATS = true; } } diff --git a/Core/src/main/java/com/plotsquared/core/util/ConsoleColors.java b/Core/src/main/java/com/plotsquared/core/util/ConsoleColors.java deleted file mode 100644 index 4f713fe3e..000000000 --- a/Core/src/main/java/com/plotsquared/core/util/ConsoleColors.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * _____ _ _ _____ _ - * | __ \| | | | / ____| | | - * | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| | - * | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` | - * | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| | - * |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_| - * | | - * |_| - * PlotSquared plot management system for Minecraft - * Copyright (C) 2020 IntellectualSites - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.plotsquared.core.util; - -public class ConsoleColors { - public static String fromString(String input) { - input = input.replaceAll("&0", fromChatColor("&0")).replaceAll("&1", fromChatColor("&1")) - .replaceAll("&2", fromChatColor("&2")).replaceAll("&3", fromChatColor("&3")) - .replaceAll("&4", fromChatColor("&4")).replaceAll("&5", fromChatColor("&5")) - .replaceAll("&6", fromChatColor("&6")).replaceAll("&7", fromChatColor("&7")) - .replaceAll("&8", fromChatColor("&8")).replaceAll("&9", fromChatColor("&9")) - .replaceAll("&a", fromChatColor("&a")).replaceAll("&b", fromChatColor("&b")) - .replaceAll("&c", fromChatColor("&c")).replaceAll("&d", fromChatColor("&d")) - .replaceAll("&e", fromChatColor("&e")).replaceAll("&f", fromChatColor("&f")) - .replaceAll("&k", fromChatColor("&k")).replaceAll("&l", fromChatColor("&l")) - .replaceAll("&m", fromChatColor("&m")).replaceAll("&n", fromChatColor("&n")) - .replaceAll("&o", fromChatColor("&o")).replaceAll("&r", fromChatColor("&r")); - return input + "\u001B[0m"; - } - - /* - * public static final String ANSI_RESET = "\u001B[0m"; public static final - * String ANSI_BLACK = "\u001B[30m"; public static final String ANSI_RED = - * "\u001B[31m"; public static final String ANSI_GREEN = "\u001B[32m"; - * public static final String ANSI_YELLOW = "\u001B[33m"; public static - * final String ANSI_BLUE = "\u001B[34m"; public static final String - * ANSI_PURPLE = "\u001B[35m"; public static final String ANSI_CYAN = - * "\u001B[36m"; public static final String ANSI_WHITE = "\u001B[37m"; - * public static final String ANSI_BOLD = "\033[1m"; public static final - * String ANSI_UNDERLINE = "\033[0m"; public static final String ANSI_ITALIC - * = "\033[3m]"; - */ - public static String fromChatColor(final String color) { - return chatColor(color).getLin(); - } - - public static ConsoleColor chatColor(final String color) { - switch (color) { - case "&7": - case "&8": - return ConsoleColor.WHITE; - case "&0": - return ConsoleColor.BLACK; - case "&4": - case "&c": - return ConsoleColor.RED; - case "&6": - case "&e": - return ConsoleColor.YELLOW; - case "&a": - case "&2": - return ConsoleColor.GREEN; - case "&b": - case "&3": - return ConsoleColor.CYAN; - case "&d": - case "&5": - return ConsoleColor.PURPLE; - case "&9": - case "&1": - return ConsoleColor.BLUE; - case "&n": - return ConsoleColor.UNDERLINE; - case "&o": - return ConsoleColor.ITALIC; - case "&l": - return ConsoleColor.BOLD; - case "&r": - default: - return ConsoleColor.RESET; - } - } - - enum ConsoleColor { - RESET("\u001B[0m"), BLACK("\u001B[30m"), RED("\u001B[31m"), GREEN("\u001B[32m"), YELLOW( - "\u001B[33m"), BLUE("\u001B[34m"), PURPLE("\u001B[35m"), CYAN("\u001B[36m"), WHITE( - "\u001B[37m"), BOLD("\033[1m"), UNDERLINE("\033[0m"), ITALIC("\033[3m"); - private final String lin; - - ConsoleColor(final String lin) { - this.lin = lin; - } - - public String getLin() { - return lin; - } - } -}