Skip to content

Commit

Permalink
add version read
Browse files Browse the repository at this point in the history
  • Loading branch information
NightDev701 committed Jan 11, 2025
1 parent ea527ef commit 7245f18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/java/org/scorpion/HoneyCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public void onEnable() {

HoneyAPI.manageLang();
HoneyAPI.initWarp();

System.out.println("!!! >>> " + HoneyAPI.getPluginVersion() +" <<< !!!");
}

}
6 changes: 5 additions & 1 deletion src/main/java/org/scorpion/api/HoneyAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import org.scorpion.user.HoneyUser;
import org.scorpion.util.file.FileManager;
import org.scorpion.util.user.User;
import pl.nightdev701.OpenAPI;
import pl.nightdev701.network.HttpRequestHandler;

import java.io.File;
import java.math.BigDecimal;
Expand Down Expand Up @@ -205,7 +207,9 @@ public static void sendTPA(Player sender, Player target) {
}

public static String getPluginVersion() {
return null;
HttpRequestHandler req = OpenAPI.getRequestHandler("https://sunlightscorpion.de/api/sunlightscorpion/honeycore.slsd");
req.request();
return req.getHtmlLines().getFirst();
}

public static boolean needUpdate(String version) {
Expand Down

0 comments on commit 7245f18

Please sign in to comment.