Skip to content

Commit

Permalink
Fixes #3057
Browse files Browse the repository at this point in the history
Actually execute a kick from server if ordered
  • Loading branch information
NotMyFault committed May 20, 2021
1 parent c840668 commit cc48f27
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Core/src/main/java/com/plotsquared/core/command/Deny.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ private void handleKick(PlotPlayer<?> player, Plot plot) {
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);
}
Expand Down
4 changes: 3 additions & 1 deletion Core/src/main/java/com/plotsquared/core/command/Kick.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ public boolean onCommand(PlotPlayer<?> player, String[] args) {
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);
}
Expand Down

0 comments on commit cc48f27

Please # to comment.