Fix an IllegalStateException related to restricted servers

This commit is contained in:
ME1312 2018-12-02 12:58:56 -05:00
parent 4e58e01ec4
commit 82dcc68023
No known key found for this signature in database
GPG Key ID: FEFFE2F698E88FA8
4 changed files with 6 additions and 4 deletions

View File

@ -724,7 +724,8 @@ public final class SubPlugin extends BungeeCord implements Listener {
if (!e.getTarget().canAccess(e.getPlayer())) {
e.setCancelled(true);
e.getPlayer().sendMessage(getTranslation("no_server_permission"));
if (e.getPlayer().getServer() != null) e.getPlayer().sendMessage(getTranslation("no_server_permission"));
else e.getPlayer().disconnect(getTranslation("no_server_permission"));
}
}

View File

@ -20,7 +20,7 @@
<dependency>
<groupId>net.ME1312.Galaxi</groupId>
<artifactId>GalaxiEngine</artifactId>
<version>18w47f</version>
<version>18w49a</version>
<scope>compile</scope>
</dependency>
<dependency>

View File

@ -244,7 +244,7 @@ public final class ExHost {
}
} catch (Exception e) {
log.error.println(e);
engine.stop();
engine.stop(1);
}
}

View File

@ -253,7 +253,8 @@ public final class SubPlugin extends BungeeCord implements Listener {
if (!e.getTarget().canAccess(e.getPlayer())) {
e.setCancelled(true);
e.getPlayer().sendMessage(getTranslation("no_server_permission"));
if (e.getPlayer().getServer() != null) e.getPlayer().sendMessage(getTranslation("no_server_permission"));
else e.getPlayer().disconnect(getTranslation("no_server_permission"));
}
}