Skip to content

Commit 0f50371

Browse files
committed
Normalize yaw for set_spawn() location argument
Upon upgrading to 1.21.9+, Minecraft will fail to convert spawn data with a spawn angle not normalized from -180 to 180, and will instead set spawn data (including coordinates) to zeroes. This only affects worlds that were set with a yaw above 180 using the new location array format added to set_spawn() in August.
1 parent 81a0c3c commit 0f50371

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/laytonsmith/abstraction/bukkit/BukkitMCWorld.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,9 @@ public void setSpawnLocation(int x, int y, int z) {
511511

512512
@Override
513513
public void setSpawnLocation(MCLocation location) {
514-
w.setSpawnLocation((Location) location.getHandle());
514+
Location loc = (Location) location.getHandle();
515+
loc.setYaw(Location.normalizeYaw(loc.getYaw()));
516+
w.setSpawnLocation(loc);
515517
}
516518

517519
@Override

0 commit comments

Comments
 (0)