diff --git a/patches/server/0051-Fix-invalid-armor-trim-exploit.patch b/patches/server/0051-Fix-invalid-armor-trim-exploit.patch new file mode 100644 index 0000000..55358a2 --- /dev/null +++ b/patches/server/0051-Fix-invalid-armor-trim-exploit.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Luna +Date: Mon, 12 Jun 2023 17:32:04 -0300 +Subject: [PATCH] Fix invalid armor trim exploit + + +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmor.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmor.java +index c92981aedebe934cefa1c96a0328fb91fe17acbc..a1e1a94f0eb46b7eb3fe19e416e21e29b33f3e9f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmor.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmor.java +@@ -71,7 +71,7 @@ public class CraftMetaArmor extends CraftMetaItem implements ArmorMeta { + TrimMaterial trimMaterial = Registry.TRIM_MATERIAL.get(NamespacedKey.fromString(trimCompound.getString(TRIM_MATERIAL.NBT))); + TrimPattern trimPattern = Registry.TRIM_PATTERN.get(NamespacedKey.fromString(trimCompound.getString(TRIM_PATTERN.NBT))); + +- this.trim = new ArmorTrim(trimMaterial, trimPattern); ++ if (trimMaterial != null && trimPattern != null) this.trim = new ArmorTrim(trimMaterial, trimPattern); // Scissors + } + } + }