Skip to content

Commit

Permalink
Register type key lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
pop4959 committed Sep 2, 2024
1 parent f0f957a commit 251106e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bukkit/src/main/java/org/popcraft/bolt/BoltPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ private void registerAccessTypes() {
bolt.getAccessRegistry().unregisterAll();
final ConfigurationSection protections = getConfig().getConfigurationSection("protections");
if (protections != null) {
for (final String type : protections.getKeys(false)) {
for (final String typeKey : protections.getKeys(false)) {
final String type = typeKey.toLowerCase();
final boolean requirePermission = protections.getBoolean("%s.require-permission".formatted(type), false);
final List<String> allows = protections.getStringList("%s.allows".formatted(type));
final List<String> permissions = allows.isEmpty() ? protections.getStringList(type) : allows;
Expand All @@ -310,7 +311,8 @@ private void registerAccessTypes() {
}
final ConfigurationSection access = getConfig().getConfigurationSection("access");
if (access != null) {
for (final String type : access.getKeys(false)) {
for (final String typeKey : access.getKeys(false)) {
final String type = typeKey.toLowerCase();
final boolean requirePermission = access.getBoolean("%s.require-permission".formatted(type), false);
final List<String> allows = access.getStringList("%s.allows".formatted(type));
final List<String> permissions = allows.isEmpty() ? access.getStringList(type) : allows;
Expand Down

0 comments on commit 251106e

Please sign in to comment.