3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-27 00:22:53 +01:00

Handle chested horse metadata correctly

Dieser Commit ist enthalten in:
Matsv 2017-06-03 12:22:47 +02:00
Ursprung 347d449f51
Commit da2e802e29
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 97CEC2A2EA31350F

Datei anzeigen

@ -468,13 +468,28 @@ public class EntityPackets extends EntityRewriter<Protocol1_10To1_11> {
HORSES HORSES
*/ */
// Handle horse flags
registerMetaHandler().filter(EntityType.ABSTRACT_HORSE, true, 13).handle(e -> {
Metadata data = e.getData();
byte b = (byte) data.getValue();
Optional<Metadata> chest = e.getMetaByIndex(15);
if (chest.isPresent()) {
boolean hasChest = (boolean) chest.get().getValue();
if (hasChest)
b |= 0x08; // Chested
data.setValue(b);
}
return data;
});
// Handle Horse (Correct owner) // Handle Horse (Correct owner)
registerMetaHandler().filter(EntityType.ABSTRACT_HORSE, true, 14).handleIndexChange(16); registerMetaHandler().filter(EntityType.ABSTRACT_HORSE, true, 14).handleIndexChange(16);
// Handle horse armor // Handle horse armor
registerMetaHandler().filter(EntityType.HORSE, 16).handleIndexChange(17); registerMetaHandler().filter(EntityType.HORSE, 16).handleIndexChange(17);
// Handle chested horse - flag is still sent in horse flags // Handle chested horse
registerMetaHandler().filter(EntityType.CHESTED_HORSE, true, 15).removed(); registerMetaHandler().filter(EntityType.CHESTED_HORSE, true, 15).removed();
// Get rid of Liama metadata TODO maybe for some special magic in the future? // Get rid of Liama metadata TODO maybe for some special magic in the future?
@ -504,6 +519,7 @@ public class EntityPackets extends EntityRewriter<Protocol1_10To1_11> {
1 - Wither Skeleton 1 - Wither Skeleton
2 - Stray 2 - Stray
*/ */
private Metadata getSkeletonTypeMeta(int type) { private Metadata getSkeletonTypeMeta(int type) {
return new Metadata(12, MetaType1_9.VarInt, type); return new Metadata(12, MetaType1_9.VarInt, type);
} }