mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-12-23 17:08:00 +01:00
Fix villager and llama meta rewrites (#146)
This commit is contained in:
parent
8e2d640f8c
commit
f0da0624f7
@ -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();
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user