From be81b4f5c524fe1b6ea0af32a9f2e47c06223cc9 Mon Sep 17 00:00:00 2001 From: HexedHero <6012891+HexedHero@users.noreply.github.com> Date: Sun, 3 Jan 2021 19:07:18 +0100 Subject: [PATCH] Add a Enchantable MaterialTag --- Spigot-API-Patches/0153-Add-Material-Tags.patch | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Spigot-API-Patches/0153-Add-Material-Tags.patch b/Spigot-API-Patches/0153-Add-Material-Tags.patch index d3531c6de3..bb1fef0708 100644 --- a/Spigot-API-Patches/0153-Add-Material-Tags.patch +++ b/Spigot-API-Patches/0153-Add-Material-Tags.patch @@ -204,10 +204,10 @@ index 0000000000000000000000000000000000000000..c91ea2a0679a7f3a5627b5a008e0b39d +} diff --git a/src/main/java/com/destroystokyo/paper/MaterialTags.java b/src/main/java/com/destroystokyo/paper/MaterialTags.java new file mode 100644 -index 0000000000000000000000000000000000000000..ce19324d4667e8632615b16402743a9c00694d31 +index 0000000000000000000000000000000000000000..b83b8d0ccc0d011c8cdcf026c91dcb1aeab9c596 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java -@@ -0,0 +1,548 @@ +@@ -0,0 +1,549 @@ +/* + * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License + * @@ -750,11 +750,12 @@ index 0000000000000000000000000000000000000000..ce19324d4667e8632615b16402743a9c + .ensureSize("CORAL_FANS", 20); + + /** -+ * Covers the variants of coral blocks. ++ * Covers all items that can be enchanted from the enchantment table or anvil. + */ -+ public static final MaterialSetTag CORAL_BLOCKS = new MaterialSetTag(keyFor("coral_blocks")) -+ .endsWith("_CORAL_BLOCK") -+ .ensureSize("CORAL_BLOCKS", 10); ++ public static final MaterialSetTag ENCHANTABLE = new MaterialSetTag(keyFor("enchantable")) ++ .add(PICKAXES, SWORDS, SHOVELS, AXES, HOES, HELMETS, CHEST_EQUIPPABLE, LEGGINGS, BOOTS, BOWS) ++ .add(Material.TRIDENT, Material.SHIELD, Material.FISHING_ROD, Material.SHEARS, Material.FLINT_AND_STEEL, Material.CARROT_ON_A_STICK, Material.WARPED_FUNGUS_ON_A_STICK) ++ .ensureSize("ENCHANTABLE", 65); +} diff --git a/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java b/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java new file mode 100644