parent
3be98c7de6
commit
7df76b72ac
|
@ -127,7 +127,9 @@ public class ServerAPI extends JavaPlugin implements IProvider {
|
|||
public void kick(BanAPI kick) {
|
||||
Player player = Bukkit.getPlayerExact(kick.getTarget());
|
||||
if (player != null) {
|
||||
player.kickPlayer("You have been kicked: " + kick.getReason());
|
||||
getServer().getScheduler().runTask(this, () -> {
|
||||
player.kickPlayer("You have been kicked: " + kick.getReason());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -140,7 +142,9 @@ public class ServerAPI extends JavaPlugin implements IProvider {
|
|||
Bukkit.getBanList(BanList.Type.NAME).addBan(ban.getTarget(), ban.getReason(), expires, "ServerAPI");
|
||||
Player player = Bukkit.getPlayerExact(ban.getTarget());
|
||||
if (player != null) {
|
||||
player.kickPlayer("You have been banned: " + ban.getReason());
|
||||
getServer().getScheduler().runTask(this, () -> {
|
||||
player.kickPlayer("You have been banned: " + ban.getReason());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue