From ad7bcd19d41c4b2caa26f767a5b36f060661f756 Mon Sep 17 00:00:00 2001 From: MattBDev <4009945+MattBDev@users.noreply.github.com> Date: Mon, 12 Aug 2019 13:40:22 -0400 Subject: [PATCH] Added a debug command to diagnose the issues in #2411 --- .../plotsquared/plot/commands/Debug.java | 9 +++++++++ .../plotsquared/plot/object/PlotPlayer.java | 3 +++ 2 files changed, 12 insertions(+) diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Debug.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Debug.java index fdc44e5c7..c1970f969 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Debug.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Debug.java @@ -7,11 +7,20 @@ import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; import com.github.intellectualsites.plotsquared.plot.util.MainUtil; import com.github.intellectualsites.plotsquared.plot.util.StringMan; +import java.util.Map; + @CommandDeclaration(command = "debug", category = CommandCategory.DEBUG, description = "Show debug information", usage = "/plot debug [msg]", permission = "plots.admin") public class Debug extends SubCommand { @Override public boolean onCommand(PlotPlayer player, String[] args) { + if ((args.length > 0) && "player".equalsIgnoreCase(args[1])) { + for (Map.Entry meta : player.getMeta().entrySet()) { + MainUtil.sendMessage(player, + "Key: " + meta.getKey() + " Value: " + meta.getValue().toString() + " , "); + } + ; + } if ((args.length > 0) && args[0].equalsIgnoreCase("msg")) { StringBuilder msg = new StringBuilder(); for (Captions caption : Captions.values()) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java index 09bc364f1..8981b2923 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/PlotPlayer.java @@ -118,6 +118,9 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer { return meta; } + public ConcurrentHashMap getMeta() { + return meta; + } /** * Delete the metadata for a key. * - metadata is session only