Patch signs not empty in 1.9-1.9.2

This commit is contained in:
Matsv 2017-06-13 13:40:28 +02:00
parent 9ed4a15b32
commit dfe8c90da4
No known key found for this signature in database
GPG Key ID: 97CEC2A2EA31350F

View File

@ -229,6 +229,16 @@ public class BlockItemPackets extends BlockItemRewriter<Protocol1_10To1_11> {
Chunk1_9_3_4 chunk = (Chunk1_9_3_4) wrapper.passthrough(type);
handleChunk(chunk);
// only patch it for signs for now, TODO-> Find all the block entities old/new to replace ids and implement in ViaVersion
chunk.getBlockEntities().stream()
.filter(tag -> tag.contains("id") && tag.get("id") instanceof StringTag)
.forEach(tag -> {
String id = (String) tag.get("id").getValue();
if (id.equals("minecraft:sign")) {
((StringTag) tag.get("id")).setValue("Sign");
}
});
}
});
}