Actually execute a kick from server if ordered
This commit is contained in:
NotMyFault 2021-05-20 21:59:05 +02:00
parent c8406681d7
commit cc48f273c0
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
2 changed files with 6 additions and 2 deletions

View File

@ -180,7 +180,9 @@ public class Deny extends SubCommand {
Location newSpawn = this.worldUtil.getSpawn(this.plotAreaManager.getAllWorlds()[0]);
if (plot.equals(newSpawn.getPlot())) {
// Kick from server if you can't be teleported to spawn
player.sendMessage(TranslatableCaption.of("deny.you_got_denied"));
// Use string based message here for legacy uses
player.kick("You got kicked from the plot! This server did not set up a loaded spawn, so you got " +
"kicked from the server.");
} else {
player.teleport(newSpawn);
}

View File

@ -138,7 +138,9 @@ public class Kick extends SubCommand {
Location newSpawn = this.worldUtil.getSpawn(this.plotAreaManager.getAllWorlds()[0]);
if (plot.equals(newSpawn.getPlot())) {
// Kick from server if you can't be teleported to spawn
player2.sendMessage(TranslatableCaption.of("kick.you_got_kicked"));
// Use string based message here for legacy uses
player2.kick("You got kicked from the plot! This server did not set up a loaded spawn, so you got " +
"kicked from the server.");
} else {
player2.plotkick(newSpawn);
}