Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 00:00:41 +01:00
Fix enchantment conversion (#920)
* Fix java to bedrock enchantments * Fix NBT conversion and add Soul Speed enchantment * Remove unused import
Dieser Commit ist enthalten in:
Ursprung
23f33881cd
Commit
04e73efd94
@ -66,7 +66,8 @@ public enum Enchantment {
|
||||
CHANNELING,
|
||||
MULTISHOT,
|
||||
PIERCING,
|
||||
QUICK_CHARGE;
|
||||
QUICK_CHARGE,
|
||||
SOUL_SPEED;
|
||||
|
||||
private final String javaIdentifier;
|
||||
|
||||
|
@ -304,7 +304,7 @@ public abstract class ItemTranslator {
|
||||
if (tag != null && !tag.isEmpty()) {
|
||||
for (String str : tag.keySet()) {
|
||||
Object bedrockTag = tag.get(str);
|
||||
com.github.steveice10.opennbt.tag.builtin.Tag translatedTag = translateToJavaNBT(name, bedrockTag);
|
||||
com.github.steveice10.opennbt.tag.builtin.Tag translatedTag = translateToJavaNBT(str, bedrockTag);
|
||||
if (translatedTag == null)
|
||||
continue;
|
||||
|
||||
@ -370,11 +370,7 @@ public abstract class ItemTranslator {
|
||||
|
||||
if (object instanceof NbtMap) {
|
||||
NbtMap map = (NbtMap) object;
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
if (entry.getValue().equals(map.get(name))) {
|
||||
return translateToJavaNBT(entry.getKey(), map.getCompound(name));
|
||||
}
|
||||
}
|
||||
return translateToJavaNBT(name, map);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren