Skip to content

Commit

Permalink
feat: filter entities in /spawner list by permission (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
Revxrsal authored Mar 13, 2022
1 parent 4f6266d commit b284ab1
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -654,9 +654,13 @@ public String getCreatureEggName(final String entity) {
public void showAllCreatures(final CommandSender sender) {
// For each entry in the list
final StringBuilder builder = new StringBuilder();
for (String displayName : displayNameToMobID.keySet()) {
for (Entry<String, String> entityType : displayNameToMobID.entrySet()) {
String displayName = entityType.getKey();
String entityId = entityType.getValue();
displayName = displayName.replace(" ", "");
builder.append(displayName + ", ");
if (hasPermission(sender, "silkspawners.changetype.", entityId)) {
builder.append(displayName + ", ");
}
}
// Strip last comma out
String message = builder.toString();
Expand Down

0 comments on commit b284ab1

Please sign in to comment.