Fix error and update to Java 17

This commit is contained in:
Braydon 2024-04-26 15:08:23 -04:00
parent 1962110dbd
commit a2615ac96a
2 changed files with 6 additions and 4 deletions

@ -11,7 +11,7 @@
<!-- Properties --> <!-- Properties -->
<properties> <properties>
<java.version>8</java.version> <java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target> <maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

@ -8,6 +8,7 @@ import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent; import net.kyori.adventure.text.TextComponent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.ThreadLocalRandom;
@ -49,9 +50,10 @@ public final class ServerPingListener {
)); ));
// Update the mod info // Update the mod info
ModInfo modInfo = ping.getModinfo().orElse(ModInfo.DEFAULT); ModInfo modInfo = new ModInfo(ModInfo.DEFAULT.getType(), Arrays.asList(
modInfo.getMods().add(new ModInfo.Mod("bob", "1.0")); new ModInfo.Mod("bob", "1.0"),
modInfo.getMods().add(new ModInfo.Mod("ross", "1.0")); new ModInfo.Mod("ross", "1.0")
));
// Set the ping response // Set the ping response
event.setPing(new ServerPing(version, players, motd, ping.getFavicon().orElse(null), modInfo)); event.setPing(new ServerPing(version, players, motd, ping.getFavicon().orElse(null), modInfo));