mojira.dev
MC-303381

Game crashes when serializing a world spawn point with yaw or pitch values outside of rotation bounds

Steps to reproduce the issue

  1. Open a world

  2. Use /setworldspawn ~ ~ ~ 181 91

  3. The game crashes the next time the game saves

Expected result

The yaw and pitch get clamped into their respective bounds. Alternatively, the command fails with a message along the lines of “The provided yaw must be between -180 and 180!”.

Actual result

The game crashes with this exception (line numbers taken from crash report):

[01:02:17] [Server thread/INFO]: Saving and pausing game...
[01:02:17] [Server thread/INFO]: Saving chunks for level 'ServerLevel[New World]'/minecraft:overworld
[01:02:17] [Server thread/INFO]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_end
[01:02:17] [Server thread/INFO]: Saving chunks for level 'ServerLevel[New World]'/minecraft:the_nether
[01:02:17] [Server thread/ERROR]: Encountered an unexpected exception
java.lang.IllegalStateException: Value 91.0 outside of range [-90.0:90.0]; Value 181.0 outside of range [-180.0:180.0]
	at com.mojang.serialization.DataResult$Error.getOrThrow(DataResult.java:287)
	at com.mojang.serialization.DataResult.getOrThrow(DataResult.java:81)
	at ve.a(SourceFile:592)
	at ve.a(SourceFile:582)
	at flg.a(SourceFile:258)
	at flg.a(SourceFile:230)
	at flc$c.a(SourceFile:452)
	at net.minecraft.server.MinecraftServer.a(SourceFile:643)
	at net.minecraft.server.MinecraftServer.b(SourceFile:660)
	at ikj.b(SourceFile:339)
	at ikj.a(SourceFile:110)
	at net.minecraft.server.MinecraftServer.A(SourceFile:784)
	at net.minecraft.server.MinecraftServer.a(SourceFile:306)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Linked issues

Attachments

Comments 0

No comments.

T Niklas

bl4ckscor3

Confirmed

Crash

1.21.10, 25w42a

Retrieved