Fix villager and llama meta rewrites (#146)

This commit is contained in:
Nassim 2019-09-23 10:00:03 +02:00 committed by Myles
parent 8e2d640f8c
commit f0da0624f7
2 changed files with 9 additions and 4 deletions

View File

@ -509,9 +509,6 @@ public class EntityPackets1_11 extends EntityRewriter<Protocol1_10To1_11> {
return e.getData();
});
// Handle Horse (Correct owner)
registerMetaHandler().filter(EntityType.ABSTRACT_HORSE, true, 14).handleIndexChange(16);
// Handle horse armor
registerMetaHandler().filter(EntityType.HORSE, 16).handleIndexChange(17);
@ -545,6 +542,9 @@ public class EntityPackets1_11 extends EntityRewriter<Protocol1_10To1_11> {
return e.getData();
});
// Handle Horse (Correct owner)
registerMetaHandler().filter(EntityType.ABSTRACT_HORSE, true, 14).handleIndexChange(16);
// Handle villager - Change non-existing profession
registerMetaHandler().filter(EntityType.VILLAGER, 13).handle(e -> {
Metadata data = e.getData();

View File

@ -444,16 +444,21 @@ public class EntityPackets1_14 extends EntityRewriter<Protocol1_13_2To1_14> {
return meta;
});
registerMetaHandler().filter(EntityType1_14.EntityType.VILLAGER, 15).removed(); // Head shake timer
MetaHandler villagerDataHandler = e -> {
Metadata meta = e.getData();
VillagerData villagerData = (VillagerData) meta.getValue();
meta.setValue(villagerDataToProfession(villagerData));
meta.setMetaType(MetaType1_13_2.VarInt);
if (meta.getId() == 16) {
meta.setId(15); // decreased by 2 again in one of the following handlers
}
return meta;
};
registerMetaHandler().filter(EntityType1_14.EntityType.ZOMBIE_VILLAGER, 18).handle(villagerDataHandler);
registerMetaHandler().filter(EntityType1_14.EntityType.VILLAGER, 15).handle(villagerDataHandler);
registerMetaHandler().filter(EntityType1_14.EntityType.VILLAGER, 16).handle(villagerDataHandler);
registerMetaHandler().filter(EntityType1_14.EntityType.ZOMBIE, true).handle(e -> {
Metadata meta = e.getData();