mirror of
https://github.com/TotalFreedomMC/TF-LibsDisguises.git
synced 2025-02-05 06:12:48 +00:00
Guess I have to modify this after all
This commit is contained in:
parent
67a86ddcdd
commit
0cfa32159a
4 changed files with 6 additions and 21 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
*.iml
|
||||
.idea/
|
||||
target/
|
|
@ -253,9 +253,6 @@ public class DisguiseConfig {
|
|||
@Getter
|
||||
@Setter
|
||||
private static boolean saveUserPreferences;
|
||||
@Getter
|
||||
@Setter
|
||||
private static long lastUpdateRequest;
|
||||
|
||||
public static boolean isArmorstandsName() {
|
||||
return getPlayerNameType() == PlayerNameType.ARMORSTANDS;
|
||||
|
@ -314,20 +311,12 @@ public class DisguiseConfig {
|
|||
return;
|
||||
}
|
||||
|
||||
long timeSinceLast = System.currentTimeMillis() - (getLastUpdateRequest() + TimeUnit.HOURS.toMillis(6));
|
||||
|
||||
if (timeSinceLast > 0) {
|
||||
timeSinceLast /= 50;
|
||||
} else {
|
||||
timeSinceLast = 0;
|
||||
}
|
||||
|
||||
updaterTask = Bukkit.getScheduler().runTaskTimerAsynchronously(LibsDisguises.getInstance(), new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
LibsDisguises.getInstance().getUpdateChecker().doAutoUpdateCheck();
|
||||
}
|
||||
}, timeSinceLast, (20 * TimeUnit.HOURS.toSeconds(6))); // Check every 6 hours
|
||||
}, 0, (20 * TimeUnit.HOURS.toSeconds(6))); // Check every 6 hours
|
||||
}
|
||||
|
||||
public static void setUsingReleaseBuilds(boolean useReleaseBuilds) {
|
||||
|
@ -361,7 +350,6 @@ public class DisguiseConfig {
|
|||
bisectHosted = configuration.getBoolean("Bisect-Hosted", isBisectHosted());
|
||||
savedServerIp = configuration.getString("Server-IP", getSavedServerIp());
|
||||
usingReleaseBuild = configuration.getBoolean("ReleaseBuild", isUsingReleaseBuild());
|
||||
lastUpdateRequest = configuration.getLong("LastUpdateRequest", 0L);
|
||||
|
||||
if (!configuration.contains("Bisect-Hosted") || !configuration.contains("Server-IP") ||
|
||||
!configuration.contains("ReleaseBuild")) {
|
||||
|
@ -376,8 +364,7 @@ public class DisguiseConfig {
|
|||
.getResourceAsString(LibsDisguises.getInstance().getFile(), "internal.yml");
|
||||
|
||||
// Bisect hosted, server ip, release builds
|
||||
for (Object s : new Object[]{isBisectHosted(), getSavedServerIp(), isUsingReleaseBuild(),
|
||||
getLastUpdateRequest()}) {
|
||||
for (Object s : new Object[]{isBisectHosted(), getSavedServerIp(), isUsingReleaseBuild()}) {
|
||||
internalConfig = internalConfig.replaceFirst("%data%", "" + s);
|
||||
}
|
||||
|
||||
|
|
|
@ -156,9 +156,6 @@ public class UpdateChecker {
|
|||
}
|
||||
|
||||
public LibsMsg doUpdateCheck() {
|
||||
DisguiseConfig.setLastUpdateRequest(System.currentTimeMillis());
|
||||
DisguiseConfig.saveInternalConfig();
|
||||
|
||||
downloading.set(true);
|
||||
|
||||
try {
|
||||
|
|
|
@ -5,6 +5,4 @@
|
|||
Bisect-Hosted: %data%
|
||||
Server-IP: %data%
|
||||
# Should the plugin be doing release or dev builds updating?
|
||||
ReleaseBuild: %data%
|
||||
# Make sure the plugin aint spamming update requests
|
||||
LastUpdateCheck: %data%
|
||||
ReleaseBuild: %data%
|
Loading…
Reference in a new issue