mirror of
https://github.com/PryPurity/WorldBorder.git
synced 2024-09-26 03:42:36 +02: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 (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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user