diff --git a/README.md b/README.md index 852845b96..97b515935 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Artifact Information: me.NoChance.PvPManager pvpmanager - 3.16 + 3.17 provided ``` diff --git a/pom.xml b/pom.xml index ea96fbf43..031cd0d40 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ UTF-8 chancesd https://sonarcloud.io - 3.16 + 3.17 diff --git a/pvpmanager/src/main/java/me/NoChance/PvPManager/Libraries/Metrics/CustomMetrics.java b/pvpmanager/src/main/java/me/NoChance/PvPManager/Libraries/Metrics/CustomMetrics.java index c4ebc77a7..c146e0105 100644 --- a/pvpmanager/src/main/java/me/NoChance/PvPManager/Libraries/Metrics/CustomMetrics.java +++ b/pvpmanager/src/main/java/me/NoChance/PvPManager/Libraries/Metrics/CustomMetrics.java @@ -91,7 +91,8 @@ public Map call() { for (final Entry entry : plugin.getDependencyManager().getDependencies().entrySet()) { valueMap.put(entry.getValue().getName(), 1); } - final List extra = Arrays.asList("TAB", "NametagEdit", "GriefPrevention", "RedProtect", "GriefDefender", "Citizens"); + final List extra = Arrays.asList("TAB", "NametagEdit", "GriefPrevention", "RedProtect", "GriefDefender", "Citizens", + "KingdomsX"); for (final String plugin : extra) { if (Bukkit.getPluginManager().isPluginEnabled(plugin)) { valueMap.put(plugin, 1); diff --git a/pvpmanager/src/main/java/me/NoChance/PvPManager/Listeners/PlayerListener1_11.java b/pvpmanager/src/main/java/me/NoChance/PvPManager/Listeners/PlayerListener1_11.java index 4ee7cd2ca..7dcf9a163 100644 --- a/pvpmanager/src/main/java/me/NoChance/PvPManager/Listeners/PlayerListener1_11.java +++ b/pvpmanager/src/main/java/me/NoChance/PvPManager/Listeners/PlayerListener1_11.java @@ -41,7 +41,7 @@ public void onProjectileLaunchEvent(final ProjectileLaunchEvent event) { if (pvPlayer.isInCombat()) { if (cooldownsxHook != null) { cooldownsxHook.setEnderpearlCooldown(player, Settings.getEnderPearlCooldown()); - } + } // TODO add feedback while on cooldown ScheduleUtils.runPlatformTask(() -> player.setCooldown(Material.ENDER_PEARL, Settings.getEnderPearlCooldown() * 20), player); } } diff --git a/pvpmanager/src/main/java/me/chancesd/pvpmanager/managers/UpdateManager.java b/pvpmanager/src/main/java/me/chancesd/pvpmanager/managers/UpdateManager.java index 543aebc28..01e959201 100644 --- a/pvpmanager/src/main/java/me/chancesd/pvpmanager/managers/UpdateManager.java +++ b/pvpmanager/src/main/java/me/chancesd/pvpmanager/managers/UpdateManager.java @@ -8,6 +8,7 @@ import me.NoChance.PvPManager.PvPManager; import me.NoChance.PvPManager.Settings.Messages; import me.NoChance.PvPManager.Settings.Settings; +import me.NoChance.PvPManager.Utils.CombatUtils; import me.chancesd.pvpmanager.utils.ScheduleUtils; import me.chancesd.sdutils.updater.BukkitUpdater; import me.chancesd.sdutils.updater.SpigotUpdater; @@ -46,20 +47,28 @@ public void checkForUpdates() { if (updater.getResult() == UpdateResult.UPDATE_AVAILABLE) { Messages.setNewVersion(updater.getLatestName()); final String updateMsg = Messages.PREFIXMSG + " §aUpdate available: §c" + Messages.getNewVersion() + " §aCurrent version: §c" - + Messages.getCurrentversion(); + + Messages.getCurrentversion(); Messages.queueAdminMsg(updateMsg); Bukkit.broadcast(updateMsg, "pvpmanager.admin"); - if (Settings.isAutoUpdate()) { + if (Settings.isAutoUpdate() && CombatUtils.isVersionAtLeast(Messages.getNewVersion(), "4.0") + && !CombatUtils.isVersionAtLeast(Messages.getNewVersion(), "4.1")) { + final String v4message = Messages.PREFIXMSG + + " §aSince §b§lv4.0 is a huge update§a, it changes a lot of the config and messages file. " + + "This makes it unable to be automatically updated. " + + "Please §b§lmanually download the update§a from the link below and copy any settings you need from the old config."; + Messages.queueAdminMsg(v4message); + Bukkit.broadcast(v4message, "pvpmanager.admin"); + } else if (Settings.isAutoUpdate()) { if (updater.downloadFile()) { Messages.queueAdminMsg(Messages.PREFIXMSG + " §aUpdate downloaded, it will be applied automatically on the next server restart"); Bukkit.broadcast(Messages.PREFIXMSG + " §aUpdate downloaded to your update folder, it will be applied automatically on the next server restart", - "pvpmanager.admin"); + "pvpmanager.admin"); return; } Log.info("Could not download latest update. Please update manually from one of the links below."); } Settings.setUpdate(true); - final String linkMsg = Messages.PREFIXMSG + " §aFollow the link to download: §8" + updater.getUpdateLink(); + final String linkMsg = Messages.PREFIXMSG + " §aFollow the link to download: §7" + updater.getUpdateLink(); Messages.queueAdminMsg(linkMsg); Bukkit.broadcast(linkMsg, "pvpmanager.admin"); } else {