diff --git a/src/main/java/com/tiedup/remake/network/NetworkEventHandler.java b/src/main/java/com/tiedup/remake/network/NetworkEventHandler.java index 6ebc7f3..985e93a 100644 --- a/src/main/java/com/tiedup/remake/network/NetworkEventHandler.java +++ b/src/main/java/com/tiedup/remake/network/NetworkEventHandler.java @@ -286,10 +286,18 @@ public class NetworkEventHandler { return; } - // Resolve the dimension + // Resolve the dimension (guard against corrupted NBT) + ResourceLocation dimLoc; + try { + dimLoc = ResourceLocation.parse(dimStr); + } catch (net.minecraft.ResourceLocationException e) { + TiedUpMod.LOGGER.warn("Invalid dimension in furniture reconnect NBT: '{}', clearing", dimStr); + persistentData.remove("tiedup_locked_furniture"); + return; + } ResourceKey dimKey = ResourceKey.create( net.minecraft.core.registries.Registries.DIMENSION, - ResourceLocation.parse(dimStr) + dimLoc ); var server = player.getServer();