diff options
author | HacktheTime <l4bg0jb7@duck.com> | 2023-10-14 12:10:15 +0200 |
---|---|---|
committer | HacktheTime <l4bg0jb7@duck.com> | 2023-10-14 12:10:15 +0200 |
commit | 77fb80356b42260a95610aa5971d2b03d8d30e1d (patch) | |
tree | 6d9892029e1f682e357811e61f3632ade2615aec /common | |
parent | 764cd84919c5b30a6bb0e6ec2e32feba07633ebf (diff) | |
download | BBsentials-77fb80356b42260a95610aa5971d2b03d8d30e1d.tar.gz BBsentials-77fb80356b42260a95610aa5971d2b03d8d30e1d.tar.bz2 BBsentials-77fb80356b42260a95610aa5971d2b03d8d30e1d.zip |
more changes
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); } |