4
1
mirror of https://e.coding.net/circlecloud/MiaoChat.git synced 2024-12-22 19:18:47 +00:00

fix: BungeeCord未分配分组时报错

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
502647092 2017-05-21 12:03:36 +08:00
parent a6653ade3d
commit 6783da66f7
2 changed files with 10 additions and 7 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>pw.yumc</groupId> <groupId>pw.yumc</groupId>
<artifactId>MiaoChat</artifactId> <artifactId>MiaoChat</artifactId>
<version>1.8.1</version> <version>1.8.2</version>
<build> <build>
<finalName>${project.name}</finalName> <finalName>${project.name}</finalName>
<resources> <resources>
@ -70,8 +70,9 @@
<url>http://ci.yumc.pw/job/${project.artifactId}/</url> <url>http://ci.yumc.pw/job/${project.artifactId}/</url>
</ciManagement> </ciManagement>
<properties> <properties>
<update.description>§a正式版本 §b${project.version} §a版本</update.description> <update.description>§a正式版本 §bv${project.version}</update.description>
<update.changes> <update.changes>
§617-05-21 §c修复: BungeeCord未分配分组时报错;
§617-04-07 §c修复: 控制台重复输出聊天信息; §617-04-07 §c修复: 控制台重复输出聊天信息;
</update.changes> </update.changes>
<update.changelog> <update.changelog>

View File

@ -26,11 +26,13 @@ public class MiaoChatBungee extends Plugin implements Listener {
public void handle(final PluginMessageEvent event) { public void handle(final PluginMessageEvent event) {
if (event.getTag().equals(MiaoMessage.CHANNEL) || event.getTag().equals(MiaoMessage.NORMALCHANNEL)) { if (event.getTag().equals(MiaoMessage.CHANNEL) || event.getTag().equals(MiaoMessage.NORMALCHANNEL)) {
InetSocketAddress origin = event.getSender().getAddress(); InetSocketAddress origin = event.getSender().getAddress();
groups.get(origin).forEach(server -> { if (groups.containsKey(origin)) {
if (!server.getAddress().equals(origin) && server.getPlayers().size() > 0) { groups.get(origin).forEach(server -> {
server.sendData(event.getTag(), event.getData()); if (!server.getAddress().equals(origin) && server.getPlayers().size() > 0) {
} server.sendData(event.getTag(), event.getData());
}); }
});
}
} }
} }