From f9f5f1b34564a4f84cc64d6b892834b6a9a9f5ed Mon Sep 17 00:00:00 2001 From: Luna <90072930+LunaWasFlaggedAgain@users.noreply.github.com> Date: Sun, 25 Jun 2023 23:02:42 -0300 Subject: [PATCH] Fix decorated pot invalid resourcelocation exploit (#106) --- ...011-Even-more-resource-location-validation.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/patches/server/0011-Even-more-resource-location-validation.patch b/patches/server/0011-Even-more-resource-location-validation.patch index 8429aff..6bf134b 100644 --- a/patches/server/0011-Even-more-resource-location-validation.patch +++ b/patches/server/0011-Even-more-resource-location-validation.patch @@ -61,6 +61,19 @@ index e2a25c29ec74147b3e66aa0b3deb85a8f6ee53a5..b0c953ad8275740679c847e348b311de this.lootTableSeed = nbt.getLong("DeathLootTableSeed"); } +diff --git a/src/main/java/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java +index 6f9286db4e5786464fb0b49dc125e1228ab7ae93..8d91accb0d5e8afa3957d816bd71681b4198ee6e 100644 +--- a/src/main/java/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java ++++ b/src/main/java/net/minecraft/world/level/block/entity/DecoratedPotBlockEntity.java +@@ -90,7 +90,7 @@ public class DecoratedPotBlockEntity extends BlockEntity { + return Items.BRICK; + } else { + Tag tag = list.get(index); +- return BuiltInRegistries.ITEM.get(new ResourceLocation(tag.getAsString())); ++ return BuiltInRegistries.ITEM.get(ResourceLocation.tryParse(tag.getAsString())); // Scissors + } + } + } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java index e49eece9bff3a53469673d03a7bbf8f9cf8776b8..a49f32e9649155b6af4b1f236e4e8142d730e7e8 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java