diff options
author | tylermurphy534 <tylermurphy534@gmail.com> | 2023-02-08 23:24:53 +0000 |
---|---|---|
committer | tylermurphy534 <tylermurphy534@gmail.com> | 2023-02-08 23:24:53 +0000 |
commit | b87174e7701863f54ab26998feaf4bdaa9a0df20 (patch) | |
tree | bf3cec7f3d0be7aa6bc26fc647a06527dfe49235 /src/main/java/net/tylermurphy/hideAndSeek/util/Location.java | |
parent | Merge pull request '1.7.0 - Multi Map Support' (#4) from dev into main (diff) | |
parent | update dependicies, fix worldborder, fix timer when player leaves, fix drop i... (diff) | |
download | kenshinshideandseek-b87174e7701863f54ab26998feaf4bdaa9a0df20.tar.gz kenshinshideandseek-b87174e7701863f54ab26998feaf4bdaa9a0df20.tar.bz2 kenshinshideandseek-b87174e7701863f54ab26998feaf4bdaa9a0df20.zip |
Merge pull request '1.7.1 - A few tweaks and bug squashes' (#5) from dev into main
Reviewed-on: https://g.tylerm.dev/tylermurphy534/KenshinsHideAndSeek/pulls/5
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/util/Location.java')
-rw-r--r-- | src/main/java/net/tylermurphy/hideAndSeek/util/Location.java | 10 |
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; } } |