File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed
src/main/java/cn/dreeam/caeruleum Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change 15
15
import org .bukkit .plugin .RegisteredServiceProvider ;
16
16
import org .bukkit .plugin .java .JavaPlugin ;
17
17
18
- import java .util .Arrays ;
19
- import java .util .stream . Collectors ;
18
+ import java .util .ArrayList ;
19
+ import java .util .List ;
20
20
21
21
public class CaeruleumCore extends JavaPlugin {
22
22
@@ -73,17 +73,14 @@ private void initHooks() {
73
73
private void initTasks () {
74
74
// Clear old perms task
75
75
if (!config .oldLangPermPrefixList ().isEmpty ()) {
76
- Thread .startVirtualThread (
77
- () -> Arrays .stream (Bukkit .getServer ().getOfflinePlayers ())
78
- .filter (OfflinePlayer ::hasPlayedBefore )
79
- .collect (Collectors .toSet ())
80
- .forEach (
81
- p -> config .oldLangPermPrefixList ()
82
- .forEach (
83
- oldLangPermPrefix -> PermUtil .clearLangPerm (p .getUniqueId (), oldLangPermPrefix )
84
- )
85
- )
86
- );
76
+ Thread .startVirtualThread (() -> {
77
+ for (OfflinePlayer player : Bukkit .getServer ().getOfflinePlayers ()) {
78
+ if (player .hasPlayedBefore ()) {
79
+ config .oldLangPermPrefixList ()
80
+ .forEach (oldLangPermPrefix -> PermUtil .clearLangPerm (player .getUniqueId (), oldLangPermPrefix ));
81
+ }
82
+ }
83
+ });
87
84
}
88
85
}
89
86
You can’t perform that action at this time.
0 commit comments