aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMylesAndMore <mylesandmore9@gmail.com>2023-06-18 21:36:35 +0200
committerMylesAndMore <mylesandmore9@gmail.com>2023-06-18 21:36:35 +0200
commit26daae32788c2229c06ee7eb9ce2061dcb2a327d (patch)
treef33251576ea8a479cc7fdfc0751455a1b858afd1
parentda3473a704246abbe60071ec4069664b2b50a7b3 (diff)
downloadTumble-26daae32788c2229c06ee7eb9ce2061dcb2a327d.tar.gz
Tumble-26daae32788c2229c06ee7eb9ce2061dcb2a327d.tar.bz2
Tumble-26daae32788c2229c06ee7eb9ce2061dcb2a327d.zip
add an online update checker
-rw-r--r--README.md6
-rw-r--r--build.gradle5
-rw-r--r--src/main/java/com/MylesAndMore/Tumble/Main.java10
-rw-r--r--src/main/resources/plugin.yml5
4 files changed, 22 insertions, 4 deletions
diff --git a/README.md b/README.md
index 9653937..a2b349b 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ If you've never heard of it, [Tumble](https://minecraft-archive.fandom.com/wiki/
## Setup
-1. Simply [download](https://github.com/MylesAndMore/tumble/releases) the plugin's JAR file and place it in your server's plugins directory.
+1. Simply [download](https://github.com/MylesAndMore/Tumble/releases) the plugin's JAR file and place it in your server's plugins directory.
- *Note: Multiverse is also required for the plugin to run, you may download it [here](https://www.spigotmc.org/resources/multiverse-core.390/).*
@@ -36,7 +36,7 @@ If you've never heard of it, [Tumble](https://minecraft-archive.fandom.com/wiki/
Scroll down for more options to configure your game.
-## Commands
+## Commands/Permissions
- ```/tumble:reload```
@@ -59,6 +59,8 @@ Scroll down for more options to configure your game.
- *Description:* Configures the auto start functions of Tumble.
- *Usage:* ```/tumble:autostart <playerAmount> [enable|disable]```
- *Permission:* ```tumble.autostart```
+- *Permission:* ```tumble.update```
+ - Players with this permission will receive a notification upon joining if Tumble is out of date.
## Configuration
diff --git a/build.gradle b/build.gradle
index c5c2913..8791ad3 100644
--- a/build.gradle
+++ b/build.gradle
@@ -14,12 +14,14 @@ repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url "https://repo.onarandombox.com/content/groups/public/" }
+ maven { url "https://repo.jeff-media.com/public/"}
}
dependencies {
compileOnly('org.spigotmc:spigot-api:1.19.2-R0.1-SNAPSHOT')
compileOnly('com.onarandombox.multiversecore:Multiverse-Core:4.3.1')
implementation('org.bstats:bstats-bukkit:3.0.2')
+ implementation('com.jeff_media:SpigotUpdateChecker:3.0.3')
}
// Disable generation of the normal JAR to reduce confusion and only generate the correctly shadowed JAR including bStats
@@ -28,6 +30,7 @@ jar.finalizedBy(shadowJar)
shadowJar {
archiveBaseName.set('Tumble')
archiveClassifier.set('')
- archiveVersion.set('1.0.3')
+ archiveVersion.set('1.0.4')
relocate 'org.bstats', 'com.MylesAndMore.bstats'
+ relocate 'com.jeff_media.updatechecker', 'com.MylesAndMore.updatechecker'
}
diff --git a/src/main/java/com/MylesAndMore/Tumble/Main.java b/src/main/java/com/MylesAndMore/Tumble/Main.java
index 9cb3613..c264498 100644
--- a/src/main/java/com/MylesAndMore/Tumble/Main.java
+++ b/src/main/java/com/MylesAndMore/Tumble/Main.java
@@ -4,6 +4,9 @@ import com.MylesAndMore.Tumble.commands.*;
import com.MylesAndMore.Tumble.plugin.Constants;
import com.MylesAndMore.Tumble.plugin.EventListener;
+import com.jeff_media.updatechecker.UpdateCheckSource;
+import com.jeff_media.updatechecker.UpdateChecker;
+
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
@@ -31,6 +34,13 @@ public class Main extends JavaPlugin{
Bukkit.getServer().getLogger().warning("[Tumble] It appears you have not configured a lobby world for Tumble.");
Bukkit.getServer().getLogger().info("[Tumble] If this is your first time running the plugin, you may disregard this message.");
}
+
+ new UpdateChecker(this, UpdateCheckSource.SPIGET, "106721")
+ .setDownloadLink("https://github.com/MylesAndMore/Tumble/releases")
+ .setNotifyByPermissionOnJoin("tumble.update") // only this permission node is notified NOT all OPs so people can unsubscribe if they wish
+ .checkEveryXHours(336) // (every 2 weeks)
+ .checkNow();
+
Bukkit.getServer().getLogger().info("[Tumble] Tumble successfully enabled!");
}
} \ No newline at end of file
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index dbc8973..23d50ca 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -1,6 +1,6 @@
main: com.MylesAndMore.Tumble.Main
name: Tumble
-version: 1.0.3
+version: 1.0.4
description: 'A Minecraft: Java Edition plugin recreating the Tumble minigame from Minecraft Legacy Console Edition.'
api-version: 1.19
load: STARTUP
@@ -48,3 +48,6 @@ permissions:
tumble.autostart:
description: Allows you to set the autostart details of Tumble.
default: op
+ tumble.update:
+ description: Allows you to get a notification if Tumble is out of date.
+ default: op