Fix exception when reading compass with no lodestone linked to it

This commit is contained in:
jglrxavpok 2020-10-16 12:39:17 +02:00
parent dd0f2ea293
commit 8561e0cddc

View File

@ -83,7 +83,9 @@ public class CompassMeta implements ItemMeta {
@Override @Override
public void write(NBTCompound compound) { public void write(NBTCompound compound) {
compound.setByte("LodestoneTracked", (byte) (lodestoneTracked ? 1 : 0)); compound.setByte("LodestoneTracked", (byte) (lodestoneTracked ? 1 : 0));
compound.setString("LodestoneDimension", lodestoneDimension); if(lodestoneDimension != null) {
compound.setString("LodestoneDimension", lodestoneDimension);
}
{ {
NBTCompound posCompound = new NBTCompound(); NBTCompound posCompound = new NBTCompound();