From a65d546f3b6c53d782f632b41eacd265a7086f92 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Mon, 25 Nov 2019 22:38:03 +0000 Subject: [PATCH] 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";