Skip to content

Commit

Permalink
add an online update checker
Browse files Browse the repository at this point in the history
  • Loading branch information
MylesAndMore committed Jun 18, 2023
1 parent da3473a commit 26daae3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).*

Expand All @@ -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```

Expand All @@ -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

Expand Down
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
}
10 changes: 10 additions & 0 deletions src/main/java/com/MylesAndMore/Tumble/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
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;
Expand Down Expand Up @@ -31,6 +34,13 @@ public void onEnable() {
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!");
}
}
5 changes: 4 additions & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

0 comments on commit 26daae3

Please sign in to comment.