diff --git a/.github/ISSUE_TEMPLATE/bug-issue-report-for-plotsquared.md b/.github/ISSUE_TEMPLATE/bug-issue-report-for-plotsquared.md index aa5349430..cbca7e551 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: @@ -76,7 +79,9 @@ assignees: '' ### Relevant console output, log lines, and/or screenshots: - + ### Additional relevant comments/remarks: 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/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())); } /** 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..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 @@ -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,12 +55,11 @@ 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()) { - 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"; + for (Map.Entry, Boolean> pluginInfo : PlotSquared.get().IMP.getPluginIds()) { + 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); } 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); } 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; 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; } }