Use for loop for hopper counter info in HUDController

This commit is contained in:
altrisi authored and GitHub committed 2023-04-08 16:12:38 +02:00
1 parent d5cd0331b3
commit a3762584f3
1 file changed
+5 -4
@@ -132,13 +132,14 @@ public class HUDController
"g MSPT: ", String.format(Locale.US,"%s %.1f", color, MSPT))};
}
private static Component [] send_counter_info(MinecraftServer server, String color)
private static Component[] send_counter_info(MinecraftServer server, String colors)
{
List <Component> res = new ArrayList<>();
Arrays.asList(color.split(",")).forEach(c ->{
HopperCounter counter = HopperCounter.getCounter(c);
for (String color : colors.split(","))
{
HopperCounter counter = HopperCounter.getCounter(color);
if (counter != null) res.addAll(counter.format(server, false, true));
});
}
return res.toArray(new Component[0]);
}
private static Component [] packetCounter()