From f7989ad638467e85f2b55312b9f2d6116fcdaaa9 Mon Sep 17 00:00:00 2001 From: Rourke750 Date: Sun, 11 Aug 2013 13:09:21 -0400 Subject: [PATCH] Added option to kill player instead of teleporting to spawn. --- src/main/java/com/wimbli/WorldBorder/BorderCheckTask.java | 7 ++++++- src/main/java/com/wimbli/WorldBorder/Config.java | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/wimbli/WorldBorder/BorderCheckTask.java b/src/main/java/com/wimbli/WorldBorder/BorderCheckTask.java index 681cd80..38dbd10 100644 --- a/src/main/java/com/wimbli/WorldBorder/BorderCheckTask.java +++ b/src/main/java/com/wimbli/WorldBorder/BorderCheckTask.java @@ -131,7 +131,12 @@ public class BorderCheckTask implements Runnable if (newLoc == null) { 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(); } diff --git a/src/main/java/com/wimbli/WorldBorder/Config.java b/src/main/java/com/wimbli/WorldBorder/Config.java index 93a3cc6..33a495e 100644 --- a/src/main/java/com/wimbli/WorldBorder/Config.java +++ b/src/main/java/com/wimbli/WorldBorder/Config.java @@ -45,6 +45,7 @@ public class Config private static boolean dynmapEnable = true; private static String dynmapMessage; private static int remountDelayTicks = 0; + private static boolean killPlayer = false; // for monitoring plugin efficiency // public static long timeUsed = 0; @@ -216,7 +217,9 @@ public class Config { return whooshEffect; } - + public static boolean getIfPlayerKill(){ + return killPlayer; + } public static void showWhooshEffect(Location loc) { if (!whooshEffect()) @@ -459,6 +462,7 @@ public class Config dynmapEnable = cfg.getBoolean("dynmap-border-enabled", true); dynmapMessage = cfg.getString("dynmap-border-message", "The border of the world."); LogConfig("Using " + (ShapeName()) + " border, knockback of " + knockBack + " blocks, and timer delay of " + timerTicks + "."); + killPlayer = cfg.getBoolean("player-killed-bad-spawn", false); StartBorderTimer(); @@ -543,6 +547,7 @@ public class Config cfg.set("remount-delay-ticks", remountDelayTicks); cfg.set("dynmap-border-enabled", dynmapEnable); cfg.set("dynmap-border-message", dynmapMessage); + cfg.set("player-killed-bad-spawn", killPlayer); cfg.set("worlds", null); Iterator world = borders.entrySet().iterator();