From e635d42c9a5148625670d3acfc1c623de65bb6a7 Mon Sep 17 00:00:00 2001 From: caseload <89719855+CASELOAD7000@users.noreply.github.com> Date: Thu, 3 Oct 2024 21:57:54 -0500 Subject: [PATCH] update 1.3.2 --- pom.xml | 2 +- src/main/java/me/caseload/knockbacksync/KnockbackSync.java | 4 +++- .../knockbacksync/listener/PlayerJoinQuitListener.java | 2 +- .../java/me/caseload/knockbacksync/manager/PlayerData.java | 2 +- src/main/resources/config.yml | 2 +- src/main/resources/plugin.yml | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 0283729..51567e5 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ me.caseload KnockbackSync - 1.3 + 1.3.2 jar KnockbackSync diff --git a/src/main/java/me/caseload/knockbacksync/KnockbackSync.java b/src/main/java/me/caseload/knockbacksync/KnockbackSync.java index a37cb52..ef606ce 100644 --- a/src/main/java/me/caseload/knockbacksync/KnockbackSync.java +++ b/src/main/java/me/caseload/knockbacksync/KnockbackSync.java @@ -22,6 +22,7 @@ public final class KnockbackSync extends JavaPlugin { private boolean toggled; private boolean runnable; private boolean updateAvailable; + private boolean notifyUpdate; private long runnableInterval; private long combatTimer; @@ -58,7 +59,8 @@ public void onEnable() { runnable = getConfig().getBoolean("runnable.enabled", true); runnableInterval = getConfig().getLong("runnable.interval", 5L); combatTimer = getConfig().getLong("runnable.timer", 30L); - spikeThreshold = getConfig().getLong("spike_threshold", 25L); + spikeThreshold = getConfig().getLong("spike_threshold", 20L); + notifyUpdate = getConfig().getBoolean("notify_updates", true); if (runnable) new PingRunnable().runTaskTimerAsynchronously(this, 0L, runnableInterval); diff --git a/src/main/java/me/caseload/knockbacksync/listener/PlayerJoinQuitListener.java b/src/main/java/me/caseload/knockbacksync/listener/PlayerJoinQuitListener.java index 4a7069f..3476fd8 100644 --- a/src/main/java/me/caseload/knockbacksync/listener/PlayerJoinQuitListener.java +++ b/src/main/java/me/caseload/knockbacksync/listener/PlayerJoinQuitListener.java @@ -19,7 +19,7 @@ public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); PlayerDataManager.addPlayerData(player.getUniqueId(), new PlayerData(player)); - if (KnockbackSync.getInstance().isUpdateAvailable() && player.hasPermission("knockbacksync.update")) + if (KnockbackSync.getInstance().isUpdateAvailable() && KnockbackSync.getInstance().isNotifyUpdate() && player.hasPermission("knockbacksync.update")) player.sendMessage(ChatColor.translateAlternateColorCodes( '&', "&6An updated version of &eKnockbackSync &6is now available for download at: &bhttps://github.com/CASELOAD7000/knockback-sync/releases/latest" diff --git a/src/main/java/me/caseload/knockbacksync/manager/PlayerData.java b/src/main/java/me/caseload/knockbacksync/manager/PlayerData.java index 994a4f8..5df9df0 100644 --- a/src/main/java/me/caseload/knockbacksync/manager/PlayerData.java +++ b/src/main/java/me/caseload/knockbacksync/manager/PlayerData.java @@ -29,7 +29,7 @@ public class PlayerData { private final Player player; // Please read the GitHub FAQ before adjusting. - private static final long PING_OFFSET = 20; + private static final long PING_OFFSET = 25; @NotNull private final Map timeline = new HashMap<>(); diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 31cbe77..e78a440 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -21,7 +21,7 @@ runnable: # The minimum change in ping required for it to be considered a lag spike. # If the difference between the latest and previous ping is greater than or equal to # the threshold, the previous ping value is used to avoid calculation inaccuracies. -spike_threshold: 25 +spike_threshold: 20 enable_message: "&aSuccessfully enabled KnockbackSync." disable_message: "&cSuccessfully disabled KnockbackSync." \ No newline at end of file diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 1bbfdb5..19dc628 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,5 +1,5 @@ name: KnockbackSync -version: '1.3' +version: '1.3.2' main: me.caseload.knockbacksync.KnockbackSync api-version: '1.18' authors: [ Caseload ]