guard ResourceLocation.parse() against corrupted NBT in furniture reconnect

This commit is contained in:
Adrien
2026-04-16 15:53:58 +02:00
committed by NotEvil
parent b47f642532
commit 06018e6c9b

View File

@@ -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<Level> dimKey = ResourceKey.create(
net.minecraft.core.registries.Registries.DIMENSION,
ResourceLocation.parse(dimStr)
dimLoc
);
var server = player.getServer();