Fix some json issues, fix problems in < 1.12.2 block mapping

This commit is contained in:
Bixilon 2020-07-25 17:58:22 +02:00
parent ec1a7b3465
commit aa64462ce2
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
4 changed files with 5 additions and 5 deletions

View File

@ -169,7 +169,7 @@ public class TextComponent {
JsonObject object;
try {
object = arr.get(i).getAsJsonObject();
} catch (JsonParseException e) {
} catch (Exception e) {
// reset text
buffer.append(ChatAttributes.RESET);
buffer.append(arr.get(i).getAsString());

View File

@ -63,7 +63,7 @@ public class PacketScoreboardObjective implements ClientboundPacket {
@Override
public void log() {
if (action == ScoreboardObjectiveAction.CREATE || action == ScoreboardObjectiveAction.UPDATE) {
Log.protocol(String.format("Received scoreboard objective action (action=%s, name=\"%s\", value=\"%s\", type=%s", action, name, value.getColoredMessage(), type.name));
Log.protocol(String.format("Received scoreboard objective action (action=%s, name=\"%s\", value=\"%s\", type=%s", action, name, value.getColoredMessage(), type));
} else {
Log.protocol(String.format("Received scoreboard objective action (action=%s, name=\"%s\")", action, name));
}

View File

@ -61,7 +61,7 @@ public class ChunkUtil {
for (int nibbleZ = 0; nibbleZ < 16; nibbleZ++) {
for (int nibbleX = 0; nibbleX < 16; nibbleX++) {
short singeBlockId = blockTypes[arrayPos];
short singeBlockId = (short) (blockTypes[arrayPos] & 0xFF);
byte singleMeta;
// get block meta and shift and add (merge) id if needed
if (arrayPos % 2 == 0) {
@ -72,7 +72,7 @@ public class ChunkUtil {
}
} else {
// low 4 bits
singleMeta = (byte) (meta[arrayPos / 2] >>> 4);
singleMeta = (byte) ((meta[arrayPos / 2] >>> 4) & 0xF);
if (BitByte.isBitSet(addBitMask, c)) {
singeBlockId = (short) ((singeBlockId << 4) | (addBlockTypes[arrayPos / 2] & 0xF));

File diff suppressed because one or more lines are too long