Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-24 18:10:08 +01:00
Fixed incorrect schematic handling code being used when AddBlocks is present. The old code did not properly handle the signed nature of the byte, nor did it properly shift and add the extra 4 bits in AddBlocks.
Dieser Commit ist enthalten in:
Ursprung
18c793683b
Commit
6be8c8b55c
@ -115,9 +115,9 @@ public class MCEditSchematicFormat extends SchematicFormat {
|
|||||||
if (schematic.containsKey("AddBlocks")) {
|
if (schematic.containsKey("AddBlocks")) {
|
||||||
byte[] addBlockIds = getChildTag(schematic, "AddBlocks", ByteArrayTag.class).getValue();
|
byte[] addBlockIds = getChildTag(schematic, "AddBlocks", ByteArrayTag.class).getValue();
|
||||||
for (int i = 0, index = 0; i < addBlockIds.length && index < blocks.length; ++i) {
|
for (int i = 0, index = 0; i < addBlockIds.length && index < blocks.length; ++i) {
|
||||||
blocks[index] = (short) (addBlockIds[i] & 0xF << 8 + rawBlocks[index++]);
|
blocks[index] = (short) (((addBlockIds[i] >> 4) << 8) + (rawBlocks[index++] & 0xFF));
|
||||||
if (index < blocks.length) {
|
if (index < blocks.length) {
|
||||||
blocks[index] = (short) (((addBlockIds[i] << 4) & 0xF) << 8 + rawBlocks[index++]);
|
blocks[index] = (short) (((addBlockIds[i] & 0xF) << 8) + (rawBlocks[index++] & 0xFF));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren