From 6ec1d2fd67bdff63941970b0f7ba5d87e57f34de Mon Sep 17 00:00:00 2001 From: Ryan Fox Date: Fri, 29 May 2020 15:51:31 +0000 Subject: [PATCH] Stop using JSONArray getFloat method The new one seems to try casting the object to a float, causing it to crash when users join the game. That is obviously bad, so let's not do it. --- src/main/java/party/_2a03/mc/server/PlayerPosition.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/party/_2a03/mc/server/PlayerPosition.java b/src/main/java/party/_2a03/mc/server/PlayerPosition.java index 1a6adaf..8dee98d 100644 --- a/src/main/java/party/_2a03/mc/server/PlayerPosition.java +++ b/src/main/java/party/_2a03/mc/server/PlayerPosition.java @@ -21,8 +21,8 @@ public class PlayerPosition { this.x = data.getDouble(0); this.y = data.getDouble(1); this.z = data.getDouble(2); - this.yaw = data.getFloat(3); - this.pitch = data.getFloat(4); + this.yaw = data.getNumber(3).floatValue(); + this.pitch = data.getNumber(4).floatValue(); this.dimensiontype = DimensionType.byRawId(dimension_id); } }