mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-01-19 16:59:36 +01:00
Fixes #321
This commit is contained in:
parent
aa09f02413
commit
80db0136e2
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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 <name> $2or $1/plot denied remove <name>", "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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user