Don't marshal SetFlag in FlagHelperBox.

This commit is contained in:
wizjany 2020-11-17 18:24:06 -05:00
parent e98196af40
commit 8350267b10

View File

@ -359,11 +359,9 @@ private <V> void appendSetFlagValue(TextComponent.Builder builder, SetFlag<V> fl
if (currVal == null) { if (currVal == null) {
currVal = getInheritedValue(region, flag); currVal = getInheritedValue(region, flag);
} }
@SuppressWarnings("unchecked")
List<V> values = currVal == null ? Collections.emptyList() : (List<V>) flag.marshal(currVal);
String display = (currVal == null ? "" : currVal.size() + "x ") + subName; String display = (currVal == null ? "" : currVal.size() + "x ") + subName;
final String stringValue = currVal == null ? "" final String stringValue = currVal == null ? ""
: values.stream().map(String::valueOf).collect(Collectors.joining(",")); : currVal.stream().map(String::valueOf).collect(Collectors.joining(","));
TextComponent hoverComp = TextComponent.of(""); TextComponent hoverComp = TextComponent.of("");
if (currVal != null) { if (currVal != null) {
hoverComp = hoverComp.append(TextComponent.of("Current values:")) hoverComp = hoverComp.append(TextComponent.of("Current values:"))