From 9c9841663a3ca7d94e0b0cf4c14712b327b212d3 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Tue, 19 Nov 2019 01:39:51 +0000 Subject: [PATCH 1/8] Fixes #2595 (leave error) --- .../intellectualsites/plotsquared/plot/commands/Leave.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Leave.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Leave.java index b51993326..87cb1d3ee 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Leave.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Leave.java @@ -40,7 +40,7 @@ import java.util.concurrent.CompletableFuture; if (plot.removeMember(uuid)) { EventUtil.manager.callMember(player, plot, uuid, false); } - MainUtil.sendMessage(player, Captions.INVALID_PLAYER, args[0]); + MainUtil.sendMessage(player, Captions.INVALID_PLAYER, player.getName()); } else { MainUtil.sendMessage(player, Captions.REMOVED_PLAYERS, 1); } From 7377366372f473fbf198e566dfbd943459ca892e Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Fri, 22 Nov 2019 12:28:34 +0100 Subject: [PATCH 2/8] Updating some debug colors --- .../intellectualsites/plotsquared/plot/PlotSquared.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java index 86b8c7a92..4090bf4da 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/PlotSquared.java @@ -245,7 +245,7 @@ import java.util.zip.ZipInputStream; if (Settings.Enabled_Components.WORLDEDIT_RESTRICTIONS) { try { if (this.IMP.initWorldEdit()) { - PlotSquared.debug(IMP.getPluginName() + " hooked into WorldEdit."); + PlotSquared.log(Captions.PREFIX + "&6" + IMP.getPluginName() + " hooked into WorldEdit."); this.worldedit = WorldEdit.getInstance(); WorldEdit.getInstance().getEventBus().register(new WESubscriber()); if (Settings.Enabled_Components.COMMANDS) { @@ -317,7 +317,7 @@ import java.util.zip.ZipInputStream; e.printStackTrace(); } - PlotSquared.log(Captions.ENABLED.f(IMP.getPluginName())); + PlotSquared.log(Captions.PREFIX + Captions.ENABLED.f(IMP.getPluginName())); } /** From c14e1d7add84415e8e66857da1689366cc06f721 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Fri, 22 Nov 2019 12:40:27 +0100 Subject: [PATCH 3/8] Update Settings.java --- .../intellectualsites/plotsquared/plot/config/Settings.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java index 8dd1be8a8..434783241 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/config/Settings.java @@ -28,7 +28,7 @@ public class Settings extends Config { @Comment("Show additional information in console") public static boolean DEBUG = false; @Comment({"The big annoying text that appears when you enter a plot", - "For a single plot: `/plot flag set titles false`", "For just you: `/plot toggle titles`"}) + "For a single plot: `/plot flag set titles false`", "For just you: `/plot toggle titles`", "For all plots: Add `titles: false` in the worlds.yml flags block"}) public static boolean TITLES = true; @Create // This value will be generated automatically @@ -331,7 +331,7 @@ public class Settings extends Config { true; @Comment("The UUID cacher is used to resolve player names") public static boolean UUID_CACHE = true; - @Comment("The plugin auto updater") public static boolean UPDATER = true; + @Comment("The plugin auto updater will notify you if updates are available.") public static boolean UPDATER = true; @Comment("Stores user metadata in a database") public static boolean PERSISTENT_META = true; @Comment("Optimizes permission checks") public static boolean PERMISSION_CACHE = true; @Comment("Optimizes block changing code") public static boolean BLOCK_CACHE = true; From 8b7e8ec6351edebc02f852743f30cba7dac2da2e Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Fri, 22 Nov 2019 15:52:25 +0100 Subject: [PATCH 4/8] Update bug-issue-report-for-plotsquared.md --- .../ISSUE_TEMPLATE/bug-issue-report-for-plotsquared.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-issue-report-for-plotsquared.md b/.github/ISSUE_TEMPLATE/bug-issue-report-for-plotsquared.md index aa5349430..d4a83991f 100644 --- a/.github/ISSUE_TEMPLATE/bug-issue-report-for-plotsquared.md +++ b/.github/ISSUE_TEMPLATE/bug-issue-report-for-plotsquared.md @@ -11,7 +11,7 @@ assignees: '' -# NOTICE: + -# BUG REPORT TEMPLATE: +# Bug Report Template: ## Required Information section: > ALL FIELDS IN THIS SECTION ARE REQUIRED, and must contain appropriate information @@ -55,7 +56,9 @@ assignees: '' ### Server build info: -``` paste here, between the tick marks, replacing this text ``` +``` +paste here, between the tick marks, replacing this text +``` ### WorldEdit/FAWE versions: From 977dfa807f1187c4af4741728846e79557ef0b19 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 22 Nov 2019 16:11:48 +0000 Subject: [PATCH 5/8] potentially fix partial world auto --- .../intellectualsites/plotsquared/plot/object/PlotArea.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java index 0cefe8283..e2c7de91e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotArea.java @@ -700,7 +700,7 @@ public abstract class PlotArea { PlotId max = getMax(); if (TYPE == 2) { center = new PlotId(MathMan.average(min.x, max.x), MathMan.average(min.y, max.y)); - plots = Math.max(max.x - min.x, max.y - min.y) + 1; + plots = Math.max(max.x - min.x + 1, max.y - min.y + 1) + 1; if (start != null) { start = new PlotId(start.x - center.x, start.y - center.y); } @@ -717,7 +717,7 @@ public abstract class PlotArea { PlotId currentId = new PlotId(center.x + start.x, center.y + start.y); Plot plot = getPlotAbs(currentId); if (plot != null && plot.canClaim(player)) { - setMeta("lastPlot", currentId); + setMeta("lastPlot", start); return plot; } } From 6908b9f29b5d38fe64c2f9d4f16285298d2352ce Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Sun, 24 Nov 2019 19:30:37 +0100 Subject: [PATCH 6/8] Update bug-issue-report-for-plotsquared.md --- .github/ISSUE_TEMPLATE/bug-issue-report-for-plotsquared.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug-issue-report-for-plotsquared.md b/.github/ISSUE_TEMPLATE/bug-issue-report-for-plotsquared.md index d4a83991f..cbca7e551 100644 --- a/.github/ISSUE_TEMPLATE/bug-issue-report-for-plotsquared.md +++ b/.github/ISSUE_TEMPLATE/bug-issue-report-for-plotsquared.md @@ -79,7 +79,9 @@ paste here, between the tick marks, replacing this text ### Relevant console output, log lines, and/or screenshots: - + ### Additional relevant comments/remarks: From a65d546f3b6c53d782f632b41eacd265a7086f92 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 25 Nov 2019 22:38:03 +0000 Subject: [PATCH 7/8] Fix debugpaste split --- .../plotsquared/bukkit/BukkitMain.java | 10 ++++++---- .../intellectualsites/plotsquared/plot/IPlotMain.java | 3 ++- .../plotsquared/plot/commands/DebugPaste.java | 3 ++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java index 8474d5c8a..00c7fccf9 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/BukkitMain.java @@ -92,10 +92,12 @@ import org.jetbrains.annotations.Nullable; import java.io.File; import java.lang.reflect.Method; +import java.util.AbstractMap; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; +import java.util.Map; import java.util.UUID; import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils.getRefClass; @@ -818,11 +820,11 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain return new BukkitPlotGenerator(generator); } - @Override public List getPluginIds() { - final List names = new ArrayList<>(); + @Override public List, Boolean>> getPluginIds() { + List, Boolean>> names = new ArrayList<>(); for (final Plugin plugin : Bukkit.getPluginManager().getPlugins()) { - names.add(plugin.getName() + ';' + plugin.getDescription().getVersion() + ':' + plugin - .isEnabled()); + Map.Entry id = new AbstractMap.SimpleEntry<>(plugin.getName(), plugin.getDescription().getVersion()); + names.add(new AbstractMap.SimpleEntry<>(id, plugin.isEnabled())); } return names; } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java index bf4bf888a..48f87a96e 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/IPlotMain.java @@ -21,6 +21,7 @@ import org.jetbrains.annotations.NotNull; import java.io.File; import java.util.List; +import java.util.Map; public interface IPlotMain extends ILogger { @@ -244,7 +245,7 @@ public interface IPlotMain extends ILogger { */ @NotNull IndependentPlotGenerator getDefaultGenerator(); - List getPluginIds(); + List, Boolean>> getPluginIds(); Actor getConsole(); } diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java index 9ea6d7bdd..436b25c38 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java @@ -21,6 +21,7 @@ import java.lang.management.ManagementFactory; import java.lang.management.RuntimeMXBean; import java.nio.file.Files; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; @CommandDeclaration(command = "debugpaste", aliases = "dp", usage = "/plot debugpaste", @@ -54,7 +55,7 @@ public class DebugPaste extends SubCommand { b.append("online_mode: ").append(UUIDHandler.getUUIDWrapper()).append(';') .append(!Settings.UUID.OFFLINE).append('\n'); b.append("Plugins:"); - for (String id : PlotSquared.get().IMP.getPluginIds()) { + for (Map.Entry, Boolean> pluginInfo : PlotSquared.get().IMP.getPluginIds()) { String[] split = id.split(":"); String[] split2 = split[0].split(";"); String enabled = split.length == 2 ? split[1] : "unknown"; From cf558d8f6283d050e5ebec8219ae4e8fa9e4afb7 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 25 Nov 2019 22:40:50 +0000 Subject: [PATCH 8/8] Update DebugPaste.java --- .../plotsquared/plot/commands/DebugPaste.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java index 436b25c38..7cfc62c69 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/DebugPaste.java @@ -56,11 +56,10 @@ public class DebugPaste extends SubCommand { .append(!Settings.UUID.OFFLINE).append('\n'); b.append("Plugins:"); for (Map.Entry, Boolean> pluginInfo : PlotSquared.get().IMP.getPluginIds()) { - String[] split = id.split(":"); - String[] split2 = split[0].split(";"); - String enabled = split.length == 2 ? split[1] : "unknown"; - String name = split2[0]; - String version = split2.length == 2 ? split2[1] : "unknown"; + Map.Entry nameVersion = pluginInfo.getKey(); + String name = nameVersion.getKey(); + String version = nameVersion.getValue(); + boolean enabled = pluginInfo.getValue(); b.append("\n ").append(name).append(":\n ").append("version: '") .append(version).append('\'').append("\n enabled: ").append(enabled); }