Skip to content

Commit

Permalink
Update to 3.17
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanceSD committed Feb 24, 2024
1 parent 3e747cc commit 305b3f3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Artifact Information:
<dependency>
<groupId>me.NoChance.PvPManager</groupId>
<artifactId>pvpmanager</artifactId>
<version>3.16</version>
<version>3.17</version>
<scope>provided</scope>
</dependency>
```
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonar.organization>chancesd</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<revision>3.16</revision>
<revision>3.17</revision>
</properties>

<distributionManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ public Map<String, Integer> call() {
for (final Entry<Hook, Dependency> entry : plugin.getDependencyManager().getDependencies().entrySet()) {
valueMap.put(entry.getValue().getName(), 1);
}
final List<String> extra = Arrays.asList("TAB", "NametagEdit", "GriefPrevention", "RedProtect", "GriefDefender", "Citizens");
final List<String> extra = Arrays.asList("TAB", "NametagEdit", "GriefPrevention", "RedProtect", "GriefDefender", "Citizens",
"KingdomsX");
for (final String plugin : extra) {
if (Bukkit.getPluginManager().isPluginEnabled(plugin)) {
valueMap.put(plugin, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 305b3f3

Please sign in to comment.