diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/BukkitMain.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/BukkitMain.java index 7a3c059c5..b723c9475 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/BukkitMain.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/BukkitMain.java @@ -4,7 +4,9 @@ import java.io.File; import java.util.Arrays; import java.util.HashMap; import java.util.List; +import java.util.UUID; +import com.intellectualcrafters.plot.object.BukkitPlayer; import net.milkbowl.vault.economy.Economy; import org.bukkit.Bukkit; @@ -219,6 +221,14 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain { return this.getDescription().getVersion(); } + @Override + public void handleKick(UUID uuid, C c) { + Player player = Bukkit.getPlayer(uuid); + if (player != null && player.isOnline()) { + MainUtil.sendMessage(BukkitUtil.getPlayer(player), c); + } + } + @Override public void registerCommands() { new MainCommand(); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/IPlotMain.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/IPlotMain.java index 20401bbc6..a6f8ba4ef 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/IPlotMain.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/IPlotMain.java @@ -1,7 +1,9 @@ package com.intellectualcrafters.plot; import java.io.File; +import java.util.UUID; +import com.intellectualcrafters.plot.config.C; import net.milkbowl.vault.economy.Economy; import org.bukkit.generator.ChunkGenerator; @@ -26,6 +28,8 @@ public interface IPlotMain { public String getVersion(); + public void handleKick(UUID uuid, C c); + public TaskManager getTaskManager(); public void runEntityTask(); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Deny.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Deny.java index 8bdea4d5d..b7e04cc53 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Deny.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Deny.java @@ -22,6 +22,7 @@ package com.intellectualcrafters.plot.commands; import java.util.UUID; +import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.object.Location; @@ -87,6 +88,9 @@ public class Deny extends SubCommand { return false; } MainUtil.sendMessage(plr, C.DENIED_ADDED); + if (!uuid.equals(DBFunc.everyone)) { + PlotSquared.IMP.handleKick(uuid, C.YOU_GOT_DENIED); + } return true; } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java index 0a0e3e706..7528b3172 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java @@ -409,6 +409,7 @@ public enum C { DENIED_ADDED("$4You successfully denied the player from this plot", "Deny"), DENIED_NEED_ARGUMENT("$2Arguments are missing. $1/plot denied add $2or $1/plot denied remove ", "Deny"), WAS_NOT_DENIED("$2That player was not denied on this plot", "Deny"), + YOU_GOT_DENIED("$4You are denied from the plot you were previously on, and got teleported to spawn", "Deny"), /* * Rain */