forked from GeyserMC/Geyser
Fix enchantment conversion (#920)
* Fix java to bedrock enchantments * Fix NBT conversion and add Soul Speed enchantment * Remove unused import
This commit is contained in:
parent
23f33881cd
commit
04e73efd94
2 changed files with 4 additions and 7 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue