Quietly handle unmappable Java items

If vanilla can handle them, so can we.
This commit is contained in:
Camotoy 2021-03-02 19:10:17 -05:00
parent 93726f5818
commit 7e773c9970
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F

View file

@ -125,8 +125,12 @@ public abstract class ItemTranslator {
} }
ItemEntry bedrockItem = ItemRegistry.getItem(stack); ItemEntry bedrockItem = ItemRegistry.getItem(stack);
if (bedrockItem == null) {
session.getConnector().getLogger().debug("No matching ItemEntry for " + stack);
return ItemData.AIR;
}
com.github.steveice10.opennbt.tag.builtin.CompoundTag nbt = stack.getNbt() != null ? stack.getNbt().clone() : null; CompoundTag nbt = stack.getNbt() != null ? stack.getNbt().clone() : null;
// This is a fallback for maps with no nbt // This is a fallback for maps with no nbt
if (nbt == null && bedrockItem.getJavaIdentifier().equals("minecraft:filled_map")) { if (nbt == null && bedrockItem.getJavaIdentifier().equals("minecraft:filled_map")) {