From 2139a8d5d30237b6066691af3f29bf1105e4298a Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Mon, 6 Feb 2023 12:15:09 -0500 Subject: spawn patch, bounds checks, drop items, regen --- src/main/java/net/tylermurphy/hideAndSeek/util/Location.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main/java/net/tylermurphy/hideAndSeek/util') diff --git a/src/main/java/net/tylermurphy/hideAndSeek/util/Location.java b/src/main/java/net/tylermurphy/hideAndSeek/util/Location.java index 606b64b..916b6f9 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/util/Location.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/util/Location.java @@ -11,6 +11,8 @@ import org.jetbrains.annotations.NotNull; import java.io.File; +import static net.tylermurphy.hideAndSeek.configuration.Config.spawnPatch; + public class Location { private final String world; @@ -87,7 +89,11 @@ public class Location { public void teleport(Player player) { if(!exists()) return; if(load() == null) return; - player.teleport(toBukkit()); + if (spawnPatch) { + Main.getInstance().scheduleTask(() -> player.teleport(toBukkit())); + } else { + player.teleport(toBukkit()); + } } public Location changeWorld(String world) { @@ -139,7 +145,7 @@ public class Location { } public boolean isNotInBounds(int xmin, int xmax, int zmin, int zmax) { - return getBlockX() < xmin || getBlockX() > xmax || getBlockZ() < zmin || getBlockZ() > zmax; + return getBlockX() <= xmin || getBlockX() >= xmax || getBlockZ() <= zmin || getBlockZ() >= zmax; } } -- cgit v1.2.3-freya