Skip to content

Commit 486680b

Browse files
committed
temp patch - comment out nbt list tag type validation
1 parent 6be67d0 commit 486680b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

plugin/src/main/java/com/denizenscript/denizen/nms/util/jnbt/ListTagBuilder.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ public ListTagBuilder(Class<? extends Tag> type) {
5151
*/
5252
public ListTagBuilder add(Tag value) {
5353
checkNotNull(value);
54-
if (!type.isInstance(value)) {
54+
// Denizen - list tags are no longer necessarily single-typed. This API is old enough to probably need replacement.
55+
/*if (!type.isInstance(value)) {
5556
throw new IllegalArgumentException(value.getClass().getCanonicalName() + " is not of expected type " + type.getCanonicalName());
56-
}
57+
}*/
5758
entries.add(value);
5859
return this;
5960
}
@@ -103,11 +104,11 @@ public static <T extends Tag> ListTagBuilder createWith(T... entries) {
103104
}
104105

105106
Class<? extends Tag> type = entries[0].getClass();
106-
for (int i = 1; i < entries.length; i++) {
107+
/*for (int i = 1; i < entries.length; i++) { // Denizen - disable check
107108
if (!type.isInstance(entries[i])) {
108109
throw new IllegalArgumentException("An array of different tag types was provided");
109110
}
110-
}
111+
}*/
111112

112113
ListTagBuilder builder = new ListTagBuilder(type);
113114
builder.addAll(Arrays.asList(entries));

0 commit comments

Comments
 (0)