mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Added a debug command to diagnose the issues in #2411
This commit is contained in:
parent
8ab10de4ad
commit
ad7bcd19d4
@ -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.MainUtil;
|
||||||
import com.github.intellectualsites.plotsquared.plot.util.StringMan;
|
import com.github.intellectualsites.plotsquared.plot.util.StringMan;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@CommandDeclaration(command = "debug", category = CommandCategory.DEBUG,
|
@CommandDeclaration(command = "debug", category = CommandCategory.DEBUG,
|
||||||
description = "Show debug information", usage = "/plot debug [msg]", permission = "plots.admin")
|
description = "Show debug information", usage = "/plot debug [msg]", permission = "plots.admin")
|
||||||
public class Debug extends SubCommand {
|
public class Debug extends SubCommand {
|
||||||
|
|
||||||
@Override public boolean onCommand(PlotPlayer player, String[] args) {
|
@Override public boolean onCommand(PlotPlayer player, String[] args) {
|
||||||
|
if ((args.length > 0) && "player".equalsIgnoreCase(args[1])) {
|
||||||
|
for (Map.Entry<String, Object> meta : player.getMeta().entrySet()) {
|
||||||
|
MainUtil.sendMessage(player,
|
||||||
|
"Key: " + meta.getKey() + " Value: " + meta.getValue().toString() + " , ");
|
||||||
|
}
|
||||||
|
;
|
||||||
|
}
|
||||||
if ((args.length > 0) && args[0].equalsIgnoreCase("msg")) {
|
if ((args.length > 0) && args[0].equalsIgnoreCase("msg")) {
|
||||||
StringBuilder msg = new StringBuilder();
|
StringBuilder msg = new StringBuilder();
|
||||||
for (Captions caption : Captions.values()) {
|
for (Captions caption : Captions.values()) {
|
||||||
|
@ -118,6 +118,9 @@ public abstract class PlotPlayer implements CommandCaller, OfflinePlotPlayer {
|
|||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ConcurrentHashMap<String, Object> getMeta() {
|
||||||
|
return meta;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Delete the metadata for a key.
|
* Delete the metadata for a key.
|
||||||
* - metadata is session only
|
* - metadata is session only
|
||||||
|
Loading…
Reference in New Issue
Block a user