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

Improve horse armor patch in 1.8->1.9 (#3773)

Dieser Commit ist enthalten in:
EnZaXD 2024-04-05 15:46:20 +02:00 committet von GitHub
Ursprung 868a5bd24e
Commit 5569caf610
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -175,11 +175,13 @@ public class EntityTracker1_9 extends EntityTrackerBase {
}
}
//ECHOPET Patch
if (type == EntityType.HORSE) {
// Wrong metadata value from EchoPet, patch since it's discontinued. (https://github.com/DSH105/EchoPet/blob/06947a8b08ce40be9a518c2982af494b3b99d140/modules/API/src/main/java/com/dsh105/echopet/compat/api/entity/HorseArmour.java#L22)
if (metadata.id() == 16 && (int) metadata.getValue() == Integer.MIN_VALUE)
// 1.8 can handle out of range values and will just not show any armor, 1.9+ clients will get
// exceptions and won't render the entity at all
if (type == EntityType.HORSE && metadata.id() == 16) {
final int value = metadata.value();
if (value < 0 || value > 3) { // no armor, iron armor, gold armor and diamond armor
metadata.setValue(0);
}
}
if (type == EntityType.PLAYER) {