Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/main/java/ch/njol/skript/structures/StructAutoReload.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,12 @@ public static final class AutoReload implements ScriptData {

// private constructor to prevent instantiation.
private AutoReload(long lastReload, @Nullable String permission, @Nullable String... recipients) {
if (recipients != null)
this.recipients.addAll(Lists.newArrayList(recipients));
if (recipients != null) {
for (String recipient : recipients) {
if (recipient != null)
this.recipients.add(recipient.toLowerCase(Locale.ENGLISH));
}
}

this.permission = permission;
this.lastReload = lastReload;
Expand All @@ -208,7 +212,7 @@ private AutoReload(long lastReload, @Nullable String permission, @Nullable Strin
List<CommandSender> senders = Lists.newArrayList(Bukkit.getConsoleSender());
if (!recipients.isEmpty()) {
Bukkit.getOnlinePlayers().stream()
.filter(p -> recipients.contains(p.getName()) || recipients.contains(p.getUniqueId().toString()))
.filter(p -> recipients.contains(p.getName().toLowerCase(Locale.ENGLISH)) || recipients.contains(p.getUniqueId().toString()))
.forEach(senders::add);
return Collections.unmodifiableList(senders);
}
Expand Down