Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-28 17:10:13 +01:00
Fix enchantment level
Dieser Commit ist enthalten in:
Ursprung
5899886b42
Commit
9ca02680c8
@ -74,6 +74,9 @@ final class StructuredDataConverter {
|
|||||||
private static final Map<StructuredDataKey<?>, DataConverter<?>> REWRITERS = new Reference2ObjectOpenHashMap<>();
|
private static final Map<StructuredDataKey<?>, DataConverter<?>> REWRITERS = new Reference2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
register(StructuredDataKey.CUSTOM_DATA, (data, tag) -> {
|
||||||
|
// Handled manually
|
||||||
|
});
|
||||||
register(StructuredDataKey.DAMAGE, (data, tag) -> tag.putInt("Damage", data));
|
register(StructuredDataKey.DAMAGE, (data, tag) -> tag.putInt("Damage", data));
|
||||||
register(StructuredDataKey.UNBREAKABLE, (data, tag) -> {
|
register(StructuredDataKey.UNBREAKABLE, (data, tag) -> {
|
||||||
tag.putBoolean("Unbreakable", true);
|
tag.putBoolean("Unbreakable", true);
|
||||||
@ -524,7 +527,7 @@ final class StructuredDataConverter {
|
|||||||
|
|
||||||
final CompoundTag enchantment = new CompoundTag();
|
final CompoundTag enchantment = new CompoundTag();
|
||||||
enchantment.putString("id", identifier);
|
enchantment.putString("id", identifier);
|
||||||
enchantment.putShort("lvl", (short) entry.getIntKey());
|
enchantment.putShort("lvl", (short) entry.getIntValue());
|
||||||
enchantments.add(enchantment);
|
enchantments.add(enchantment);
|
||||||
}
|
}
|
||||||
tag.put(storedEnchantments ? "StoredEnchantments" : "Enchantments", enchantments);
|
tag.put(storedEnchantments ? "StoredEnchantments" : "Enchantments", enchantments);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren