mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Handle invalid items in shulker box
This commit is contained in:
parent
c928bafddd
commit
0b80c58958
1 changed files with 5 additions and 0 deletions
|
@ -52,6 +52,11 @@ public class ShulkerBoxItemTranslator extends NbtItemStackTranslator {
|
||||||
|
|
||||||
ItemMapping boxMapping = session.getItemMappings().getMapping(Identifier.formalize(((StringTag) itemData.get("id")).getValue()));
|
ItemMapping boxMapping = session.getItemMappings().getMapping(Identifier.formalize(((StringTag) itemData.get("id")).getValue()));
|
||||||
|
|
||||||
|
if (boxMapping == null) {
|
||||||
|
// If invalid ID
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
boxItemTag.put(new StringTag("Name", boxMapping.getBedrockIdentifier()));
|
boxItemTag.put(new StringTag("Name", boxMapping.getBedrockIdentifier()));
|
||||||
boxItemTag.put(new ShortTag("Damage", (short) boxMapping.getBedrockData()));
|
boxItemTag.put(new ShortTag("Damage", (short) boxMapping.getBedrockData()));
|
||||||
boxItemTag.put(new ByteTag("Count", MathUtils.getNbtByte(itemData.get("Count").getValue())));
|
boxItemTag.put(new ByteTag("Count", MathUtils.getNbtByte(itemData.get("Count").getValue())));
|
||||||
|
|
Loading…
Reference in a new issue