mirror of
https://github.com/Brettflan/WorldBorder.git
synced 2024-11-22 18:16:24 +01:00
Merge pull request #25 from erocs/master
Added option to kill player instead of teleporting to spawn.
This commit is contained in:
commit
119640ecc6
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user