From 6783da66f7a5726da7d97ee9eca3adf47f63b735 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Sun, 21 May 2017 12:03:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20BungeeCord=E6=9C=AA=E5=88=86=E9=85=8D?= =?UTF-8?q?=E5=88=86=E7=BB=84=E6=97=B6=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- pom.xml | 5 +++-- src/main/java/pw/yumc/MiaoChat/MiaoChatBungee.java | 12 +++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index 4561c33..1373253 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 pw.yumc MiaoChat - 1.8.1 + 1.8.2 ${project.name} @@ -70,8 +70,9 @@ http://ci.yumc.pw/job/${project.artifactId}/ - §a正式版本 §b${project.version} §a版本 + §a正式版本 §bv${project.version} + §617-05-21 §c修复: BungeeCord未分配分组时报错; §617-04-07 §c修复: 控制台重复输出聊天信息; diff --git a/src/main/java/pw/yumc/MiaoChat/MiaoChatBungee.java b/src/main/java/pw/yumc/MiaoChat/MiaoChatBungee.java index 02b80ec..488e8a3 100644 --- a/src/main/java/pw/yumc/MiaoChat/MiaoChatBungee.java +++ b/src/main/java/pw/yumc/MiaoChat/MiaoChatBungee.java @@ -26,11 +26,13 @@ public class MiaoChatBungee extends Plugin implements Listener { public void handle(final PluginMessageEvent event) { if (event.getTag().equals(MiaoMessage.CHANNEL) || event.getTag().equals(MiaoMessage.NORMALCHANNEL)) { InetSocketAddress origin = event.getSender().getAddress(); - groups.get(origin).forEach(server -> { - if (!server.getAddress().equals(origin) && server.getPlayers().size() > 0) { - server.sendData(event.getTag(), event.getData()); - } - }); + if (groups.containsKey(origin)) { + groups.get(origin).forEach(server -> { + if (!server.getAddress().equals(origin) && server.getPlayers().size() > 0) { + server.sendData(event.getTag(), event.getData()); + } + }); + } } }