Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 43 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@

# GeyserUpdater
### GeyserUpdater is a plugin that downloads and applies new builds of Geyser on Spigot/CraftBukkit, BungeeCord, and Velocity either manually or automatically.
##### Supports Minecraft 1.8 〜 1.19
##### Supports Minecraft 1.8 〜 1.21

If you'd like, click [here](https://discord.gg/xXzzdAXa2b) to join our Discord server! You can come here to receive support, ask about contributing, get GitHub feeds, or just simply hang out. Please do not ping anyone that doesn't have the "Pingable" role!

**Note:** This is _NOT_ an official GeyserMC plugin. It is made to work with Geyser, but it is not maintained or produced by GeyserMC. If you need support with this plugin, please do not ask the Geyser developers — instead, please go to our Discord server which is linked above.

## Downloading

Please download the plugin from [our Spigot page](https://www.spigotmc.org/resources/geyserupdater.88555/), so we can get an idea of how many people are downloading the plugin.

If you don't want to use the Spigot website, you can download the plugin from [our Github](https://github.com/kejonaMC/GeyserUpdater/releases), or use the actions button in the GitHub bar and download the zip with the GeyserUpdater jar inside.
If you don't want to use the Spigot website, you can download the plugin from [our GitHub](https://github.com/kejonaMC/GeyserUpdater/releases).

## Installation

Expand All @@ -39,7 +37,7 @@ Please note that for BungeeCord and Velocity, if the server is not shut down cle
## Configuration

### `Auto-Update-Geyser`:
*Default:* `false`
*Default:* `false`

If enabled, GeyserUpdater will check for new Geyser builds on server start, and on the interval specified by `Auto-Update-Interval`. If a new build exists, it will be downloaded.

Expand All @@ -49,29 +47,36 @@ If enabled, GeyserUpdater will check for new Geyser builds on server start, and
The interval in hours between each auto update check.

### `Auto-Restart-Server`:
*Default:* `false`
*Default:* `false`

If enabled, GeyserUpdater will attempt to restart the server 10 seconds after a new version of Geyser has been successfully downloaded.
If enabled, GeyserUpdater will attempt to restart the server after a new version of Geyser has been successfully downloaded.

- **Spigot:** Attempts to restart using Spigot's `/restart`. A restart script _must_ be defined in [spigot.yml](https://www.spigotmc.org/wiki/spigot-configuration/) in order for Spigot's restart feature to work properly. If you are using a hosting provider, a [server wrapper](https://minecraftservers.fandom.com/wiki/Server_wrappers), or a `systemd` unit (or similar) to run the server, leave the `restart-script` value in spigot.yml blank. Your server should automatically restart without needing a script.

- **BungeeCord/Velocity:** The server will simply stop. If you are using a hosting provider, a [server wrapper](https://minecraftservers.fandom.com/wiki/Server_wrappers), or a `systemd` unit (or similar) to run the server, your proxy should automatically restart. If not, you can use a script to *start* the proxy that will make it start again once it has stopped.
- **BungeeCord/Velocity:** The server will simply stop. If you are using a hosting provider, a [server wrapper](https://minecraftservers.fandom.com/wiki/Server_wrappers), or a `systemd` unit (or similar) to run the server, your proxy should automatically restart. If not, you can use a script to *start* the proxy that will make it start again once it has stopped.

### `Auto-Script-Generating`:
*Default:* `false`
*Default:* `false`

Do not use this if you are using a hosting provider, a [server wrapper](https://minecraftservers.fandom.com/wiki/Server_wrappers), or a `systemd` unit (or similar) to run your server.

When enabled, a restart script named `ServerRestartScript.sh` (macOS, Linux) or `ServerRestartScript.bat` (Windows) will be generated for you. It will attempt to use the same JVM flags that your server started with. Although it should typically work without any issue, it is recommended to verify and modify the generated script to your liking.
When enabled, a restart script named `ServerRestartScript.sh` (macOS, Linux) or `ServerRestartScript.bat` (Windows) will be generated for you. It will attempt to use the same JVM flags that your server started with. Although it should typically work without any issue, it is recommended to verify and modify the generated script to your liking.

- **Spigot:** The `restart-script` value in [spigot.yml](https://www.spigotmc.org/wiki/spigot-configuration/) will be automatically set to use the generated restart script. This will allow Spigot's restart feature to work if you have `Auto-Restart-Server` enabled, and if you run `/restart`. If you are running your server on Linux, it is recommended to modify the script so that your server starts in a [screen](https://www.gnu.org/software/screen/) or [tmux](https://github.com/tmux/tmux/wiki) session so that you can attach to the console of the server after it has restarted.
- **Spigot:** The `restart-script` value in [spigot.yml](https://www.spigotmc.org/wiki/spigot-configuration/) will be automatically set to use the generated restart script. This will allow Spigot's restart feature to work if you have `Auto-Restart-Server` enabled, and if you run `/restart`. If you are running your server on Linux, it is recommended to modify the script so that your server starts in a [screen](https://www.gnu.org/software/screen/) or [tmux](https://github.com/tmux/tmux/wiki) session so that you can attach to the console of the server after it has restarted.

- **BungeeCord/Velocity:** You must use the generated script to start the proxy. This will make the server restart after it has stopped.
- **BungeeCord/Velocity:** You must use the generated script to start the proxy. This will make the server restart after it has stopped.

### `Restart-Message-Players`:
*Default:* `'&2This server will be restarting in 10 seconds!'`
*Default:* `'&2This server will be restarting in 30 seconds!'`

This is the message that is sent to all players when `Auto-Restart-Server` is going to restart the server in 30 seconds.

### `Restart-Timer`:
*Default:* `30`

The countdown in seconds before the server restarts.


This is the message that is sent to all players when `Auto-Restart-Server` is going to restart the server in 10 seconds.

## bStats
[Spigot stats](https://bstats.org/plugin/bukkit/GeyserUpdater/10202)
Expand All @@ -82,42 +87,42 @@ This is the message that is sent to all players when `Auto-Restart-Server` is go

## Release History
* 1.6.1
* Update for Geyser's resource system refactor (Build #943, commit [763743a](https://github.com/GeyserMC/Geyser/commit/763743a845796e4619ba596b82d4eabb39045448))
* Update for Geyser's resource system refactor (Build #943, commit [763743a](https://github.com/GeyserMC/Geyser/commit/763743a845796e4619ba596b82d4eabb39045448))
* 1.6.0
* Update for Geyser 2.0, bump to Java 16
* Update for Geyser 2.0, bump to Java 16
* 1.5.0
* This update breaks existing configurations. Please rename or delete the old one to generate a new configuration.
* Add option to automatically check for updates on a custom interval.
* Add debug logger config option.
* All warn and error log messages are now coloured correctly (if the platform supports it).
* This update breaks existing configurations. Please rename or delete the old one to generate a new configuration.
* Add option to automatically check for updates on a custom interval.
* Add debug logger config option.
* All warn and error log messages are now coloured correctly (if the platform supports it).
* 1.4.0
* Any branch of Geyser that is available on their Jenkins CI can now be updated.
* Added support for CraftBukkit.
* Added support for non-default Bukkit/Spigot world-containers
* Important bugfixes, general increase in quality and better documentation.
* Any branch of Geyser that is available on their Jenkins CI can now be updated.
* Added support for CraftBukkit.
* Added support for non-default Bukkit/Spigot world-containers
* Important bugfixes, general increase in quality and better documentation.
* 1.3.0
* Added Velocity support.
* Added Velocity support.
* 1.2.0
* Added Restart script generating depended on OS, and setting it up on spigot.yml.
* Added config version check.
* Added Restart script generating depended on OS, and setting it up on spigot.yml.
* Added config version check.
* 1.1.0
* Added message if GeyserUpdater has an available update on startup
* Added message if GeyserUpdater has an available update on startup
* 1.0.0
* Full release! (No changes but we decided we are ready for it now, we will still update more if we need to)
* Full release! (No changes but we decided we are ready for it now, we will still update more if we need to)
* 0.2.6
* Add warning for players in config option
* Add warning for players in config option
* 0.2.5
* Added bStats support
* Added bStats support
* 0.2.4
* Added auto restart on Spigot/Bungeecord after downloading update.
* If you use this build you will need to regenerate config.yml file due to changes!
* Added auto restart on Spigot/Bungeecord after downloading update.
* If you use this build you will need to regenerate config.yml file due to changes!
* 0.2.2
* Mini-rework > Common classes.
* Jenkins CI has been setup.
* Pipeline has been added.
* Mini-rework > Common classes.
* Jenkins CI has been setup.
* Pipeline has been added.
* 0.1.0
* Merged Spigot & Bungeecord updater into 1 plugin.
* Added maven
* Merged Spigot & Bungeecord updater into 1 plugin.
* Added maven


Special thanks to:
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.projectg</groupId>
<groupId>com.kejonamc</groupId>
<name>GeyserUpdater</name>
<artifactId>GeyserUpdater</artifactId>
<version>1.6.4</version>
<version>1.6.5</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -74,7 +74,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.28</version>
<version>1.18.42</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.projectg.geyserupdater.bungee;

import com.projectg.geyserupdater.bungee.command.GeyserUpdateCommand;
import com.projectg.geyserupdater.bungee.listeners.BungeeJoinListener;
import com.projectg.geyserupdater.bungee.util.GeyserBungeeDownloader;
import com.projectg.geyserupdater.bungee.util.bstats.Metrics;
import com.projectg.geyserupdater.common.logger.JavaUtilUpdaterLogger;
import com.projectg.geyserupdater.common.logger.UpdaterLogger;
import com.projectg.geyserupdater.common.util.FileUtils;
import com.projectg.geyserupdater.common.util.GeyserProperties;
import com.projectg.geyserupdater.common.util.ScriptCreator;

import com.projectg.geyserupdater.common.util.SpigotResourceUpdateChecker;
package com.kejonamc.geyserupdater.bungee;

import com.kejonamc.geyserupdater.bungee.command.GeyserUpdateCommand;
import com.kejonamc.geyserupdater.bungee.listeners.BungeeJoinListener;
import com.kejonamc.geyserupdater.bungee.util.GeyserBungeeDownloader;
import com.kejonamc.geyserupdater.bungee.util.bstats.Metrics;
import com.kejonamc.geyserupdater.common.logger.JavaUtilUpdaterLogger;
import com.kejonamc.geyserupdater.common.logger.UpdaterLogger;
import com.kejonamc.geyserupdater.common.util.FileUtils;
import com.kejonamc.geyserupdater.common.util.GeyserProperties;
import com.kejonamc.geyserupdater.common.util.ScriptCreator;

import com.kejonamc.geyserupdater.common.util.SpigotResourceUpdateChecker;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider;
Expand Down Expand Up @@ -114,9 +114,9 @@ public void loadConfig() {
*/
public void checkConfigVersion(){
//Change version number only when editing config.yml!
if (configuration.getInt("Config-Version", 0) != 2){
if (configuration.getInt("Config-Version", 0) != 3){
logger.error("Your copy of config.yml is outdated. Please delete it and let a fresh copy of config.yml be regenerated!");
}
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectg.geyserupdater.bungee;
package com.kejonamc.geyserupdater.bungee;

import net.md_5.bungee.api.plugin.Plugin;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.projectg.geyserupdater.bungee.command;
package com.kejonamc.geyserupdater.bungee.command;

import com.projectg.geyserupdater.bungee.util.GeyserBungeeDownloader;
import com.projectg.geyserupdater.common.logger.UpdaterLogger;
import com.projectg.geyserupdater.common.util.Constants;
import com.projectg.geyserupdater.common.util.GeyserProperties;
import com.kejonamc.geyserupdater.bungee.util.GeyserBungeeDownloader;
import com.kejonamc.geyserupdater.common.logger.UpdaterLogger;
import com.kejonamc.geyserupdater.common.util.Constants;
import com.kejonamc.geyserupdater.common.util.GeyserProperties;

import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.CommandSender;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.projectg.geyserupdater.bungee.listeners;
package com.kejonamc.geyserupdater.bungee.listeners;

import com.projectg.geyserupdater.common.util.FileUtils;
import com.kejonamc.geyserupdater.common.util.FileUtils;

import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.event.PostLoginEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.projectg.geyserupdater.bungee.util;
package com.kejonamc.geyserupdater.bungee.util;

import com.projectg.geyserupdater.bungee.BungeeUpdater;
import com.projectg.geyserupdater.common.logger.UpdaterLogger;
import com.projectg.geyserupdater.common.util.Constants;
import com.projectg.geyserupdater.common.util.FileUtils;
import com.kejonamc.geyserupdater.bungee.BungeeUpdater;
import com.kejonamc.geyserupdater.common.logger.UpdaterLogger;
import com.kejonamc.geyserupdater.common.util.Constants;
import com.kejonamc.geyserupdater.common.util.FileUtils;

import com.projectg.geyserupdater.common.util.GeyserDownloadApi;
import com.projectg.geyserupdater.common.util.ServerPlatform;
import com.kejonamc.geyserupdater.common.util.GeyserDownloadApi;
import com.kejonamc.geyserupdater.common.util.ServerPlatform;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.ProxiedPlayer;
Expand Down Expand Up @@ -82,10 +82,11 @@ private static boolean downloadGeyser() {
* Attempt to restart the server
*/
private static void restartServer() {
logger.warn("The server will be restarting in 10 seconds!");
long restartTimer = plugin.getConfig().getLong("Restart-Timer");
logger.warn("The server will be restarting in " + restartTimer + " seconds!");
for (ProxiedPlayer player : plugin.getProxy().getPlayers()) {
player.sendMessage(new TextComponent(ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("Restart-Message-Players"))));
}
plugin.getProxy().getScheduler().schedule(plugin, () -> plugin.getProxy().stop(), 10L, TimeUnit.SECONDS);
plugin.getProxy().getScheduler().schedule(plugin, () -> plugin.getProxy().stop(), restartTimer, TimeUnit.SECONDS);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectg.geyserupdater.bungee.util.bstats;
package com.kejonamc.geyserupdater.bungee.util.bstats;

import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectg.geyserupdater.common.json_schema;
package com.kejonamc.geyserupdater.common.json_schema;

import lombok.Getter;
import lombok.experimental.Accessors;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectg.geyserupdater.common.logger;
package com.kejonamc.geyserupdater.common.logger;

import java.util.logging.Level;
import java.util.logging.Logger;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectg.geyserupdater.common.logger;
package com.kejonamc.geyserupdater.common.logger;

public interface UpdaterLogger {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectg.geyserupdater.common.logger;
package com.kejonamc.geyserupdater.common.logger;

class UpdaterLoggerHolder {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectg.geyserupdater.common.util;
package com.kejonamc.geyserupdater.common.util;

public class Constants {
public static final String GEYSER_BASE_URL = "https://download.geysermc.org";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.projectg.geyserupdater.common.util;
package com.kejonamc.geyserupdater.common.util;

import com.google.common.hash.Hashing;
import com.google.common.io.ByteSource;
import com.projectg.geyserupdater.common.logger.UpdaterLogger;
import com.kejonamc.geyserupdater.common.logger.UpdaterLogger;
import org.jetbrains.annotations.Nullable;

import java.io.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.projectg.geyserupdater.common.util;
package com.kejonamc.geyserupdater.common.util;

import com.google.gson.Gson;
import com.projectg.geyserupdater.common.json_schema.EndpointResponse;
import com.kejonamc.geyserupdater.common.json_schema.EndpointResponse;

import java.io.InputStreamReader;
import java.net.HttpURLConnection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.projectg.geyserupdater.common.util;
package com.kejonamc.geyserupdater.common.util;

import com.projectg.geyserupdater.common.logger.UpdaterLogger;
import com.kejonamc.geyserupdater.common.logger.UpdaterLogger;
import org.geysermc.geyser.GeyserImpl;

import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectg.geyserupdater.common.util;
package com.kejonamc.geyserupdater.common.util;

public class OsUtils {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.projectg.geyserupdater.common.util;
package com.kejonamc.geyserupdater.common.util;

import com.projectg.geyserupdater.common.logger.UpdaterLogger;
import com.kejonamc.geyserupdater.common.logger.UpdaterLogger;

import java.io.DataOutputStream;
import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.projectg.geyserupdater.common.util;
package com.kejonamc.geyserupdater.common.util;

public enum ServerPlatform {
SPIGOT("spigot"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.projectg.geyserupdater.common.util;
package com.kejonamc.geyserupdater.common.util;

import com.projectg.geyserupdater.common.logger.UpdaterLogger;
import com.kejonamc.geyserupdater.common.logger.UpdaterLogger;

import java.io.IOException;
import java.io.InputStream;
Expand Down
Loading
Loading