Skip to content

Commit

Permalink
identify full ban correctly
Browse files Browse the repository at this point in the history
... under BanManager
  • Loading branch information
strumswell committed Sep 5, 2020
1 parent cc59a7a commit 0750012
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ServerlistMOTD
author: Strumswell
version: X-2020-05-14
version: X-2020-09-05
description: Change your Serverlist Motd!
load: POSTWORLD
depend: [ProtocolLib]
Expand Down
4 changes: 2 additions & 2 deletions src/cloud/bolte/serverlistmotd/motd/BanManagerMotd.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class BanManagerMotd implements Motd{

@Override
public String getMOTD(InetAddress ip) {
if (Long.valueOf(BmAPI.getCurrentBan(Main.IP_UUID.get(ip)).getExpires()) != null) {
if (BmAPI.getCurrentBan(Main.IP_UUID.get(ip)).getExpires() > 0.0) {
return SpigotConfig.getBanTempMotd();
} else {
return SpigotConfig.getBanForeverMotd();
Expand Down Expand Up @@ -86,7 +86,7 @@ public String formatMotd(String motd, InetAddress ip) {
*/
public void setServerlistMotd(ServerListPingEvent e, InetAddress ip) {
if (Main.IP_UUID.containsKey(ip) && BmAPI.isBanned(Main.IP_UUID.get(ip))) {
e.setMotd(formatMotd(getMOTD(ip), ip));
e.setMotd(formatMotd(getMOTD(ip), ip));
}
}
}

0 comments on commit 0750012

Please sign in to comment.