Add MaterialTags for the different Types of Tools (#8049)

* Add MaterialTags for the different Types of Tools

* Add Netherite Tools Tag
This commit is contained in:
thelooter 2022-10-22 23:51:34 +02:00
parent 6ffb491076
commit 28e6d9fd86

View file

@ -7,6 +7,7 @@ This adds a bunch of useful and missing Tags to be able to identify items that
are related to each other by a trait. are related to each other by a trait.
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored by: Lena Kolb <lenakolb2204@gmail.com>
diff --git a/src/main/java/com/destroystokyo/paper/MaterialSetTag.java b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java diff --git a/src/main/java/com/destroystokyo/paper/MaterialSetTag.java b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java
new file mode 100644 new file mode 100644
@ -777,6 +778,49 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */ + */
+ public static final MaterialSetTag CUT_COPPER_SLABS = new MaterialSetTag(keyFor("cut_copper_slabs")) + public static final MaterialSetTag CUT_COPPER_SLABS = new MaterialSetTag(keyFor("cut_copper_slabs"))
+ .endsWith("CUT_COPPER_SLAB").ensureSize("CUT_COPPER_SLABS", 8).lock(); + .endsWith("CUT_COPPER_SLAB").ensureSize("CUT_COPPER_SLABS", 8).lock();
+
+ /**
+ * Covers all Wooden Tools.
+ */
+ public static final MaterialSetTag WOODEN_TOOLS = new MaterialSetTag(keyFor("wooden_tools"))
+ .add(Material.WOODEN_AXE, Material.WOODEN_HOE, Material.WOODEN_PICKAXE, Material.WOODEN_SHOVEL, Material.WOODEN_SWORD)
+ .ensureSize("WOODEN_TOOLS", 5).lock();
+
+ /**
+ * Covers all Stone Tools.
+ */
+ public static final MaterialSetTag STONE_TOOLS = new MaterialSetTag(keyFor("stone_tools"))
+ .add(Material.STONE_AXE, Material.STONE_HOE, Material.STONE_PICKAXE, Material.STONE_SHOVEL, Material.STONE_SWORD)
+ .ensureSize("STONE_TOOLS", 5).lock();
+
+ /**
+ * Covers all Iron Tools.
+ */
+ public static final MaterialSetTag IRON_TOOLS = new MaterialSetTag(keyFor("iron_tools"))
+ .add(Material.IRON_AXE, Material.IRON_HOE, Material.IRON_PICKAXE, Material.IRON_SHOVEL, Material.IRON_SWORD)
+ .ensureSize("IRON_TOOLS", 5).lock();
+
+ /**
+ * Covers all Gold Tools.
+ */
+ public static final MaterialSetTag GOLDEN_TOOLS = new MaterialSetTag(keyFor("golden_tools"))
+ .add(Material.GOLDEN_AXE, Material.GOLDEN_HOE, Material.GOLDEN_PICKAXE, Material.GOLDEN_SHOVEL, Material.GOLDEN_SWORD)
+ .ensureSize("GOLDEN_TOOLS", 5).lock();
+
+ /**
+ * Covers all Diamond Tools.
+ */
+ public static final MaterialSetTag DIAMOND_TOOLS = new MaterialSetTag(keyFor("diamond_tools"))
+ .add(Material.DIAMOND_AXE, Material.DIAMOND_HOE, Material.DIAMOND_PICKAXE, Material.DIAMOND_SHOVEL, Material.DIAMOND_SWORD)
+ .ensureSize("DIAMOND_TOOLS", 5).lock();
+
+ /**
+ * Covers all Netherite Tools.
+ */
+ public static final MaterialSetTag NETHERITE_TOOLS = new MaterialSetTag(keyFor("netherite_tools"))
+ .add(Material.NETHERITE_AXE, Material.NETHERITE_HOE, Material.NETHERITE_PICKAXE, Material.NETHERITE_SHOVEL, Material.NETHERITE_SWORD)
+ .ensureSize("NETHERITE_TOOLS", 5).lock();
+
+} +}
diff --git a/src/main/java/io/papermc/paper/tag/BaseTag.java b/src/main/java/io/papermc/paper/tag/BaseTag.java diff --git a/src/main/java/io/papermc/paper/tag/BaseTag.java b/src/main/java/io/papermc/paper/tag/BaseTag.java
new file mode 100644 new file mode 100644