Skip to content

Commit 5270857

Browse files
committed
Add world border check for spawn safety
1 parent f446c94 commit 5270857

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/main/java/org/mvplugins/multiverse/core/teleportation/BlockSafety.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ public boolean canSpawnAtLocationSafely(@NotNull Location location) {
132132
*/
133133
public boolean canSpawnAtBlockSafely(@NotNull Block block) {
134134
Logging.finest("Checking spawn safety for location: %s, %s, %s", block.getX(), block.getY(), block.getZ());
135+
if (!block.getWorld().getWorldBorder().isInside(block.getLocation())) {
136+
Logging.finest("Location is outside world border.");
137+
return false;
138+
}
135139
if (isUnsafeSpawnBody(block)) {
136140
// Player body will be stuck in solid
137141
Logging.finest("Unsafe location for player's body: " + block);

0 commit comments

Comments
 (0)