File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed
bukkit-utils/src/main/java/com/wizardlybump17/wlib/util/bukkit/collector Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change 33import net .kyori .adventure .text .Component ;
44import org .jetbrains .annotations .NotNull ;
55
6- import java .util .Objects ;
76import java .util .Set ;
87import java .util .function .BiConsumer ;
98import java .util .function .BinaryOperator ;
@@ -25,33 +24,25 @@ public ComponentCollector(@NotNull Component separator) {
2524
2625 @ Override
2726 public @ NotNull Supplier <Component []> supplier () {
28- return () -> new Component [1 ] ;
27+ return () -> new Component [] { Component . empty ()} ;
2928 }
3029
3130 @ Override
3231 public @ NotNull BiConsumer <Component [], Component > accumulator () {
33- return (array , component ) -> {
34- if (array [0 ] == null )
35- array [0 ] = component ;
36- else
37- array [0 ] = array [0 ].append (separator ).append (component );
38- };
32+ return (array , component ) -> array [0 ] = array [0 ].append (separator ).append (component );
3933 }
4034
4135 @ Override
4236 public @ NotNull BinaryOperator <Component []> combiner () {
4337 return (left , right ) -> {
44- if (left [0 ] == null )
45- left [0 ] = right [0 ];
46- else
47- left [0 ] = left [0 ].append (separator ).append (right [0 ]);
38+ left [0 ] = left [0 ].append (separator ).append (right [0 ]);
4839 return left ;
4940 };
5041 }
5142
5243 @ Override
5344 public @ NotNull Function <Component [], Component > finisher () {
54- return array -> Objects . requireNonNullElseGet ( array [0 ], Component :: empty ) ;
45+ return array -> array [0 ];
5546 }
5647
5748 @ Override
You can’t perform that action at this time.
0 commit comments