Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-26 16:12:46 +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,
|
CHANNELING,
|
||||||
MULTISHOT,
|
MULTISHOT,
|
||||||
PIERCING,
|
PIERCING,
|
||||||
QUICK_CHARGE;
|
QUICK_CHARGE,
|
||||||
|
SOUL_SPEED;
|
||||||
|
|
||||||
private final String javaIdentifier;
|
private final String javaIdentifier;
|
||||||
|
|
||||||
|
@ -304,7 +304,7 @@ public abstract class ItemTranslator {
|
|||||||
if (tag != null && !tag.isEmpty()) {
|
if (tag != null && !tag.isEmpty()) {
|
||||||
for (String str : tag.keySet()) {
|
for (String str : tag.keySet()) {
|
||||||
Object bedrockTag = tag.get(str);
|
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)
|
if (translatedTag == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -370,11 +370,7 @@ public abstract class ItemTranslator {
|
|||||||
|
|
||||||
if (object instanceof NbtMap) {
|
if (object instanceof NbtMap) {
|
||||||
NbtMap map = (NbtMap) object;
|
NbtMap map = (NbtMap) object;
|
||||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
return translateToJavaNBT(name, map);
|
||||||
if (entry.getValue().equals(map.get(name))) {
|
|
||||||
return translateToJavaNBT(entry.getKey(), map.getCompound(name));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren