summaryrefslogtreewikicommitdiff
path: root/src/main/java/net/tylermurphy/hideAndSeek/util/Location.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/util/Location.java')
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/util/Location.java10
1 files changed, 8 insertions, 2 deletions
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;
}
}