3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-16 04:50:07 +01:00

Map unbreakable item component

Fixes #4893
Dieser Commit ist enthalten in:
Camotoy 2024-07-24 14:27:05 -04:00
Ursprung b664395684
Commit 96c58566b5
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F

Datei anzeigen

@ -170,6 +170,11 @@ public class Item {
builder.putInt("RepairCost", repairCost);
}
// If the tag exists, it's unbreakable; the value is just weather to show the tooltip. As of Java 1.21
if (components.getDataComponents().containsKey(DataComponentType.UNBREAKABLE)) {
builder.putByte("Unbreakable", (byte) 1);
}
// Prevents the client from trying to stack items with untranslated components
// Relies on correct hash code implementation, and some luck
builder.putInt("GeyserHash", components.hashCode()); // TODO: don't rely on this