Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
Etzelia | f2a6249af1 |
|
@ -127,7 +127,9 @@ public class ServerAPI extends JavaPlugin implements IProvider {
|
||||||
public void kick(BanAPI kick) {
|
public void kick(BanAPI kick) {
|
||||||
Player player = Bukkit.getPlayerExact(kick.getTarget());
|
Player player = Bukkit.getPlayerExact(kick.getTarget());
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
|
getServer().getScheduler().runTask(this, () -> {
|
||||||
player.kickPlayer("You have been kicked: " + kick.getReason());
|
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");
|
Bukkit.getBanList(BanList.Type.NAME).addBan(ban.getTarget(), ban.getReason(), expires, "ServerAPI");
|
||||||
Player player = Bukkit.getPlayerExact(ban.getTarget());
|
Player player = Bukkit.getPlayerExact(ban.getTarget());
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
|
getServer().getScheduler().runTask(this, () -> {
|
||||||
player.kickPlayer("You have been banned: " + ban.getReason());
|
player.kickPlayer("You have been banned: " + ban.getReason());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue