diff --git a/Towny/src/main/java/com/palmergames/bukkit/towny/object/AbstractRegistryList.java b/Towny/src/main/java/com/palmergames/bukkit/towny/object/AbstractRegistryList.java index 7c626f6381..0f18a5dda5 100644 --- a/Towny/src/main/java/com/palmergames/bukkit/towny/object/AbstractRegistryList.java +++ b/Towny/src/main/java/com/palmergames/bukkit/towny/object/AbstractRegistryList.java @@ -2,11 +2,9 @@ import com.palmergames.bukkit.towny.TownyMessaging; import com.palmergames.bukkit.util.BukkitTools; -import com.palmergames.bukkit.util.ItemLists; import org.bukkit.Bukkit; import org.bukkit.Keyed; -import org.bukkit.Material; import org.bukkit.NamespacedKey; import org.bukkit.Registry; import org.bukkit.Tag; @@ -175,18 +173,12 @@ public Builder add(@NotNull String... names) { } /** - * Adds an entire ItemLists contents. - * @param itemList ItemLists to add. + * Adds an entire lists contents. + * @param list list to add. */ - public Builder addItemList(@NotNull ItemLists itemList) { - for (Material mat: itemList.tagged) { - final T match = BukkitTools.matchRegistry(this.registry, mat.name()); - if (match != null) - anyMatchPredicates.add(t -> t.equals(match)); - else { - TownyMessaging.sendDebugMsg("Expected element with name '" + mat.name() + "' was not found in the " + this.clazz.getSimpleName() + " registry."); - anyMatchPredicates.add(t -> false); - } + public Builder includeList(@NotNull AbstractRegistryList list) { + for (final T element : list.tagged) { + anyMatchPredicates.add(t -> t.equals(element)); } return this; diff --git a/Towny/src/main/java/com/palmergames/bukkit/util/ItemLists.java b/Towny/src/main/java/com/palmergames/bukkit/util/ItemLists.java index d3e5558704..2bec1c0ac3 100644 --- a/Towny/src/main/java/com/palmergames/bukkit/util/ItemLists.java +++ b/Towny/src/main/java/com/palmergames/bukkit/util/ItemLists.java @@ -295,10 +295,10 @@ public Collection getMaterialNameCollection() { .endsWith("RAIL") .endsWith("PUMPKIN_STEM").endsWith("MELON_STEM") .endsWith("_AMETHYST_BUD").add("AMETHYST_CLUSTER") - .addItemList(FLOWERS) - .addItemList(SAPLINGS) - .addItemList(PRESSURE_PLATES) - .addItemList(WOOD_DOORS) + .includeList(FLOWERS) + .includeList(SAPLINGS) + .includeList(PRESSURE_PLATES) + .includeList(WOOD_DOORS) .build(); /**