-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a debug command and some logging to the RC anchors reloading #17
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor problem in tab completion, but otherwise looks good.
l.add("anchordebug"); | ||
} else if (test.equals("anchor")) { | ||
String test1 = ss[1].trim(); | ||
if (test1.isEmpty() || "list".startsWith(test1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a check for situation, where admin types /hp anchor list
then press tab, expecting to see a list of usernames as completion.
FYI use getListOfStringsMatchingLastWord(as, MinecraftServer.getServer().getAllUsernames())
to quickly get a list of possible completions of username.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
private void printHelp(ICommandSender sender) { | ||
sender.addChatMessage(new ChatComponentText("Usage: hp <toggle|anchor>")); | ||
sender.addChatMessage(new ChatComponentText("\"toggle anchordebug\" - toggles RC anchor debugging")); | ||
sender.addChatMessage(new ChatComponentText("\"anchor list <player>\" - list RC anchors placed by the player (empty for current player)")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could have been "\"anchor list [player]\" - list RC anchors placed by the player (empty for current player)"
return; | ||
} | ||
String playerName = strings.length > 2 ? strings[2] : sender.getCommandSenderName(); | ||
if (!AnchorAlarm.listSavedAnchors(playerName, sender.getEntityWorld())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually use net.minecraft.server.management.ServerConfigurationManager#playerEntityList
to find out all players. Not sure if these are equivalent, just saying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getAllUsernames literally calls serverConfigurationManager
oh i was to fast ? |
nothing game breaking. could be in another PR. |
No description provided.