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()); } };