Added option to kill player instead of teleporting to spawn.

This commit is contained in:
Rourke750 2013-08-11 13:09:21 -04:00 committed by erocs
parent 6c2d705769
commit f7989ad638
2 changed files with 12 additions and 2 deletions

View File

@ -131,7 +131,12 @@ public class BorderCheckTask implements Runnable
if (newLoc == null) if (newLoc == null)
{ {
if (Config.Debug()) if (Config.Debug())
Config.LogWarn("Target new location unviable, using spawn."); Config.LogWarn("Target new location unviable, using spawn or killing player.");
if (Config.getIfPlayerKill())
{
player.setHealth(0.0D);
return null;
}
newLoc = player.getWorld().getSpawnLocation(); newLoc = player.getWorld().getSpawnLocation();
} }

View File

@ -45,6 +45,7 @@ public class Config
private static boolean dynmapEnable = true; private static boolean dynmapEnable = true;
private static String dynmapMessage; private static String dynmapMessage;
private static int remountDelayTicks = 0; private static int remountDelayTicks = 0;
private static boolean killPlayer = false;
// for monitoring plugin efficiency // for monitoring plugin efficiency
// public static long timeUsed = 0; // public static long timeUsed = 0;
@ -216,7 +217,9 @@ public class Config
{ {
return whooshEffect; return whooshEffect;
} }
public static boolean getIfPlayerKill(){
return killPlayer;
}
public static void showWhooshEffect(Location loc) public static void showWhooshEffect(Location loc)
{ {
if (!whooshEffect()) if (!whooshEffect())
@ -459,6 +462,7 @@ public class Config
dynmapEnable = cfg.getBoolean("dynmap-border-enabled", true); dynmapEnable = cfg.getBoolean("dynmap-border-enabled", true);
dynmapMessage = cfg.getString("dynmap-border-message", "The border of the world."); dynmapMessage = cfg.getString("dynmap-border-message", "The border of the world.");
LogConfig("Using " + (ShapeName()) + " border, knockback of " + knockBack + " blocks, and timer delay of " + timerTicks + "."); LogConfig("Using " + (ShapeName()) + " border, knockback of " + knockBack + " blocks, and timer delay of " + timerTicks + ".");
killPlayer = cfg.getBoolean("player-killed-bad-spawn", false);
StartBorderTimer(); StartBorderTimer();
@ -543,6 +547,7 @@ public class Config
cfg.set("remount-delay-ticks", remountDelayTicks); cfg.set("remount-delay-ticks", remountDelayTicks);
cfg.set("dynmap-border-enabled", dynmapEnable); cfg.set("dynmap-border-enabled", dynmapEnable);
cfg.set("dynmap-border-message", dynmapMessage); cfg.set("dynmap-border-message", dynmapMessage);
cfg.set("player-killed-bad-spawn", killPlayer);
cfg.set("worlds", null); cfg.set("worlds", null);
Iterator world = borders.entrySet().iterator(); Iterator world = borders.entrySet().iterator();