mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 10:05:12 +01:00
Fix LazilyParsedNumber conversion ViaVersion/ViaVersion#3546 (#3550)
This commit is contained in:
parent
d5326fad95
commit
d44d89099b
@ -35,6 +35,7 @@ import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
import com.google.gson.internal.LazilyParsedNumber;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.data.MappingData;
|
||||
@ -418,8 +419,10 @@ public final class Protocol1_20_3To1_20_2 extends AbstractProtocol<ClientboundPa
|
||||
return new DoubleTag(number.doubleValue());
|
||||
} else if (number instanceof Float) {
|
||||
return new FloatTag(number.floatValue());
|
||||
} else if (number instanceof LazilyParsedNumber) {
|
||||
return new IntTag(number.intValue());
|
||||
}
|
||||
return new StringTag(primitive.getAsString()); // ???
|
||||
return new IntTag(number.intValue()); // ???
|
||||
}
|
||||
throw new IllegalArgumentException("Unhandled json type " + element.getClass().getSimpleName() + " with value " + element.getAsString());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user