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

Add spit damage type

The client depends on it
Dieser Commit ist enthalten in:
Nassim Jahnke 2024-04-18 20:12:38 +02:00
Ursprung f7aa1a516e
Commit 57b37457d6
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F

Datei anzeigen

@ -120,6 +120,17 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
registryEntries[id] = new RegistryEntry(name, tag.get("element"));
}
// Add spit damage type
if (Key.stripMinecraftNamespace(type).equals("damage_type")) {
final int length = registryEntries.length;
registryEntries = Arrays.copyOf(registryEntries, length + 1);
final CompoundTag spitData = new CompoundTag();
spitData.putString("scaling", "when_caused_by_living_non_player");
spitData.putString("message_id", "mob");
spitData.putFloat("exhaustion", 0.1F);
registryEntries[length] = new RegistryEntry("minecraft:spit", spitData);
}
if (requiresDummyValues) {
// Truncate and replace null values
if (registryEntries.length != entriesLength) {