guard ResourceLocation.parse() against corrupted NBT in furniture reconnect
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user