Skip to content

Commit

Permalink
1.21
Browse files Browse the repository at this point in the history
- now updates to 1.21!
  • Loading branch information
MrTronMan committed Jun 18, 2024
1 parent 2fa608e commit 38bebd6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ server-type: "paper"
# Config Version. Like every spigot dev, we ask that you DO NOT CHANGE THIS PLEASE.
config-version: 8
```
- Then place the (plugin) jar in and it will automatically update it to the newest version, ***please note as of now the plugin is updating the latest `1.20.6` builds and will continue to update until a new release comes out, then you will need to come back here to get the newest plugin update.***
- Then place the (plugin) jar in and it will automatically update it to the newest version, ***please note as of now the plugin is updating the latest `1.21` builds and will continue to update until a new release comes out, then you will need to come back here to get the newest plugin update.***

Update checks for the plugin are currently unavailable to switch off, but we only create the update notification if its a critical update, not a fancy one.
###### © 2023 mrtron.dev. All Rights Reserved.
###### © 2024 mrtron.dev. All Rights Reserved.
4 changes: 2 additions & 2 deletions 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.7.5--V.1.20.6</version>
<version>1.7.6--V.1.21</version>
<packaging>jar</packaging>
<name>Amend</name>

Expand Down Expand Up @@ -83,7 +83,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.20-R0.1-SNAPSHOT</version>
<version>1.21-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/tronmc/beta/amend/Amend.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,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.20.6") // 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.21") // 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 onDisable() {
getLogger().info("Started Update Check...");

//Plugin Version
String pluginVersion = "1.20.6";
String pluginVersion = "1.21";

//Changes the Bukkit Version to a string and then gets the jar version and the MC version.
String BukkitVersion = Bukkit.getVersion().toString();
Expand All @@ -111,12 +111,12 @@ public void onDisable() {
String ServerType = getConfig().getString("server-type");
//Boolean ForcedUpdate = this.getConfig().getBoolean("force-update");

if (MCVersion.equals("1.20.6")) {
if (MCVersion.equals("1.21")) {

if (ServerType.equals("paper")) {
URLConnection connection = null;
try {
connection = new URL("https://api.tronmc.com/amend/versions/paper/1.20.6").openConnection();
connection = new URL("https://api.tronmc.com/amend/versions/paper/1.21").openConnection();
} catch (IOException e) {
e.printStackTrace();
}
Expand All @@ -139,7 +139,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.20.6/builds/" + response + "/downloads/paper-1.20.6-" + response + ".jar").openStream();
InputStream in = new URL("https://api.papermc.io/v2/projects/paper/versions/1.21/builds/" + response + "/downloads/paper-1.21-" + response + ".jar").openStream();
Files.copy(in, Paths.get(serverJarName), StandardCopyOption.REPLACE_EXISTING);
getLogger().info("Update Completed!");
getLogger().warning("-------------------------------");
Expand Down Expand Up @@ -167,7 +167,7 @@ public void onDisable() {
} else if (ServerType.equals("purpur")) {
URLConnection connection = null;
try {
connection = new URL("https://api.purpurmc.org/v2/purpur/1.20.6").openConnection();
connection = new URL("https://api.purpurmc.org/v2/purpur/1.21").openConnection();
} catch (IOException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -195,7 +195,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.20.6/latest/download").openStream();
InputStream in = new URL("https://api.purpurmc.org/v2/purpur/1.21/latest/download").openStream();
Files.copy(in, Paths.get(serverJarName), StandardCopyOption.REPLACE_EXISTING);
getLogger().info("Update Completed!");
getLogger().warning("-------------------------------");
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Amend
version: '${project.version}'
main: com.tronmc.beta.amend.Amend
api-version: '1.20'
api-version: '1.21'
load: POSTWORLD
description: A plugin that auto updates purpur.
website: amend.mrtron.dev
Expand Down

0 comments on commit 38bebd6

Please sign in to comment.