2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-10-07 03:39:50 +02:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Tue, 17 Jul 2018 01:27:15 -0400
|
|
|
|
Subject: [PATCH] Add Material Tags
|
|
|
|
|
|
|
|
This adds a bunch of useful and missing Tags to be able to identify items that
|
|
|
|
are related to each other by a trait.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/MaterialSetTag.java b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java
|
|
|
|
new file mode 100644
|
2020-05-06 11:48:49 +02:00
|
|
|
index 0000000000000000000000000000000000000000..c91ea2a0679a7f3a5627b5a008e0b39df3332889
|
2018-10-07 03:39:50 +02:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java
|
2019-03-20 01:28:15 +01:00
|
|
|
@@ -0,0 +1,190 @@
|
2018-10-07 03:39:50 +02:00
|
|
|
+/*
|
|
|
|
+ * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+package com.destroystokyo.paper;
|
|
|
|
+
|
|
|
|
+import com.google.common.collect.Lists;
|
|
|
|
+import com.google.common.collect.Sets;
|
|
|
|
+import org.bukkit.Material;
|
2019-02-22 04:41:20 +01:00
|
|
|
+import org.bukkit.NamespacedKey;
|
2018-10-07 03:39:50 +02:00
|
|
|
+import org.bukkit.Tag;
|
|
|
|
+import org.bukkit.block.Block;
|
|
|
|
+import org.bukkit.block.BlockState;
|
|
|
|
+import org.bukkit.block.data.BlockData;
|
|
|
|
+import org.bukkit.inventory.ItemStack;
|
|
|
|
+
|
|
|
|
+import java.util.Collection;
|
|
|
|
+import java.util.Set;
|
|
|
|
+import java.util.function.Predicate;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
+import java.util.stream.Stream;
|
2019-03-20 01:28:15 +01:00
|
|
|
+import org.jetbrains.annotations.NotNull;
|
|
|
|
+import org.jetbrains.annotations.Nullable;
|
2018-10-07 03:39:50 +02:00
|
|
|
+
|
|
|
|
+public class MaterialSetTag implements Tag<Material> {
|
|
|
|
+
|
2019-02-22 04:41:20 +01:00
|
|
|
+ private final NamespacedKey key;
|
2018-10-07 03:39:50 +02:00
|
|
|
+ private final Set<Material> materials;
|
|
|
|
+
|
2019-02-22 04:41:20 +01:00
|
|
|
+ /**
|
|
|
|
+ * @deprecated Use NamespacedKey version of constructor
|
|
|
|
+ */
|
|
|
|
+ @Deprecated
|
2019-03-20 01:28:15 +01:00
|
|
|
+ public MaterialSetTag(@NotNull Predicate<Material> filter) {
|
2019-02-22 04:41:20 +01:00
|
|
|
+ this(null, Stream.of(Material.values()).filter(filter).collect(Collectors.toList()));
|
2018-10-07 03:39:50 +02:00
|
|
|
+ }
|
|
|
|
+
|
2019-02-22 04:41:20 +01:00
|
|
|
+ /**
|
|
|
|
+ * @deprecated Use NamespacedKey version of constructor
|
|
|
|
+ */
|
|
|
|
+ @Deprecated
|
2019-03-20 01:28:15 +01:00
|
|
|
+ public MaterialSetTag(@NotNull Collection<Material> materials) {
|
2019-02-22 04:41:20 +01:00
|
|
|
+ this(null, materials);
|
2018-10-07 03:39:50 +02:00
|
|
|
+ }
|
|
|
|
+
|
2019-02-22 04:41:20 +01:00
|
|
|
+ /**
|
|
|
|
+ * @deprecated Use NamespacedKey version of constructor
|
|
|
|
+ */
|
|
|
|
+ @Deprecated
|
2019-03-20 01:28:15 +01:00
|
|
|
+ public MaterialSetTag(@NotNull Material... materials) {
|
2019-02-22 04:41:20 +01:00
|
|
|
+ this(null, materials);
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ public MaterialSetTag(@Nullable NamespacedKey key, @NotNull Predicate<Material> filter) {
|
2019-02-22 04:41:20 +01:00
|
|
|
+ this(key, Stream.of(Material.values()).filter(filter).collect(Collectors.toList()));
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ public MaterialSetTag(@Nullable NamespacedKey key, @NotNull Material... materials) {
|
2019-02-22 04:41:20 +01:00
|
|
|
+ this(key, Lists.newArrayList(materials));
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ public MaterialSetTag(@Nullable NamespacedKey key, @NotNull Collection<Material> materials) {
|
2019-02-22 04:41:20 +01:00
|
|
|
+ this.key = key != null ? key : NamespacedKey.randomKey();
|
|
|
|
+ this.materials = Sets.newEnumSet(materials, Material.class);
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
2019-02-22 04:41:20 +01:00
|
|
|
+ @Override
|
|
|
|
+ public NamespacedKey getKey() {
|
|
|
|
+ return key;
|
2018-10-07 03:39:50 +02:00
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ public MaterialSetTag add(@NotNull Tag<Material>... tags) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ for (Tag<Material> tag : tags) {
|
|
|
|
+ add(tag.getValues());
|
|
|
|
+ }
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ public MaterialSetTag add(@NotNull MaterialSetTag... tags) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ for (Tag<Material> tag : tags) {
|
|
|
|
+ add(tag.getValues());
|
|
|
|
+ }
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ public MaterialSetTag add(@NotNull Material... material) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ this.materials.addAll(Lists.newArrayList(material));
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ public MaterialSetTag add(@NotNull Collection<Material> materials) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ this.materials.addAll(materials);
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ public MaterialSetTag contains(@NotNull String with) {
|
|
|
|
+ return add(mat -> mat.name().contains(with));
|
|
|
|
+ }
|
2018-10-07 03:39:50 +02:00
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ public MaterialSetTag endsWith(@NotNull String with) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ return add(mat -> mat.name().endsWith(with));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ public MaterialSetTag startsWith(@NotNull String with) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ return add(mat -> mat.name().startsWith(with));
|
|
|
|
+ }
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ public MaterialSetTag add(@NotNull Predicate<Material> filter) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ add(Stream.of(Material.values()).filter(((Predicate<Material>) Material::isLegacy).negate()).filter(filter).collect(Collectors.toList()));
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ public MaterialSetTag not(@NotNull MaterialSetTag tags) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ not(tags.getValues());
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ public MaterialSetTag not(@NotNull Material... material) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ this.materials.removeAll(Lists.newArrayList(material));
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ public MaterialSetTag not(@NotNull Collection<Material> materials) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ this.materials.removeAll(materials);
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ public MaterialSetTag not(@NotNull Predicate<Material> filter) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ not(Stream.of(Material.values()).filter(((Predicate<Material>) Material::isLegacy).negate()).filter(filter).collect(Collectors.toList()));
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ public MaterialSetTag notEndsWith(@NotNull String with) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ return not(mat -> mat.name().endsWith(with));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ public MaterialSetTag notStartsWith(@NotNull String with) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ return not(mat -> mat.name().startsWith(with));
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
2018-10-07 03:39:50 +02:00
|
|
|
+ public Set<Material> getValues() {
|
|
|
|
+ return this.materials;
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ public boolean isTagged(@NotNull BlockData block) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ return isTagged(block.getMaterial());
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ public boolean isTagged(@NotNull BlockState block) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ return isTagged(block.getType());
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ public boolean isTagged(@NotNull Block block) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ return isTagged(block.getType());
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ public boolean isTagged(@NotNull ItemStack item) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ return isTagged(item.getType());
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ public boolean isTagged(@NotNull Material material) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ return this.materials.contains(material);
|
|
|
|
+ }
|
|
|
|
+
|
2019-03-20 01:28:15 +01:00
|
|
|
+ @NotNull
|
|
|
|
+ public MaterialSetTag ensureSize(@NotNull String label, int size) {
|
2018-10-07 03:39:50 +02:00
|
|
|
+ long actual = this.materials.stream().filter(((Predicate<Material>) Material::isLegacy).negate()).count();
|
|
|
|
+ if (size != actual) {
|
|
|
|
+ throw new IllegalStateException(label + " - Expected " + size + " materials, got " + actual);
|
|
|
|
+ }
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/MaterialTags.java b/src/main/java/com/destroystokyo/paper/MaterialTags.java
|
|
|
|
new file mode 100644
|
2020-11-27 16:26:52 +01:00
|
|
|
index 0000000000000000000000000000000000000000..0328532bb4848d55a719c96ea3df4ac545b5b05a
|
2018-10-07 03:39:50 +02:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java
|
2020-11-27 16:26:52 +01:00
|
|
|
@@ -0,0 +1,533 @@
|
2018-10-07 03:39:50 +02:00
|
|
|
+/*
|
|
|
|
+ * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License
|
|
|
|
+ *
|
|
|
|
+ * Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
+ * a copy of this software and associated documentation files (the
|
|
|
|
+ * "Software"), to deal in the Software without restriction, including
|
|
|
|
+ * without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
+ * distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
+ * permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
+ * the following conditions:
|
|
|
|
+ *
|
|
|
|
+ * The above copyright notice and this permission notice shall be
|
|
|
|
+ * included in all copies or substantial portions of the Software.
|
|
|
|
+ *
|
|
|
|
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
|
|
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
|
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+package com.destroystokyo.paper;
|
|
|
|
+
|
|
|
|
+import org.bukkit.Material;
|
2019-02-22 04:41:20 +01:00
|
|
|
+import org.bukkit.NamespacedKey;
|
2018-10-07 03:39:50 +02:00
|
|
|
+import org.bukkit.Tag;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * Represents a collection tags to identify materials that share common properties.
|
|
|
|
+ * Will map to minecraft for missing tags, as well as custom ones that may be useful.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+@SuppressWarnings({"NonFinalUtilityClass", "unused", "WeakerAccess"})
|
2018-10-07 03:39:50 +02:00
|
|
|
+public class MaterialTags {
|
|
|
|
+
|
2019-02-22 04:41:20 +01:00
|
|
|
+ private static NamespacedKey keyFor(String key) {
|
|
|
|
+ //noinspection deprecation
|
|
|
|
+ return new NamespacedKey("paper", key + "_settag");
|
|
|
|
+ }
|
|
|
|
+ public static final MaterialSetTag ARROWS = new MaterialSetTag(keyFor("arrows"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("ARROW")
|
|
|
|
+ .ensureSize("ARROWS", 3);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers all colors of beds.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag BEDS = new MaterialSetTag(keyFor("beds"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("_BED")
|
|
|
|
+ .ensureSize("BEDS", 16);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers all bucket items.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag BUCKETS = new MaterialSetTag(keyFor("buckets"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("BUCKET")
|
|
|
|
+ .ensureSize("BUCKETS", 8);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers coal and charcoal.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag COALS = new MaterialSetTag(keyFor("coals"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .add(Material.COAL, Material.CHARCOAL);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers both cobblestone wall variants.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag COBBLESTONE_WALLS = new MaterialSetTag(keyFor("cobblestone_walls"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("COBBLESTONE_WALL")
|
|
|
|
+ .ensureSize("COBBLESTONE_WALLS", 2);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers both cobblestone and mossy Cobblestone.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag COBBLESTONES = new MaterialSetTag(keyFor("cobblestones"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .add(Material.COBBLESTONE, Material.MOSSY_COBBLESTONE);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers all colors of concrete.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag CONCRETES = new MaterialSetTag(keyFor("concretes"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("_CONCRETE")
|
|
|
|
+ .ensureSize("CONCRETES", 16);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers all colors of concrete powder.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag CONCRETE_POWDER = new MaterialSetTag(keyFor("concrete_powder"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("_CONCRETE_POWDER")
|
|
|
|
+ .ensureSize("CONCRETE_POWDER", 16);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the two types of cooked fish.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag COOKED_FISH = new MaterialSetTag(keyFor("cooked_fish"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .add(Material.COOKED_COD, Material.COOKED_SALMON);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers all dyes.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag DYES = new MaterialSetTag(keyFor("dyes"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("_DYE")
|
|
|
|
+ .ensureSize("DYES", 16);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-06-25 04:33:35 +02:00
|
|
|
+ * Covers all variants of gates.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag FENCE_GATES = new MaterialSetTag(keyFor("fence_gates"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("_GATE")
|
2020-06-25 04:33:35 +02:00
|
|
|
+ .ensureSize("FENCE_GATES", 8);
|
2018-10-07 03:39:50 +02:00
|
|
|
+
|
|
|
|
+ /**
|
2020-06-25 04:33:35 +02:00
|
|
|
+ * Covers all variants of fences.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag FENCES = new MaterialSetTag(keyFor("fences"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("_FENCE")
|
2020-06-25 04:33:35 +02:00
|
|
|
+ .ensureSize("FENCES", 9);
|
2018-10-07 03:39:50 +02:00
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers all variants of fish buckets.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag FISH_BUCKETS = new MaterialSetTag(keyFor("fish_buckets"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .add(Material.COD_BUCKET, Material.PUFFERFISH_BUCKET, Material.SALMON_BUCKET, Material.TROPICAL_FISH_BUCKET);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the non-colored glass and 16 stained glass (not panes).
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag GLASS = new MaterialSetTag(keyFor("glass"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("_GLASS")
|
|
|
|
+ .add(Material.GLASS)
|
|
|
|
+ .ensureSize("GLASS", 17);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers the non-colored glass panes and stained glass panes (panes only).
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag GLASS_PANES = new MaterialSetTag(keyFor("glass_panes"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("GLASS_PANE")
|
|
|
|
+ .ensureSize("GLASS_PANES", 17);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers all glazed terracotta blocks.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag GLAZED_TERRACOTTA = new MaterialSetTag(keyFor("glazed_terracotta"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("GLAZED_TERRACOTTA")
|
|
|
|
+ .ensureSize("GLAZED_TERRACOTTA", 16);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers the colors of stained terracotta.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag STAINED_TERRACOTTA = new MaterialSetTag(keyFor("stained_terracotta"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("TERRACOTTA")
|
|
|
|
+ .not(Material.TERRACOTTA)
|
|
|
|
+ .notEndsWith("GLAZED_TERRACOTTA")
|
|
|
|
+ .ensureSize("STAINED_TERRACOTTA", 16);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers terracotta along with the stained variants.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag TERRACOTTA = new MaterialSetTag(keyFor("terracotta"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("TERRACOTTA")
|
|
|
|
+ .ensureSize("TERRACOTTA", 33);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers both golden apples.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag GOLDEN_APPLES = new MaterialSetTag(keyFor("golden_apples"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("GOLDEN_APPLE")
|
|
|
|
+ .ensureSize("GOLDEN_APPLES", 2);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers the variants of horse armor.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag HORSE_ARMORS = new MaterialSetTag(keyFor("horse_armors"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("_HORSE_ARMOR")
|
2019-04-23 06:47:07 +02:00
|
|
|
+ .ensureSize("HORSE_ARMORS", 4);
|
2018-10-07 03:39:50 +02:00
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers the variants of infested blocks.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag INFESTED_BLOCKS = new MaterialSetTag(keyFor("infested_blocks"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .startsWith("INFESTED_")
|
|
|
|
+ .ensureSize("INFESTED_BLOCKS", 6);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers the variants of mushroom blocks.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag MUSHROOM_BLOCKS = new MaterialSetTag(keyFor("mushroom_blocks"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("MUSHROOM_BLOCK")
|
|
|
|
+ .add(Material.MUSHROOM_STEM)
|
|
|
|
+ .ensureSize("MUSHROOM_BLOCKS", 3);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers all mushrooms.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag MUSHROOMS = new MaterialSetTag(keyFor("mushrooms"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .add(Material.BROWN_MUSHROOM, Material.RED_MUSHROOM);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-06-25 04:33:35 +02:00
|
|
|
+ * Covers all music disc items.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag MUSIC_DISCS = new MaterialSetTag(keyFor("music_discs"))
|
2020-06-25 04:33:35 +02:00
|
|
|
+ .startsWith("MUSIC_DISC_");
|
2018-10-07 03:39:50 +02:00
|
|
|
+
|
|
|
|
+ /**
|
2020-06-25 04:33:35 +02:00
|
|
|
+ * Covers all ores.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag ORES = new MaterialSetTag(keyFor("ores"))
|
2020-06-25 04:33:35 +02:00
|
|
|
+ .add(Material.ANCIENT_DEBRIS)
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("_ORE")
|
2020-06-25 04:33:35 +02:00
|
|
|
+ .ensureSize("ORES", 10);
|
2018-10-07 03:39:50 +02:00
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers all piston typed items and blocks including the piston head and moving piston.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag PISTONS = new MaterialSetTag(keyFor("pistons"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .contains("PISTON")
|
|
|
|
+ .ensureSize("PISTONS", 4);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers all potato items.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag POTATOES = new MaterialSetTag(keyFor("potatoes"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("POTATO")
|
|
|
|
+ .ensureSize("POTATOES", 3);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers all wooden pressure plates and the weighted pressure plates and the stone pressure plate.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag PRESSURE_PLATES = new MaterialSetTag(keyFor("pressure_plates"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("_PRESSURE_PLATE")
|
2020-06-25 04:33:35 +02:00
|
|
|
+ .ensureSize("PRESSURE_PLATES", 12);
|
2018-10-07 03:39:50 +02:00
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers the variants of prismarine blocks.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag PRISMARINE = new MaterialSetTag(keyFor("prismarine"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .add(Material.PRISMARINE, Material.PRISMARINE_BRICKS, Material.DARK_PRISMARINE);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers the variants of prismarine slabs.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag PRISMARINE_SLABS = new MaterialSetTag(keyFor("prismarine_slabs"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .add(Material.PRISMARINE_SLAB, Material.PRISMARINE_BRICK_SLAB, Material.DARK_PRISMARINE_SLAB);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers the variants of prismarine stairs.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag PRISMARINE_STAIRS = new MaterialSetTag(keyFor("prismarine_stairs"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .add(Material.PRISMARINE_STAIRS, Material.PRISMARINE_BRICK_STAIRS, Material.DARK_PRISMARINE_STAIRS);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers the variants of pumpkins.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag PUMPKINS = new MaterialSetTag(keyFor("pumpkins"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .add(Material.CARVED_PUMPKIN, Material.JACK_O_LANTERN, Material.PUMPKIN);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers the variants of quartz blocks.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag QUARTZ_BLOCKS = new MaterialSetTag(keyFor("quartz_blocks"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .add(Material.QUARTZ_BLOCK, Material.QUARTZ_PILLAR, Material.CHISELED_QUARTZ_BLOCK, Material.SMOOTH_QUARTZ);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers all uncooked fish items.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag RAW_FISH = new MaterialSetTag(keyFor("raw_fish"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .add(Material.COD, Material.PUFFERFISH, Material.SALMON, Material.TROPICAL_FISH);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers the variants of red sandstone blocks.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag RED_SANDSTONES = new MaterialSetTag(keyFor("red_sandstones"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("RED_SANDSTONE")
|
|
|
|
+ .ensureSize("RED_SANDSTONES", 4);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers the variants of sandstone blocks.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag SANDSTONES = new MaterialSetTag(keyFor("sandstones"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .add(Material.SANDSTONE, Material.CHISELED_SANDSTONE, Material.CUT_SANDSTONE, Material.SMOOTH_SANDSTONE);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers sponge and wet sponge.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag SPONGES = new MaterialSetTag(keyFor("sponges"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("SPONGE")
|
|
|
|
+ .ensureSize("SPONGES", 2);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers the non-colored and colored shulker boxes.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag SHULKER_BOXES = new MaterialSetTag(keyFor("shulker_boxes"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("SHULKER_BOX")
|
|
|
|
+ .ensureSize("SHULKER_BOXES", 17);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers zombie, creeper, skeleton, dragon, and player heads.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag SKULLS = new MaterialSetTag(keyFor("skulls"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("_HEAD")
|
|
|
|
+ .endsWith("_SKULL")
|
|
|
|
+ .not(Material.PISTON_HEAD)
|
|
|
|
+ .ensureSize("SKULLS", 12);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers all spawn egg items.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag SPAWN_EGGS = new MaterialSetTag(keyFor("spawn_eggs"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("_SPAWN_EGG")
|
2020-08-25 04:22:08 +02:00
|
|
|
+ .ensureSize("SPAWN_EGGS", 64);
|
2018-10-07 03:39:50 +02:00
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers all colors of stained glass.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag STAINED_GLASS = new MaterialSetTag(keyFor("stained_glass"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("_STAINED_GLASS")
|
|
|
|
+ .ensureSize("STAINED_GLASS", 16);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-07-02 05:02:07 +02:00
|
|
|
+ * Covers all colors of stained glass panes.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag STAINED_GLASS_PANES = new MaterialSetTag(keyFor("stained_glass_panes"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("STAINED_GLASS_PANE")
|
|
|
|
+ .ensureSize("STAINED_GLASS_PANES", 16);
|
|
|
|
+
|
|
|
|
+ /**
|
2020-06-25 04:33:35 +02:00
|
|
|
+ * Covers all variants of trapdoors.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag TRAPDOORS = new MaterialSetTag(keyFor("trapdoors"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("_TRAPDOOR")
|
2020-06-25 04:33:35 +02:00
|
|
|
+ .ensureSize("TRAPDOORS", 9);
|
2018-10-07 03:39:50 +02:00
|
|
|
+
|
|
|
|
+ /**
|
2020-06-25 04:33:35 +02:00
|
|
|
+ * Covers all wood variants of fences.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag WOODEN_FENCES = new MaterialSetTag(keyFor("wooden_fences"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("_FENCE")
|
|
|
|
+ .not(Material.NETHER_BRICK_FENCE)
|
2020-06-25 04:33:35 +02:00
|
|
|
+ .ensureSize("WOODEN_FENCES", 8);
|
2018-10-07 03:39:50 +02:00
|
|
|
+
|
|
|
|
+ /**
|
2020-06-25 04:33:35 +02:00
|
|
|
+ * Covers all wood variants of trapdoors.
|
2018-10-07 03:39:50 +02:00
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag WOODEN_TRAPDOORS = new MaterialSetTag(keyFor("wooden_trapdoors"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("_TRAPDOOR")
|
|
|
|
+ .not(Material.IRON_TRAPDOOR)
|
2020-06-25 04:33:35 +02:00
|
|
|
+ .ensureSize("WOODEN_TRAPDOORS", 8);
|
2018-10-07 03:39:50 +02:00
|
|
|
+
|
2020-07-02 05:02:07 +02:00
|
|
|
+ /**
|
|
|
|
+ * Covers the wood variants of gates.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag WOODEN_GATES = new MaterialSetTag(keyFor("wooden_gates"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .endsWith("_GATE")
|
2020-06-25 04:33:35 +02:00
|
|
|
+ .ensureSize("WOODEN_GATES", 8);
|
2018-10-07 03:39:50 +02:00
|
|
|
+
|
2020-07-02 05:02:07 +02:00
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of purpur.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag PURPUR = new MaterialSetTag(keyFor("purpur"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .startsWith("PURPUR_")
|
|
|
|
+ .ensureSize("PURPUR", 4);
|
|
|
|
+
|
2020-07-02 05:02:07 +02:00
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of signs.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag SIGNS = new MaterialSetTag(keyFor("signs"))
|
2019-04-23 06:47:07 +02:00
|
|
|
+ .endsWith("_SIGN")
|
2020-06-25 04:33:35 +02:00
|
|
|
+ .ensureSize("SIGNS", 16);
|
2018-10-07 03:39:50 +02:00
|
|
|
+
|
2020-07-02 05:02:07 +02:00
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of a regular torch.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag TORCH = new MaterialSetTag(keyFor("torch"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .add(Material.TORCH, Material.WALL_TORCH)
|
|
|
|
+ .ensureSize("TORCH", 2);
|
|
|
|
+
|
2020-07-02 05:02:07 +02:00
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of a redstone torch.
|
|
|
|
+ */
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag REDSTONE_TORCH = new MaterialSetTag(keyFor("restone_torch"))
|
2018-10-07 03:39:50 +02:00
|
|
|
+ .add(Material.REDSTONE_TORCH, Material.REDSTONE_WALL_TORCH)
|
|
|
|
+ .ensureSize("REDSTONE_TORCH", 2);
|
|
|
|
+
|
2020-07-02 05:02:07 +02:00
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of a soul torch.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag SOUL_TORCH = new MaterialSetTag(keyFor("soul_torch"))
|
|
|
|
+ .add(Material.SOUL_TORCH, Material.SOUL_WALL_TORCH)
|
|
|
|
+ .ensureSize("SOUL_TORCH", 2);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of torches.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag TORCHES = new MaterialSetTag(keyFor("torches"))
|
|
|
|
+ .add(TORCH, REDSTONE_TORCH, SOUL_TORCH)
|
|
|
|
+ .ensureSize("TORCHES", 6);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of lanterns.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag LANTERNS = new MaterialSetTag(keyFor("lanterns"))
|
|
|
|
+ .add(Material.LANTERN, Material.SOUL_LANTERN)
|
|
|
|
+ .ensureSize("LANTERNS", 2);
|
|
|
|
+
|
2020-07-22 08:20:57 +02:00
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of rails.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag RAILS = new MaterialSetTag(keyFor("rails"))
|
|
|
|
+ .endsWith("RAIL")
|
|
|
|
+ .ensureSize("RAILS", 4);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of swords.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag SWORDS = new MaterialSetTag(keyFor("swords"))
|
|
|
|
+ .endsWith("_SWORD")
|
|
|
|
+ .ensureSize("SWORDS", 6);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of shovels.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag SHOVELS = new MaterialSetTag(keyFor("shovels"))
|
|
|
|
+ .endsWith("_SHOVEL")
|
|
|
|
+ .ensureSize("SHOVELS", 6);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of pickaxes.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag PICKAXES = new MaterialSetTag(keyFor("pickaxes"))
|
|
|
|
+ .endsWith("_PICKAXE")
|
|
|
|
+ .ensureSize("PICKAXES", 6);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of axes.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag AXES = new MaterialSetTag(keyFor("axes"))
|
|
|
|
+ .endsWith("_AXE")
|
|
|
|
+ .ensureSize("AXES", 6);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of hoes.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag HOES = new MaterialSetTag(keyFor("hoes"))
|
|
|
|
+ .endsWith("_HOE")
|
|
|
|
+ .ensureSize("HOES", 6);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of helmets.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag HELMETS = new MaterialSetTag(keyFor("helmets"))
|
|
|
|
+ .endsWith("_HELMET")
|
|
|
|
+ .ensureSize("HELMETS", 7);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of items that can be equipped in the helmet slot.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag HEAD_EQUIPPABLE = new MaterialSetTag(keyFor("head_equippable"))
|
|
|
|
+ .endsWith("_HELMET")
|
|
|
|
+ .add(SKULLS)
|
|
|
|
+ .add(Material.CARVED_PUMPKIN)
|
|
|
|
+ .ensureSize("HEAD_EQUIPPABLE", 20);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of chestplate.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag CHESTPLATES = new MaterialSetTag(keyFor("chestplates"))
|
|
|
|
+ .endsWith("_CHESTPLATE")
|
|
|
|
+ .ensureSize("CHESTPLATES", 6);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of items that can be equipped in the chest slot.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag CHEST_EQUIPPABLE = new MaterialSetTag(keyFor("chest_equippable"))
|
|
|
|
+ .endsWith("_CHESTPLATE")
|
|
|
|
+ .add(Material.ELYTRA)
|
|
|
|
+ .ensureSize("CHEST_EQUIPPABLE", 7);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of leggings.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag LEGGINGS = new MaterialSetTag(keyFor("leggings"))
|
|
|
|
+ .endsWith("_LEGGINGS")
|
|
|
|
+ .ensureSize("LEGGINGS", 6);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of boots.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag BOOTS = new MaterialSetTag(keyFor("boots"))
|
|
|
|
+ .endsWith("_BOOTS")
|
|
|
|
+ .ensureSize("BOOTS", 6);
|
|
|
|
+
|
2020-07-28 05:05:54 +02:00
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of bows.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag BOWS = new MaterialSetTag(keyFor("bows"))
|
|
|
|
+ .add(Material.BOW)
|
|
|
|
+ .add(Material.CROSSBOW)
|
|
|
|
+ .ensureSize("BOWS", 2);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of player-throwable projectiles (not requiring a bow or any other "assistance").
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag THROWABLE_PROJECTILES = new MaterialSetTag(keyFor("throwable_projectiles"))
|
2020-07-28 05:15:22 +02:00
|
|
|
+ .add(Material.EGG, Material.SNOWBALL, Material.SPLASH_POTION, Material.TRIDENT, Material.ENDER_PEARL, Material.EXPERIENCE_BOTTLE, Material.FIREWORK_ROCKET);
|
2020-07-28 05:05:54 +02:00
|
|
|
+
|
2018-10-07 03:39:50 +02:00
|
|
|
+ @SuppressWarnings("unchecked")
|
2019-02-22 04:41:20 +01:00
|
|
|
+ public static final MaterialSetTag COLORABLE = new MaterialSetTag(keyFor("colorable"))
|
2018-10-11 05:39:36 +02:00
|
|
|
+ .add(Tag.WOOL, Tag.CARPETS).add(SHULKER_BOXES, STAINED_GLASS, STAINED_GLASS_PANES, CONCRETES, BEDS);
|
|
|
|
+ //.ensureSize("COLORABLE", 81); unit test don't have the vanilla item tags, so counts don't line up for real
|
2020-11-27 16:26:52 +01:00
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of coral.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag CORAL = new MaterialSetTag(keyFor("coral"))
|
|
|
|
+ .endsWith("_CORAL")
|
|
|
|
+ .ensureSize("CORAL", 10);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of coral fans.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag CORAL_FANS = new MaterialSetTag(keyFor("coral_fans"))
|
|
|
|
+ .endsWith("_CORAL_FAN")
|
|
|
|
+ .endsWith("_CORAL_WALL_FAN")
|
|
|
|
+ .ensureSize("CORAL_FANS", 20);
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Covers the variants of coral blocks.
|
|
|
|
+ */
|
|
|
|
+ public static final MaterialSetTag CORAL_BLOCKS = new MaterialSetTag(keyFor("coral_blocks"))
|
|
|
|
+ .endsWith("_CORAL_BLOCK")
|
|
|
|
+ .ensureSize("CORAL_BLOCKS", 10);
|
2018-10-07 03:39:50 +02:00
|
|
|
+}
|
|
|
|
diff --git a/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java b/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java
|
|
|
|
new file mode 100644
|
2020-05-06 11:48:49 +02:00
|
|
|
index 0000000000000000000000000000000000000000..328c51471dc12e81c1a1b643455337b3fef4d14a
|
2018-10-07 03:39:50 +02:00
|
|
|
--- /dev/null
|
|
|
|
+++ b/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java
|
2018-10-08 07:33:25 +02:00
|
|
|
@@ -0,0 +1,25 @@
|
2018-10-07 03:39:50 +02:00
|
|
|
+/*
|
|
|
|
+ * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+package com.destroystokyo.paper;
|
|
|
|
+
|
|
|
|
+import org.bukkit.Bukkit;
|
2018-10-08 07:33:25 +02:00
|
|
|
+import org.bukkit.TestServer;
|
2018-10-07 03:39:50 +02:00
|
|
|
+import org.junit.Test;
|
|
|
|
+
|
|
|
|
+import java.util.logging.Level;
|
|
|
|
+
|
|
|
|
+public class MaterialTagsTest {
|
|
|
|
+ @Test
|
|
|
|
+ public void testInitialize() {
|
|
|
|
+ try {
|
2018-10-08 07:33:25 +02:00
|
|
|
+ TestServer.getInstance();
|
2018-10-07 03:39:50 +02:00
|
|
|
+ MaterialTags.SHULKER_BOXES.getValues();
|
|
|
|
+ assert true;
|
|
|
|
+ } catch (Throwable e) {
|
|
|
|
+ Bukkit.getLogger().log(Level.SEVERE, e.getMessage(), e);
|
|
|
|
+ assert false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
diff --git a/src/test/java/org/bukkit/TestServer.java b/src/test/java/org/bukkit/TestServer.java
|
2020-05-06 11:48:49 +02:00
|
|
|
index 61993528e6975c38d82213e9b5caf996fe777328..5f9d348241210689eaf41a39ace5948e7a237b12 100644
|
2018-10-07 03:39:50 +02:00
|
|
|
--- a/src/test/java/org/bukkit/TestServer.java
|
|
|
|
+++ b/src/test/java/org/bukkit/TestServer.java
|
2019-05-06 04:58:04 +02:00
|
|
|
@@ -29,6 +29,16 @@ public final class TestServer implements InvocationHandler {
|
2018-10-07 03:39:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
+ // Paper start
|
|
|
|
+ methodMap.put(
|
|
|
|
+ Server.class.getMethod("getTag", String.class, NamespacedKey.class, Class.class),
|
|
|
|
+ new MethodHandler() {
|
|
|
|
+ public Object handle(TestServer server, Object[] args) {
|
|
|
|
+ return new com.destroystokyo.paper.MaterialSetTag();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ // Paper end
|
|
|
|
methodMap.put(
|
|
|
|
Server.class.getMethod("getPluginManager"),
|
|
|
|
new MethodHandler() {
|