Skip to content
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

Merged
merged 2 commits into from
Apr 25, 2021

Conversation

repo-alt
Copy link
Contributor

No description provided.

@repo-alt repo-alt requested a review from mitchej123 April 23, 2021 22:28
@Dream-Master Dream-Master merged commit 3731701 into GTNewHorizons:master Apr 25, 2021
Copy link
Contributor

@Glease Glease left a 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))
Copy link
Contributor

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.

Copy link
Contributor Author

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)"));
Copy link
Contributor

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()))
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getAllUsernames literally calls serverConfigurationManager

@Dream-Master
Copy link
Member

oh i was to fast ?

@Glease
Copy link
Contributor

Glease commented Apr 25, 2021

nothing game breaking. could be in another PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants