2022-12-11 04:51:09 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2023-07-01 20:21:13 +00:00
|
|
|
From: Video <videogamesm12@gmail.com>
|
|
|
|
Date: Sun, 13 Mar 2022 21:56:29 -0600
|
2022-12-11 04:51:09 +00:00
|
|
|
Subject: [PATCH] Validate BlockState and SoundEvent values
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
2024-04-16 05:12:25 +00:00
|
|
|
index fe4bea6af0d8734f3a5b972dce5f1e3914d6690e..0ee64be4288f59240beec26c470b78cc1aeac424 100644
|
2022-12-11 04:51:09 +00:00
|
|
|
--- a/src/main/java/net/minecraft/nbt/NbtUtils.java
|
|
|
|
+++ b/src/main/java/net/minecraft/nbt/NbtUtils.java
|
2024-04-16 05:12:25 +00:00
|
|
|
@@ -223,7 +223,7 @@ public final class NbtUtils {
|
2022-12-11 04:51:09 +00:00
|
|
|
return Blocks.AIR.defaultBlockState();
|
|
|
|
} else {
|
2024-01-07 20:19:55 +00:00
|
|
|
// Paper start - Validate resource location
|
|
|
|
- ResourceLocation resourceLocation = ResourceLocation.tryParse(nbt.getString("Name"));
|
2022-12-11 04:51:09 +00:00
|
|
|
+ ResourceLocation resourceLocation = ResourceLocation.tryParse(nbt.getString("Name")); // Scissors - Validate BlockState
|
2024-01-07 20:19:55 +00:00
|
|
|
Optional<? extends Holder<Block>> optional = resourceLocation != null ? blockLookup.get(ResourceKey.create(Registries.BLOCK, resourceLocation)) : Optional.empty();
|
2024-01-18 23:05:55 +00:00
|
|
|
// Paper end - Validate resource location
|
2022-12-11 04:51:09 +00:00
|
|
|
if (optional.isEmpty()) {
|