From 8561e0cddc0eb51cf9ed91770fe18351c34bc185 Mon Sep 17 00:00:00 2001 From: jglrxavpok Date: Fri, 16 Oct 2020 12:39:17 +0200 Subject: [PATCH] Fix exception when reading compass with no lodestone linked to it --- .../java/net/minestom/server/item/metadata/CompassMeta.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minestom/server/item/metadata/CompassMeta.java b/src/main/java/net/minestom/server/item/metadata/CompassMeta.java index 4a88d7e45..b3ba94e26 100644 --- a/src/main/java/net/minestom/server/item/metadata/CompassMeta.java +++ b/src/main/java/net/minestom/server/item/metadata/CompassMeta.java @@ -83,7 +83,9 @@ public class CompassMeta implements ItemMeta { @Override public void write(NBTCompound compound) { compound.setByte("LodestoneTracked", (byte) (lodestoneTracked ? 1 : 0)); - compound.setString("LodestoneDimension", lodestoneDimension); + if(lodestoneDimension != null) { + compound.setString("LodestoneDimension", lodestoneDimension); + } { NBTCompound posCompound = new NBTCompound();