Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-20 15:00:11 +01:00
Fix Custom Model Data not working on Potions. (#3616)
Dieser Commit ist enthalten in:
Ursprung
2a8d8b6cdf
Commit
45e043c6e9
@ -48,15 +48,23 @@ public class PotionTranslator extends ItemTranslator {
|
|||||||
if (itemStack.getNbt() == null) return super.translateToBedrock(itemStack, mapping, mappings);
|
if (itemStack.getNbt() == null) return super.translateToBedrock(itemStack, mapping, mappings);
|
||||||
Tag potionTag = itemStack.getNbt().get("Potion");
|
Tag potionTag = itemStack.getNbt().get("Potion");
|
||||||
if (potionTag instanceof StringTag) {
|
if (potionTag instanceof StringTag) {
|
||||||
Potion potion = Potion.getByJavaIdentifier(((StringTag) potionTag).getValue());
|
int customItemId = CustomItemTranslator.getCustomItem(itemStack.getNbt(), mapping);
|
||||||
if (potion != null) {
|
if (customItemId == -1) {
|
||||||
|
Potion potion = Potion.getByJavaIdentifier(((StringTag) potionTag).getValue());
|
||||||
|
if (potion != null) {
|
||||||
|
return ItemData.builder()
|
||||||
|
.id(mapping.getBedrockId())
|
||||||
|
.damage(potion.getBedrockId())
|
||||||
|
.count(itemStack.getAmount())
|
||||||
|
.tag(translateNbtToBedrock(itemStack.getNbt()));
|
||||||
|
}
|
||||||
|
GeyserImpl.getInstance().getLogger().debug("Unknown Java potion: " + potionTag.getValue());
|
||||||
|
} else {
|
||||||
return ItemData.builder()
|
return ItemData.builder()
|
||||||
.id(mapping.getBedrockId())
|
.id(customItemId)
|
||||||
.damage(potion.getBedrockId())
|
|
||||||
.count(itemStack.getAmount())
|
.count(itemStack.getAmount())
|
||||||
.tag(translateNbtToBedrock(itemStack.getNbt()));
|
.tag(translateNbtToBedrock(itemStack.getNbt()));
|
||||||
}
|
}
|
||||||
GeyserImpl.getInstance().getLogger().debug("Unknown Java potion: " + potionTag.getValue());
|
|
||||||
}
|
}
|
||||||
return super.translateToBedrock(itemStack, mapping, mappings);
|
return super.translateToBedrock(itemStack, mapping, mappings);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren