Transform Minecart metadata (9) to the new block format

This commit is contained in:
Matsv 2018-03-20 16:56:32 +01:00
parent 0ada2496de
commit acb960bfdf

View File

@ -55,6 +55,15 @@ public class MetadataRewriter {
metadata.setId(metadata.getId() + 1);
}
// Handle Minecart inner block
if (type.isOrHasParent(Entity1_13Types.EntityType.MINECART_ABSTRACT) && metadata.getId() == 9) {
// New block format
int oldId = (int) metadata.getValue();
int combined = (((oldId & 4095) << 4) | (oldId >> 12 & 15));
int newId = WorldPackets.toNewId(combined);
metadata.setValue(newId);
}
// Handle other changes
if (type.is(Entity1_13Types.EntityType.AREA_EFFECT_CLOUD)) {
if (metadata.getId() == 9 || metadata.getId() == 10 || metadata.getId() == 11) {