geforkt von Mirrors/Paper
16 Zeilen
938 B
Diff
16 Zeilen
938 B
Diff
--- a/net/minecraft/nbt/NbtUtils.java
|
|
+++ b/net/minecraft/nbt/NbtUtils.java
|
|
@@ -143,8 +_,10 @@
|
|
if (!tag.contains("Name", 8)) {
|
|
return Blocks.AIR.defaultBlockState();
|
|
} else {
|
|
- ResourceLocation resourceLocation = ResourceLocation.parse(tag.getString("Name"));
|
|
- Optional<? extends Holder<Block>> optional = blockGetter.get(ResourceKey.create(Registries.BLOCK, resourceLocation));
|
|
+ // Paper start - Validate resource location
|
|
+ ResourceLocation resourceLocation = ResourceLocation.tryParse(tag.getString("Name"));
|
|
+ Optional<? extends Holder<Block>> optional = resourceLocation != null ? blockGetter.get(ResourceKey.create(Registries.BLOCK, resourceLocation)) : Optional.empty();
|
|
+ // Paper end - Validate resource location
|
|
if (optional.isEmpty()) {
|
|
return Blocks.AIR.defaultBlockState();
|
|
} else {
|