fix BaseTag constructor (#5095)

This commit is contained in:
Jake Potrebic 2021-01-21 10:57:13 -08:00 committed by GitHub
parent 8fa15382bd
commit e9a87b72be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -675,10 +675,10 @@ index 0000000000000000000000000000000000000000..3f36165d89ae4aaa153dcb9ddbb8c58a
+} +}
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
index 0000000000000000000000000000000000000000..c8777d2298c80c9579635000044e2d0a987cc15b index 0000000000000000000000000000000000000000..4b8552e4e4c07b197fa9431fa911535b0222561e
--- /dev/null --- /dev/null
+++ b/src/main/java/io/papermc/paper/tag/BaseTag.java +++ b/src/main/java/io/papermc/paper/tag/BaseTag.java
@@ -0,0 +1,159 @@ @@ -0,0 +1,160 @@
+package io.papermc.paper.tag; +package io.papermc.paper.tag;
+ +
+import com.google.common.collect.Lists; +import com.google.common.collect.Lists;
@ -717,6 +717,7 @@ index 0000000000000000000000000000000000000000..c8777d2298c80c9579635000044e2d0a
+ public BaseTag(@NotNull Class<T> clazz, @NotNull NamespacedKey key, @NotNull Collection<T> values, @NotNull Predicate<T>... globalPredicates) { + public BaseTag(@NotNull Class<T> clazz, @NotNull NamespacedKey key, @NotNull Collection<T> values, @NotNull Predicate<T>... globalPredicates) {
+ this.key = key != null ? key : NamespacedKey.randomKey(); + this.key = key != null ? key : NamespacedKey.randomKey();
+ this.tagged = clazz.isEnum() ? createEnumSet(clazz) : new HashSet<>(); + this.tagged = clazz.isEnum() ? createEnumSet(clazz) : new HashSet<>();
+ this.tagged.addAll(values);
+ this.globalPredicates = Lists.newArrayList(globalPredicates); + this.globalPredicates = Lists.newArrayList(globalPredicates);
+ } + }
+ +