From 955672b620fc17b8a5859e38e0f58dd04c0f3dc9 Mon Sep 17 00:00:00 2001 From: xishift Date: Mon, 13 Jul 2020 16:21:32 +0200 Subject: [PATCH] Small fix - Release 5.0.2 Former-commit-id: b3603c39ce561e3d6a0283b60fb0a8c9651a228e --- .../bukkit/command/EpicGuardCommand.java | 17 +++++++++++------ .../bungee/command/EpicGuardCommand.java | 19 ++++++++++++------- .../epicguard/core/manager/GeoManager.java | 2 +- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/main/java/me/ishift/epicguard/bukkit/command/EpicGuardCommand.java b/src/main/java/me/ishift/epicguard/bukkit/command/EpicGuardCommand.java index 90bf1dfa..610c5288 100644 --- a/src/main/java/me/ishift/epicguard/bukkit/command/EpicGuardCommand.java +++ b/src/main/java/me/ishift/epicguard/bukkit/command/EpicGuardCommand.java @@ -28,7 +28,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command send(sender, " &7Version: &f" + this.epicGuard.getVersion()); if (UpdateChecker.isAvailable()) { send(sender, ""); - send(sender, " &7Update available: &c&n" + UpdateChecker.getRemoteVersion()); + send(sender, " &7New version is available: &c&n" + UpdateChecker.getRemoteVersion()); send(sender, " &c&ohttps://www.spigotmc.org/resources/72369/"); } send(sender, ""); @@ -49,12 +49,17 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command switch (args[0]) { case "stats": send(sender, "&8&m---------------------------------------------------"); - send(sender, " &6&lEpicGuard &8- &7Statistics)"); - send(sender, ""); - send(sender, " &8• &7Blacklisted IPs: &6" + this.epicGuard.getStorageManager().getBlacklist().size()); - send(sender, " &8• &7Whitelisted IPs: &6" + this.epicGuard.getStorageManager().getWhitelist().size()); + send(sender, " &6&lEpicGuard &7(Statistics)"); + send(sender, " &7Version: &f" + this.epicGuard.getVersion()); + if (UpdateChecker.isAvailable()) { + send(sender, ""); + send(sender, " &7New version is available: &c&n" + UpdateChecker.getRemoteVersion()); + send(sender, " &c&ohttps://www.spigotmc.org/resources/72369/"); + } send(sender, ""); - send(sender, " &8• &7Connections/s: &6" + this.epicGuard.getConnectionPerSecond()); + send(sender, " &8• &7Blacklisted IPs: &c&l" + this.epicGuard.getStorageManager().getBlacklist().size()); + send(sender, " &8• &7Whitelisted IPs: &a&l" + this.epicGuard.getStorageManager().getWhitelist().size()); + send(sender, " &8• &7Connections: &6&l" + this.epicGuard.getConnectionPerSecond() + "/s"); send(sender, ""); send(sender, "&8&m---------------------------------------------------"); break; diff --git a/src/main/java/me/ishift/epicguard/bungee/command/EpicGuardCommand.java b/src/main/java/me/ishift/epicguard/bungee/command/EpicGuardCommand.java index ec000158..b55bca10 100644 --- a/src/main/java/me/ishift/epicguard/bungee/command/EpicGuardCommand.java +++ b/src/main/java/me/ishift/epicguard/bungee/command/EpicGuardCommand.java @@ -24,11 +24,11 @@ public void execute(CommandSender sender, String[] args) { String prefix = this.epicGuard.getMessages().prefix; if (args.length < 1) { send(sender, "&8&m---------------------------------------------------"); - send(sender, " &6&lEpicGuard &8(Spigot version)"); + send(sender, " &6&lEpicGuard &8(BungeeCord version)"); send(sender, " &7Version: &f" + this.epicGuard.getVersion()); if (UpdateChecker.isAvailable()) { send(sender, ""); - send(sender, " &7Update available: &c&n" + UpdateChecker.getRemoteVersion()); + send(sender, " &7New version is available: &c&n" + UpdateChecker.getRemoteVersion()); send(sender, " &c&ohttps://www.spigotmc.org/resources/72369/"); } send(sender, ""); @@ -44,12 +44,17 @@ public void execute(CommandSender sender, String[] args) { switch (args[0]) { case "stats": send(sender, "&8&m---------------------------------------------------"); - send(sender, " &6&lEpicGuard &8- &7Statistics)"); - send(sender, ""); - send(sender, prefix + "&7Blacklisted IPs: &6" + this.epicGuard.getStorageManager().getBlacklist().size()); - send(sender, prefix + "&7Whitelisted IPs: &6" + this.epicGuard.getStorageManager().getWhitelist().size()); + send(sender, " &6&lEpicGuard &7(Statistics)"); + send(sender, " &7Version: &f" + this.epicGuard.getVersion()); + if (UpdateChecker.isAvailable()) { + send(sender, ""); + send(sender, " &7New version is available: &c&n" + UpdateChecker.getRemoteVersion()); + send(sender, " &c&ohttps://www.spigotmc.org/resources/72369/"); + } send(sender, ""); - send(sender, " &8• &7Connections/s: &6" + this.epicGuard.getConnectionPerSecond()); + send(sender, " &8• &7Blacklisted IPs: &c&l" + this.epicGuard.getStorageManager().getBlacklist().size()); + send(sender, " &8• &7Whitelisted IPs: &a&l" + this.epicGuard.getStorageManager().getWhitelist().size()); + send(sender, " &8• &7Connections: &6&l" + this.epicGuard.getConnectionPerSecond() + "/s"); send(sender, ""); send(sender, "&8&m---------------------------------------------------"); break; diff --git a/src/main/java/me/ishift/epicguard/core/manager/GeoManager.java b/src/main/java/me/ishift/epicguard/core/manager/GeoManager.java index d49a0a1d..9b4f1341 100644 --- a/src/main/java/me/ishift/epicguard/core/manager/GeoManager.java +++ b/src/main/java/me/ishift/epicguard/core/manager/GeoManager.java @@ -37,7 +37,7 @@ public GeoManager(EpicGuard epicGuard) { if (this.shouldDownload(cityDatabase)) { this.epicGuard.getLogger().info("Your city database is outdated, starting download operation..."); - //FileUtils.downloadFile("https://github.com/xishift/EpicGuard/raw/master/files/GeoLite2-City.mmdb", cityDatabase); + FileUtils.downloadFile("https://github.com/xishift/EpicGuard/raw/master/files/GeoLite2-City.mmdb", cityDatabase); } try {