hyperlib updates

This commit is contained in:
hyperdefined
2025-08-06 19:09:13 -04:00
parent e48be6ba20
commit 613957fadf
2 changed files with 10 additions and 28 deletions

View File

@@ -111,7 +111,7 @@
<dependency> <dependency>
<groupId>com.github.hyperdefined</groupId> <groupId>com.github.hyperdefined</groupId>
<artifactId>hyperlib</artifactId> <artifactId>hyperlib</artifactId>
<version>1.0.2</version> <version>1.0.8</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@@ -18,10 +18,8 @@
package lol.hyper.toolstats; package lol.hyper.toolstats;
import lol.hyper.hyperlib.HyperLib; import lol.hyper.hyperlib.HyperLib;
import lol.hyper.hyperlib.bstats.bStats; import lol.hyper.hyperlib.bstats.HyperStats;
import lol.hyper.hyperlib.releases.hangar.HangarRelease; import lol.hyper.hyperlib.releases.HyperUpdater;
import lol.hyper.hyperlib.releases.modrinth.ModrinthPlugin;
import lol.hyper.hyperlib.releases.modrinth.ModrinthRelease;
import lol.hyper.hyperlib.utils.TextUtils; import lol.hyper.hyperlib.utils.TextUtils;
import lol.hyper.toolstats.commands.CommandToolStats; import lol.hyper.toolstats.commands.CommandToolStats;
import lol.hyper.toolstats.events.*; import lol.hyper.toolstats.events.*;
@@ -161,8 +159,8 @@ public final class ToolStats extends JavaPlugin {
hyperLib = new HyperLib(this); hyperLib = new HyperLib(this);
hyperLib.setup(); hyperLib.setup();
bStats bstats = new bStats(hyperLib, 14110); HyperStats stats = new HyperStats(hyperLib, 14110);
bstats.setup(); stats.setup();
textUtils = new TextUtils(hyperLib); textUtils = new TextUtils(hyperLib);
@@ -236,27 +234,11 @@ public final class ToolStats extends JavaPlugin {
this.getCommand("toolstats").setExecutor(commandToolStats); this.getCommand("toolstats").setExecutor(commandToolStats);
Bukkit.getAsyncScheduler().runNow(this, scheduledTask -> { HyperUpdater updater = new HyperUpdater(hyperLib);
ModrinthPlugin modrinthPlugin = new ModrinthPlugin("oBZj9E15"); updater.setGitHub("hyperdefined", "ToolStats");
modrinthPlugin.get(); updater.setModrinth("oBZj9E15");
updater.setHangar("ToolStats", "paper");
ModrinthRelease release = modrinthPlugin.getReleaseByVersion(this.getPluginMeta().getVersion()); updater.check();
if (release == null) {
logger.warning("You are running a version not published.");
} else {
int buildsBehind = modrinthPlugin.buildsVersionsBehind(release);
if (buildsBehind > 0) {
ModrinthRelease latest = modrinthPlugin.getLatestRelease();
if (latest != null) {
logger.info("You are " + buildsBehind + " versions behind. Please update!");
logger.info("The latest version is " + latest.getVersion());
logger.info(latest.getVersionPage());
}
} else {
logger.info("Yay! You are running the latest version.");
}
}
});
} }
public void loadConfig() { public void loadConfig() {