Scissors/patches/server/0048-Fix-invalid-armor-trim-exploit.patch
allinkdev 871cc5653c
Clean up patches (#103)
* Clean up command block event patch

* Merge resource location patches

* Merge map decoration patches

* Merge Video's resource location patches

* Merge large tag reset patches
2023-06-16 22:54:59 -05:00

20 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Luna <lunahatesgogle@gmail.com>
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
}
}
}