Update kick from claim and send players to spawn.
This prevents players from building traps at the locations.
This commit is contained in:
parent
5c345f697b
commit
034124341c
|
|
@ -2501,13 +2501,13 @@ public class GriefPrevention extends JavaPlugin
|
|||
return true;
|
||||
}
|
||||
zone.testForSafeSpot();
|
||||
Location safe = zone.getSafeArea();
|
||||
Location safe = Bukkit.getWorlds().get(0).getSpawnLocation();
|
||||
if (safe == null) {
|
||||
player.sendMiniMessage(Config.NoSafeLocation, null); // todo placeholders.
|
||||
} else {
|
||||
if (target.isInsideVehicle()) target.leaveVehicle();
|
||||
target.teleport(safe);
|
||||
Bukkit.getPluginManager().callEvent(new PlayerTeleportEvent(target, safe, safe));
|
||||
target.teleport(player);
|
||||
Bukkit.getPluginManager().callEvent(new PlayerTeleportEvent(target, safe, zone.getSafeArea()));
|
||||
player.sendMiniMessage(Config.KickSuccess, placeholders); // todo placeholders.
|
||||
target.sendMiniMessage(Config.KickedFromClaim, placeholders); // todo placeholders.
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user