mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-09-07 01:08:40 +02:00
Only TP player to spawn, if he's in the actual plot...
This commit is contained in:
parent
154e002dee
commit
ee88e765e9
@ -31,7 +31,10 @@ import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||
import com.intellectualcrafters.plot.util.EventUtil;
|
||||
import com.intellectualcrafters.plot.util.MainUtil;
|
||||
import com.intellectualcrafters.plot.util.Permissions;
|
||||
import com.intellectualcrafters.plot.util.bukkit.BukkitUtil;
|
||||
import com.intellectualcrafters.plot.util.bukkit.UUIDHandler;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Deny extends SubCommand {
|
||||
public Deny() {
|
||||
@ -81,9 +84,25 @@ public class Deny extends SubCommand {
|
||||
plot.addDenied(uuid);
|
||||
EventUtil.manager.callDenied(plr, plot, uuid, true);
|
||||
MainUtil.sendMessage(plr, C.DENIED_ADDED);
|
||||
// if (!uuid.equals(DBFunc.everyone)) {
|
||||
// PS.get().IMP.handleKick(uuid, C.YOU_GOT_DENIED);
|
||||
//}
|
||||
if (!uuid.equals(DBFunc.everyone)) {
|
||||
PS.get().IMP.handleKick(uuid, C.YOU_GOT_DENIED);
|
||||
handleKick(uuid, plot);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void handleKick(final UUID uuid, final Plot plot) {
|
||||
Player p = Bukkit.getPlayer(uuid);
|
||||
if (p != null && p.isOnline()) {
|
||||
if (PS.get().isPlotWorld(p.getWorld().getName())) {
|
||||
Plot pl = MainUtil.getPlot(BukkitUtil.getLocation(p));
|
||||
if (pl != null && pl.equals(plot)) {
|
||||
p.teleport(p.getWorld().getSpawnLocation());
|
||||
MainUtil.sendMessage(BukkitUtil.getPlayer(p), C.YOU_GOT_DENIED);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user