mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-13 01:16:46 -04:00
bug fixes (uuid reading, play info, TextComponent null)
This commit is contained in:
parent
4a561d6a01
commit
2d529dfce7
@ -24,6 +24,10 @@ public class TextComponent {
|
|||||||
JSONObject json;
|
JSONObject json;
|
||||||
|
|
||||||
public TextComponent(String raw) {
|
public TextComponent(String raw) {
|
||||||
|
if (raw == null) {
|
||||||
|
this.json = new JSONObject();
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
this.json = new JSONObject(raw);
|
this.json = new JSONObject(raw);
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
|
@ -88,7 +88,7 @@ public class PacketPlayerInfo implements ClientboundPacket {
|
|||||||
if (property.isLegacy()) {
|
if (property.isLegacy()) {
|
||||||
Log.game(String.format("[TAB] Player info bulk (uuid=%s, name=%s, ping=%d)", property.getUUID(), property.getName(), property.getPing()));
|
Log.game(String.format("[TAB] Player info bulk (uuid=%s, name=%s, ping=%d)", property.getUUID(), property.getName(), property.getPing()));
|
||||||
} else {
|
} else {
|
||||||
Log.game(String.format("[TAB] Player info bulk (uuid=%s, action=%s, name=%s, gameMode=%s, ping=%d)", property.getUUID(), property.getAction(), property.getName(), ((property.getGameMode() == null) ? "null" : property.getGameMode().name()), property.getPing()));
|
Log.game(String.format("[TAB] Player info bulk (uuid=%s, action=%s, name=%s, gameMode=%s, ping=%d, displayName=%s)", property.getUUID(), property.getAction(), property.getName(), ((property.getGameMode() == null) ? "null" : property.getGameMode().name()), property.getPing(), ((property.getDisplayName() == null) ? "null" : property.getDisplayName().getColoredMessage())));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,9 +121,7 @@ public class InByteBuffer {
|
|||||||
|
|
||||||
|
|
||||||
public UUID readUUID() {
|
public UUID readUUID() {
|
||||||
ByteBuffer buffer = ByteBuffer.allocate(16); // UUID.BYTES
|
return new UUID(readLong(), readLong());
|
||||||
buffer.put(readBytes(16));
|
|
||||||
return new UUID(buffer.getLong(0), buffer.getLong(1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int readVarInt() {
|
public int readVarInt() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user