From 58c0e9bbf476fcdbd1170f548e7f7c79c06afd19 Mon Sep 17 00:00:00 2001 From: TiyaAnlite Date: Mon, 24 Jun 2024 19:03:32 +0800 Subject: [PATCH] =?UTF-8?q?nats.server=E6=B7=BB=E5=8A=A0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=80=BC=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=B8=BB=E9=A2=98=E6=8B=BC?= =?UTF-8?q?=E6=8E=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cn/focot/codelab/minecodecraft/ConfigBean.java | 2 +- .../java/cn/focot/codelab/minecodecraft/event/EventMsg.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/cn/focot/codelab/minecodecraft/ConfigBean.java b/src/main/java/cn/focot/codelab/minecodecraft/ConfigBean.java index d0da148..a00c12e 100644 --- a/src/main/java/cn/focot/codelab/minecodecraft/ConfigBean.java +++ b/src/main/java/cn/focot/codelab/minecodecraft/ConfigBean.java @@ -42,7 +42,7 @@ public class Tips { } public class Nats { - public String server; + public String server = ""; public String prefix = "minecodecraft"; } } diff --git a/src/main/java/cn/focot/codelab/minecodecraft/event/EventMsg.java b/src/main/java/cn/focot/codelab/minecodecraft/event/EventMsg.java index 877e275..f1e7235 100644 --- a/src/main/java/cn/focot/codelab/minecodecraft/event/EventMsg.java +++ b/src/main/java/cn/focot/codelab/minecodecraft/event/EventMsg.java @@ -20,7 +20,9 @@ public byte[] toBytes() { public void publish() { if (MineCodeCraftMod.hasNatsConnection()) { MineCodeCraftMod.getNatsConnection().publish( - new StringJoiner(MineCodeCraftMod.getConfig().getConfigBean().nats.prefix, ".", this.msgSubject).toString(), + new StringJoiner("."). + add(MineCodeCraftMod.getConfig().getConfigBean().nats.prefix). + add(this.msgSubject).toString(), this.toBytes()); } };