Skip to content

Commit 4c378a4

Browse files
committed
run commands on main thread
1 parent a376e58 commit 4c378a4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/main/java/pro/cloudnode/smp/smpcore/Configuration.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,12 @@ public void staffCommands(final boolean addMode, final @NotNull OfflinePlayer pl
120120

121121
final List<String> commands = config.getStringList("staff.commands." + (addMode ? "add" : "remove"));
122122

123-
for (final String command : commands)
124-
Bukkit.dispatchCommand(
125-
Bukkit.getConsoleSender(),
126-
command.replace("<player>", name)
127-
);
123+
SMPCore.runMain(() -> {
124+
for (final String command : commands)
125+
Bukkit.dispatchCommand(
126+
Bukkit.getConsoleSender(),
127+
command.replace("<player>", name)
128+
);
129+
});
128130
}
129131
}

0 commit comments

Comments
 (0)