Skip to content

Commit

Permalink
Don't show default access in access list string
Browse files Browse the repository at this point in the history
  • Loading branch information
pop4959 committed Feb 11, 2024
1 parent be63211 commit cca2389
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bukkit/src/main/java/org/popcraft/bolt/util/Protections.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.plugin.java.JavaPlugin;
import org.popcraft.bolt.BoltPlugin;
import org.popcraft.bolt.lang.Strings;
import org.popcraft.bolt.lang.Translation;
import org.popcraft.bolt.protection.BlockProtection;
Expand Down Expand Up @@ -159,7 +161,12 @@ public static String accessList(final Map<String, String> accessMap) {
} else {
subject = source.getIdentifier();
}
lines.add(" * %s (%s: %s)".formatted(subject, Strings.toTitleCase(source.getType()), Strings.toTitleCase(access)));
final BoltPlugin plugin = JavaPlugin.getPlugin(BoltPlugin.class);
if (plugin.getDefaultAccessType().equals(access)) {
lines.add(" * %s (%s)".formatted(subject, Strings.toTitleCase(source.getType())));
} else {
lines.add(" * %s (%s: %s)".formatted(subject, Strings.toTitleCase(source.getType()), Strings.toTitleCase(access)));
}
});
return String.join("\n", lines);
}
Expand Down

0 comments on commit cca2389

Please sign in to comment.