Skip to content

Commit 10f32d5

Browse files
committed
fixed updater
1 parent 0d402e7 commit 10f32d5

File tree

8 files changed

+5
-19
lines changed

8 files changed

+5
-19
lines changed

src/main/java/net/potato/tuff/TuffX.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public record WorldChunkKey(String worldName, int x, int z) {}
7777

7878
@Override
7979
public void onEnable() {
80-
System.out.println("UPDATED!!!");
80+
//System.out.println("UPDATED!!!");
8181
saveDefaultConfig();
8282
//saveResource("version.json", true);
8383
this.CHUNKS_PER_TICK = getConfig().getInt("chunks-per-tick", 6);

src/main/java/net/potato/tuff/Updater.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void run() {
3838

3939
private void checkForUpdates() {
4040
String localLatestVersion = currentVersion;
41-
41+
4242
String versionUrl = "https://verytuffautoupdater.netlify.app/version-remote.json";
4343

4444
try {
@@ -67,23 +67,9 @@ private void checkForUpdates() {
6767
plugin.getLogger().warning("An error occurred while checking for updates: " + e.getMessage());
6868
}
6969
}
70-
71-
private String getLocalLatestVersion() {
72-
try (InputStream in = plugin.getResource("version.json")) {
73-
if (in == null) {
74-
return "0.0.0";
75-
}
76-
InputStreamReader reader = new InputStreamReader(in);
77-
JsonObject json = JsonParser.parseReader(reader).getAsJsonObject();
78-
return json.get("version").getAsString();
79-
} catch (Exception e) {
80-
plugin.getLogger().warning("Could not read internal latest.json file.");
81-
return "0.0.0";
82-
}
83-
}
8470

8571
private boolean isNewer(String latest, String current) {
86-
return !latest.equalsIgnoreCase(current);
72+
return !latest.trim().equalsIgnoreCase(current);
8773
}
8874

8975
private void downloadUpdate(String url) {

target/TuffX.jar

-355 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
-684 Bytes
Binary file not shown.

target/classes/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: TuffX
2-
version: 1.0.3
2+
version: 1.0.4
33
main: net.potato.tuff.TuffX
44
author: Potato
55
api-version: 1.21

target/classes/version-remote.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"latestVersion": "1.0.3",
2+
"latestVersion": "1.0.4",
33
"downloadUrl": "https://verytuffautoupdater.netlify.app/TuffX.jar"
44
}

target/original-TuffX.jar

-355 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)