2024-01-04 13:49:14 +01:00
|
|
|
--- a/net/minecraft/nbt/NbtUtils.java
|
|
|
|
+++ b/net/minecraft/nbt/NbtUtils.java
|
2024-12-14 23:35:55 +01:00
|
|
|
@@ -143,8 +_,10 @@
|
|
|
|
if (!tag.contains("Name", 8)) {
|
2024-01-04 13:49:14 +01:00
|
|
|
return Blocks.AIR.defaultBlockState();
|
|
|
|
} else {
|
2024-12-14 23:35:55 +01:00
|
|
|
- ResourceLocation resourceLocation = ResourceLocation.parse(tag.getString("Name"));
|
|
|
|
- Optional<? extends Holder<Block>> optional = blockGetter.get(ResourceKey.create(Registries.BLOCK, resourceLocation));
|
2024-01-04 13:49:14 +01:00
|
|
|
+ // Paper start - Validate resource location
|
2024-12-14 23:35:55 +01:00
|
|
|
+ ResourceLocation resourceLocation = ResourceLocation.tryParse(tag.getString("Name"));
|
|
|
|
+ Optional<? extends Holder<Block>> optional = resourceLocation != null ? blockGetter.get(ResourceKey.create(Registries.BLOCK, resourceLocation)) : Optional.empty();
|
2024-01-04 13:49:14 +01:00
|
|
|
+ // Paper end - Validate resource location
|
|
|
|
if (optional.isEmpty()) {
|
|
|
|
return Blocks.AIR.defaultBlockState();
|
|
|
|
} else {
|