Skip to content

Commit

Permalink
1.5
Browse files Browse the repository at this point in the history
- Updated to 1.19.3
  • Loading branch information
MrTronMan committed Dec 12, 2022
1 parent 4eee7e1 commit ee69e0e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.tronmc.beta</groupId>
<artifactId>Amend</artifactId>
<version>1.4.2--V.1.19.2</version>
<version>1.5--V.1.19.3</version>
<packaging>jar</packaging>
<name>Amend</name>

Expand Down
16 changes: 8 additions & 8 deletions src/main/java/com/tronmc/beta/amend/Amend.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void onEnable() {
}

//Update Checker that checks our API for the latest using a handy dependency called SpigotUpdateChecker.
new UpdateChecker(this, UpdateCheckSource.CUSTOM_URL, "https://api.tronmc.com/amend/versions/1.19.2") // A link to a URL that contains the latest version as String
new UpdateChecker(this, UpdateCheckSource.CUSTOM_URL, "https://api.tronmc.com/amend/versions/1.19.3") // A link to a URL that contains the latest version as String
.setDownloadLink("https://amend.mrtron.dev/download") // You can either use a custom URL or the Spigot Resource ID
.setNotifyOpsOnJoin(false) // Notify OPs on Join when a new version is found (default)
.checkNow(); // And check right now
Expand All @@ -92,7 +92,7 @@ public void onEnable() {
public void onDisable() {
getLogger().info("Started Update Check...");
String BukkitVersion = Bukkit.getVersion().toString();
String MCVersion = " (MC: 1.19.2)";
String MCVersion = " (MC: 1.19.3)";
String editVersion = BukkitVersion.replace(MCVersion, "");
String simpleversion = editVersion.replaceAll("\\D+","");
int version = Integer.parseInt(simpleversion);
Expand All @@ -106,12 +106,12 @@ public void onDisable() {
//Boolean ForcedUpdate = this.getConfig().getBoolean("force-update");
int start = BukkitVersion.indexOf("MC: ") + 4;
int end = BukkitVersion.length() - 1;
if (BukkitVersion.substring(start, end).equals("1.19.2")) {
if (BukkitVersion.substring(start, end).equals("1.19.3")) {

if (ServerType.equals("paper")) {
URLConnection connection = null;
try {
connection = new URL("https://api.tronmc.com/amend/versions/paper/1.19.2").openConnection();
connection = new URL("https://api.tronmc.com/amend/versions/paper/1.19.3").openConnection();
} catch (IOException e) {
e.printStackTrace();
}
Expand All @@ -134,7 +134,7 @@ public void onDisable() {
if (version != latest) {
getLogger().warning("Version is NOT up to date! Newest PAPER version is " + latest);
getLogger().info("Downloading update and applying to " + serverJarName + "...");
InputStream in = new URL("https://api.papermc.io/v2/projects/paper/versions/1.19.2/builds/" + response + "/downloads/paper-1.19.2-" + response + ".jar").openStream();
InputStream in = new URL("https://api.papermc.io/v2/projects/paper/versions/1.19.3/builds/" + response + "/downloads/paper-1.19.3-" + response + ".jar").openStream();
Files.copy(in, Paths.get(serverJarName), StandardCopyOption.REPLACE_EXISTING);
getLogger().info("Update Completed!");
getLogger().warning("-------------------------------");
Expand Down Expand Up @@ -162,7 +162,7 @@ public void onDisable() {
} else if (ServerType.equals("purpur")) {
URLConnection connection = null;
try {
connection = new URL("https://api.purpurmc.org/v2/purpur/1.19.2").openConnection();
connection = new URL("https://api.purpurmc.org/v2/purpur/1.19.3").openConnection();
} catch (IOException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -190,7 +190,7 @@ public void onDisable() {
if (version != latest) {
getLogger().warning("Version is NOT up to date! Newest PURPUR version is " + latest);
getLogger().info("Downloading update and applying to " + serverJarName + "...");
InputStream in = new URL("https://api.purpurmc.org/v2/purpur/1.19.2/latest/download").openStream();
InputStream in = new URL("https://api.purpurmc.org/v2/purpur/1.19.3/latest/download").openStream();
Files.copy(in, Paths.get(serverJarName), StandardCopyOption.REPLACE_EXISTING);
getLogger().info("Update Completed!");
getLogger().warning("-------------------------------");
Expand Down Expand Up @@ -231,7 +231,7 @@ public void onDisable() {
getLogger().warning("Amend");
getLogger().warning("ERROR: Your server version is older, to prevent accidental updates to the world, amend will shut down.");
getLogger().warning("Current Version: " + BukkitVersion.substring(11));
getLogger().warning("Plugin Version: " + "1.19.2");
getLogger().warning("Plugin Version: " + "1.19.3");
getLogger().warning("Closing plugin...");
getLogger().warning("-------------------------------");
//Time out so user sees the error message.
Expand Down

0 comments on commit ee69e0e

Please sign in to comment.