This commit is contained in:
sauilitired 2015-05-29 08:07:57 +02:00
parent aa09f02413
commit 80db0136e2
4 changed files with 19 additions and 0 deletions

View File

@ -4,7 +4,9 @@ import java.io.File;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.UUID;
import com.intellectualcrafters.plot.object.BukkitPlayer;
import net.milkbowl.vault.economy.Economy; import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -219,6 +221,14 @@ public class BukkitMain extends JavaPlugin implements Listener, IPlotMain {
return this.getDescription().getVersion(); 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 @Override
public void registerCommands() { public void registerCommands() {
new MainCommand(); new MainCommand();

View File

@ -1,7 +1,9 @@
package com.intellectualcrafters.plot; package com.intellectualcrafters.plot;
import java.io.File; import java.io.File;
import java.util.UUID;
import com.intellectualcrafters.plot.config.C;
import net.milkbowl.vault.economy.Economy; import net.milkbowl.vault.economy.Economy;
import org.bukkit.generator.ChunkGenerator; import org.bukkit.generator.ChunkGenerator;
@ -26,6 +28,8 @@ public interface IPlotMain {
public String getVersion(); public String getVersion();
public void handleKick(UUID uuid, C c);
public TaskManager getTaskManager(); public TaskManager getTaskManager();
public void runEntityTask(); public void runEntityTask();

View File

@ -22,6 +22,7 @@ package com.intellectualcrafters.plot.commands;
import java.util.UUID; import java.util.UUID;
import com.intellectualcrafters.plot.PlotSquared;
import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.database.DBFunc;
import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Location;
@ -87,6 +88,9 @@ public class Deny extends SubCommand {
return false; return false;
} }
MainUtil.sendMessage(plr, C.DENIED_ADDED); MainUtil.sendMessage(plr, C.DENIED_ADDED);
if (!uuid.equals(DBFunc.everyone)) {
PlotSquared.IMP.handleKick(uuid, C.YOU_GOT_DENIED);
}
return true; return true;
} }
} }

View File

@ -409,6 +409,7 @@ public enum C {
DENIED_ADDED("$4You successfully denied the player from this plot", "Deny"), DENIED_ADDED("$4You successfully denied the player from this plot", "Deny"),
DENIED_NEED_ARGUMENT("$2Arguments are missing. $1/plot denied add <name> $2or $1/plot denied remove <name>", "Deny"), DENIED_NEED_ARGUMENT("$2Arguments are missing. $1/plot denied add <name> $2or $1/plot denied remove <name>", "Deny"),
WAS_NOT_DENIED("$2That player was not denied on this plot", "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 * Rain
*/ */