Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-12-24 15:20:25 +01:00
Ursprung
e13643d040
Commit
0537c04ef6
@ -43,9 +43,9 @@ public class EnchantmentTranslator extends NbtItemStackTranslator {
|
|||||||
@Override
|
@Override
|
||||||
public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) {
|
public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemMapping mapping) {
|
||||||
List<Tag> newTags = new ArrayList<>();
|
List<Tag> newTags = new ArrayList<>();
|
||||||
if (itemTag.contains("Enchantments")) {
|
Tag enchantmentTag = itemTag.get("Enchantments");
|
||||||
ListTag enchantmentTag = itemTag.get("Enchantments");
|
if (enchantmentTag instanceof ListTag listTag) {
|
||||||
for (Tag tag : enchantmentTag.getValue()) {
|
for (Tag tag : listTag.getValue()) {
|
||||||
if (!(tag instanceof CompoundTag)) continue;
|
if (!(tag instanceof CompoundTag)) continue;
|
||||||
|
|
||||||
CompoundTag bedrockTag = remapEnchantment((CompoundTag) tag);
|
CompoundTag bedrockTag = remapEnchantment((CompoundTag) tag);
|
||||||
@ -53,9 +53,9 @@ public class EnchantmentTranslator extends NbtItemStackTranslator {
|
|||||||
}
|
}
|
||||||
itemTag.remove("Enchantments");
|
itemTag.remove("Enchantments");
|
||||||
}
|
}
|
||||||
if (itemTag.contains("StoredEnchantments")) {
|
enchantmentTag = itemTag.get("StoredEnchantments");
|
||||||
ListTag enchantmentTag = itemTag.get("StoredEnchantments");
|
if (enchantmentTag instanceof ListTag listTag) {
|
||||||
for (Tag tag : enchantmentTag.getValue()) {
|
for (Tag tag : listTag.getValue()) {
|
||||||
if (!(tag instanceof CompoundTag)) continue;
|
if (!(tag instanceof CompoundTag)) continue;
|
||||||
|
|
||||||
CompoundTag bedrockTag = remapEnchantment((CompoundTag) tag);
|
CompoundTag bedrockTag = remapEnchantment((CompoundTag) tag);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren