Skip to content

Commit

Permalink
TODO: recode infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
NightDev701 committed Apr 4, 2024
1 parent 3899207 commit 2222d41
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 25 deletions.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
4 changes: 2 additions & 2 deletions .gradle/buildOutputCleanup/cache.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Sun Jul 02 14:20:27 CEST 2023
gradle.version=8.2
#Thu Apr 04 18:48:28 CEST 2024
gradle.version=8.7
Binary file removed API/json.jar
Binary file not shown.
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ repositories {
}

dependencies {
compileOnly("org.spigotmc:spigot-api:1.20.2-R0.1-SNAPSHOT")
compileOnly("org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT")
implementation 'org.jetbrains:annotations:23.0.0'
implementation files('API/json.jar')
}

java {
Expand All @@ -29,7 +28,6 @@ java {

jar {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from(zipTree("API/json.jar"))
from {
subprojects.collect { it.sourceSets.main.output }
}
Expand Down
22 changes: 2 additions & 20 deletions src/main/java/org/scorpion/api/HoneyAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;
import org.scorpion.user.HoneyUser;
import org.scorpion.util.Time;
import org.scorpion.util.file.FileManager;
import org.scorpion.util.user.User;

Expand Down Expand Up @@ -216,27 +213,12 @@ public static void sendTPA(Player sender, Player target) {
target.sendMessage(getPrefix() + "§7You have received a teleport request from §c" + sender.getName() + "§7!");
}

private static Object getWebData(String u, String data) {
try {
URL url = new URL(u);
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));

String line = reader.readLine();
JSONObject json = new JSONObject(line);
return json.getString(data);
} catch (Exception e) {
e.printStackTrace();
}
return "";
}

public static String getPluginVersion() {
return getWebData("https://sunlightscorpion.de/honey.json", "plugin").toString();
return null;
}

public static boolean needUpdate(String version) {
String current = getWebData("https://sunlightscorpion.de/honey.json", "plugin").toString();
return !current.equalsIgnoreCase(version);
return true;
}

public static boolean isSnapshot(String version) {
Expand Down

0 comments on commit 2222d41

Please sign in to comment.