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 committed by GitHub
parent 5cdb5f9585
commit 3d50709776
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 45 additions and 1 deletions

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
@ -116,7 +117,7 @@ new file mode 100644
index 0000000000000000000000000000000000000000..1a78872e26f8fadbddd9af15fff063d03690077f index 0000000000000000000000000000000000000000..1a78872e26f8fadbddd9af15fff063d03690077f
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java +++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java
@@ -0,0 +1,661 @@ @@ -0,0 +1,704 @@
+/* +/*
+ * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License + * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License
+ * + *
@ -777,6 +778,49 @@ index 0000000000000000000000000000000000000000..1a78872e26f8fadbddd9af15fff063d0
+ */ + */
+ 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