diff options
Diffstat (limited to 'common')
3 files changed, 12 insertions, 18 deletions
diff --git a/common/build.gradle b/common/build.gradle index 1bc4def..a46e152 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -24,22 +24,8 @@ processResources { } -def targetJavaVersion = 17 -tasks.withType(JavaCompile).configureEach { - // Ensure that the encoding is set to UTF-8. - it.options.encoding = "UTF-8" - if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) { - it.options.release = targetJavaVersion - } -} - +java.toolchain.languageVersion.set(JavaLanguageVersion.of(8)) java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - def javaVersion = JavaVersion.toVersion(targetJavaVersion) - if (JavaVersion.current() < javaVersion) { - toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) - } archivesBaseName = project.archives_base_name } diff --git a/common/src/main/java/de/hype/bbsentials/common/client/DebugThread.java b/common/src/main/java/de/hype/bbsentials/common/client/DebugThread.java index d51fcec..eaf3ee1 100644 --- a/common/src/main/java/de/hype/bbsentials/common/client/DebugThread.java +++ b/common/src/main/java/de/hype/bbsentials/common/client/DebugThread.java @@ -1,13 +1,14 @@ package de.hype.bbsentials.common.client; +import java.util.Collections; import java.util.List; public interface DebugThread extends Runnable { @Override public default void run() { - loop(); + loop(); //place a breakpoint for only this thread here. } @@ -15,6 +16,6 @@ public interface DebugThread extends Runnable { } public default List<String> test() { - return List.of(""); + return Collections.singletonList(""); } } diff --git a/common/src/main/java/de/hype/bbsentials/common/communication/BBsentialConnection.java b/common/src/main/java/de/hype/bbsentials/common/communication/BBsentialConnection.java index 76ee4bd..6dd9edb 100644 --- a/common/src/main/java/de/hype/bbsentials/common/communication/BBsentialConnection.java +++ b/common/src/main/java/de/hype/bbsentials/common/communication/BBsentialConnection.java @@ -29,6 +29,7 @@ import java.security.cert.X509Certificate; import java.util.Arrays; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; public class BBsentialConnection { private Socket socket; @@ -325,7 +326,13 @@ public class BBsentialConnection { if (isCommandSafe(packet.bbcommand)) { if (showChChest(packet.items)) { String tellrawText = ("{\"text\":\"BB: @username found @item in a chest at (@coords). Click here to get a party invite @extramessage\",\"color\":\"green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"@inviteCommand\"},\"hoverEvent\":{\"action\":\"show_text\",\"contents\":[\"On clicking you will get invited to a party. Command executed: @inviteCommand\"]}}"); - tellrawText = tellrawText.replace("@username", packet.announcerUsername).replace("@item", Arrays.stream(packet.items).map(ChChestItem::getDisplayName).toList().toString()).replace("@coords", packet.locationCoords).replace("@inviteCommand", packet.bbcommand); + tellrawText = tellrawText.replace("@username", packet.announcerUsername); + tellrawText = tellrawText.replace("@item", Arrays.stream(packet.items) + .map(ChChestItem::getDisplayName) + .collect(Collectors.toList()) + .toString()); + tellrawText = tellrawText.replace("@coords", packet.locationCoords); + tellrawText = tellrawText.replace("@inviteCommand", packet.bbcommand); if (!(packet.extraMessage == null || packet.extraMessage.isEmpty())) { tellrawText = tellrawText.replace("@extramessage", " : " + packet.extraMessage); } |