mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2025-01-22 21:41:23 +01:00
Switch to new ManagedUpdater
This should make the plugin more flexible
This commit is contained in:
parent
736a42b73c
commit
53147aaa6e
@ -23,6 +23,8 @@
|
||||
<dependencies>PCGF_PluginLib</dependencies>
|
||||
<soft-dependencies/>
|
||||
<mainClass>${project.groupId}.${project.artifactId}.Bukkit.${project.artifactId}</mainClass>
|
||||
<releaseType>Normal</releaseType>
|
||||
<updateChannel>Release</updateChannel>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@ -36,7 +38,7 @@
|
||||
<dependency>
|
||||
<groupId>at.pcgamingfreaks</groupId>
|
||||
<artifactId>PluginLib</artifactId>
|
||||
<version>1.0.23-SNAPSHOT</version>
|
||||
<version>1.0.24-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<!-- BadRabbit -->
|
||||
<dependency>
|
||||
@ -141,6 +143,7 @@
|
||||
<version>${project.version}-Standalone</version>
|
||||
<dependencies/>
|
||||
<mainClass>${project.groupId}.${project.artifactId}Standalone.Bukkit.${project.artifactId}</mainClass>
|
||||
<releaseType>Standalone</releaseType>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
@ -233,6 +236,7 @@
|
||||
<dependencies/>
|
||||
<soft-dependencies>PCGF_PluginLib</soft-dependencies>
|
||||
<mainClass>${project.groupId}.${project.artifactId}.Bukkit.${project.artifactId}BadRabbit</mainClass>
|
||||
<releaseType>Release</releaseType>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -1,4 +1,4 @@
|
||||
# To simplify the customisation and the translation process please check out the editor: http://ptp.pcgamingfreaks.at
|
||||
# To simplify the customisation and translation process please check out the editor: https://ptp.pcgamingfreaks.at
|
||||
|
||||
Language:
|
||||
NotFromConsole: "&cDieser Befehl kann nicht in der Konsole ausgeführt werden."
|
||||
@ -21,7 +21,7 @@ Language:
|
||||
BackpackCleanedOther: "Der Rucksack von {DisplayName}&r wurde geleert."
|
||||
Open:
|
||||
#Parameter: {TimeLeft} time in seconds till he can reopen his backpack
|
||||
Cooldown: "&2Bitte warte noch {TimeLeft} Sekunden bis du deinen Rucksack wieder öffnest."
|
||||
Cooldown: "&2Bitte warte noch {TimeLeft} Sekunden, bis du deinen Rucksack wieder öffnest."
|
||||
#Parameter: {CurrentGameMode}, {AllowedGameModes}
|
||||
WrongGameMode: "Du darfst deinen Rucksack in deinem aktuellem Gamemode nicht öffnen."
|
||||
Sort:
|
||||
@ -68,9 +68,9 @@ Language:
|
||||
Clean: "Leert deinen Rucksack."
|
||||
CleanOthers: "Leert den Rucksack eines anderen Spielers."
|
||||
OpenOthers: "Öffnet den Rucksack eines anderen Spielers."
|
||||
Reload: "Lädt die Konfigurations-Datei neu."
|
||||
Reload: "Lädt die Konfigurationsdatei neu."
|
||||
Update: "Prüft auf neue Plugin-Updates."
|
||||
Backup: "Erstellt eine Sicherungskopie eines Rucksackes."
|
||||
Backup: "Erstellt eine Sicherungskopie eines Rucksacks."
|
||||
Restore: "Stellt eine Sicherungskopie eines Rucksacks wieder her."
|
||||
RestoreList: "Listet alle verfügbaren Sicherungskopien von Rucksäcken auf."
|
||||
Version: "Gibt die Versionsdetails über das Plugin und seine Abhängigkeiten aus."
|
||||
|
@ -1,4 +1,4 @@
|
||||
# To simplify the customisation and the translation process please check out the editor: http://ptp.pcgamingfreaks.at
|
||||
# To simplify the customisation and translation process please check out the editor: https://ptp.pcgamingfreaks.at
|
||||
|
||||
Language:
|
||||
NotFromConsole: "&cCommand not usable from console."
|
||||
|
@ -112,7 +112,7 @@ Command:
|
||||
|
||||
# Will be shown in the console during startup
|
||||
LanguageName: "Français"
|
||||
Author: "Sniper_TVmc"
|
||||
Author: "HiiRaZ & Sniper_TVmc"
|
||||
|
||||
# Language file version. Don't touch it!
|
||||
Version: 18
|
||||
|
55
Minepacks/resources/update.yml
Normal file
55
Minepacks/resources/update.yml
Normal file
@ -0,0 +1,55 @@
|
||||
UpdateProviders:
|
||||
Bukkit:
|
||||
Type: Bukkit
|
||||
ProjectId: 83445
|
||||
Spigot:
|
||||
Type: Spigot
|
||||
ProjectId: 19286
|
||||
Filename: "minepacks.jar"
|
||||
GitHub:
|
||||
Type: GitHub
|
||||
Owner: GeorgH93
|
||||
Repo: Minepacks
|
||||
GitHubStandalone:
|
||||
Type: GitHub
|
||||
Owner: GeorgH93
|
||||
Repo: Minepacks
|
||||
JarSearch: ".*-Standalone\\.jar"
|
||||
GitHubRelease:
|
||||
Type: GitHub
|
||||
Owner: GeorgH93
|
||||
Repo: Minepacks
|
||||
JarSearch: ".*-Release\\.jar"
|
||||
JenkinsMaster:
|
||||
Type: Jenkins
|
||||
Server: "https://ci.pcgamingfreaks.at"
|
||||
Job: "Minepacks"
|
||||
JenkinsMasterStandalone:
|
||||
Type: Jenkins
|
||||
Server: "https://ci.pcgamingfreaks.at"
|
||||
Job: "Minepacks"
|
||||
Filter: ".*-Standalone.jar"
|
||||
JenkinsMasterRelease:
|
||||
Type: Jenkins
|
||||
Server: "https://ci.pcgamingfreaks.at"
|
||||
Job: "Minepacks"
|
||||
Filter: ".*-Release.jar"
|
||||
JenkinsDev:
|
||||
Type: Jenkins
|
||||
Server: "https://ci.pcgamingfreaks.at"
|
||||
Job: "Minepacks Dev"
|
||||
|
||||
UpdateChannels:
|
||||
Release:
|
||||
Release: [ Bukkit, Spigot, GitHubRelease ]
|
||||
Standalone: [ GitHubStandalone ]
|
||||
Normal: [ GitHub ]
|
||||
Master:
|
||||
Release: [ JenkinsMasterRelease ]
|
||||
Standalone: [ JenkinsMasterStandalone ]
|
||||
Normal: [ JenkinsMaster ]
|
||||
Dev:
|
||||
Normal: [ JenkinsDev ]
|
||||
|
||||
DefaultChannel: "${updateChannel}"
|
||||
ReleaseType: "${releaseType}"
|
@ -19,5 +19,5 @@
|
||||
|
||||
public class MagicValues
|
||||
{
|
||||
public static final String MIN_PCGF_PLUGIN_LIB_VERSION = "1.0.21-SNAPSHOT";
|
||||
public static final String MIN_PCGF_PLUGIN_LIB_VERSION = "1.0.24-SNAPSHOT";
|
||||
}
|
@ -18,8 +18,8 @@
|
||||
package at.pcgamingfreaks.Minepacks.Bukkit;
|
||||
|
||||
import at.pcgamingfreaks.Bukkit.MCVersion;
|
||||
import at.pcgamingfreaks.Bukkit.ManagedUpdater;
|
||||
import at.pcgamingfreaks.Bukkit.Message.Message;
|
||||
import at.pcgamingfreaks.Bukkit.Updater;
|
||||
import at.pcgamingfreaks.Bukkit.Utils;
|
||||
import at.pcgamingfreaks.ConsoleColor;
|
||||
import at.pcgamingfreaks.Minepacks.Bukkit.API.Backpack;
|
||||
@ -35,9 +35,6 @@
|
||||
import at.pcgamingfreaks.Minepacks.Bukkit.Listener.*;
|
||||
import at.pcgamingfreaks.Minepacks.Bukkit.SpecialInfoWorker.NoDatabaseWorker;
|
||||
import at.pcgamingfreaks.StringUtils;
|
||||
import at.pcgamingfreaks.Updater.UpdateProviders.BukkitUpdateProvider;
|
||||
import at.pcgamingfreaks.Updater.UpdateProviders.JenkinsUpdateProvider;
|
||||
import at.pcgamingfreaks.Updater.UpdateProviders.UpdateProvider;
|
||||
import at.pcgamingfreaks.Updater.UpdateResponseCallback;
|
||||
import at.pcgamingfreaks.Version;
|
||||
|
||||
@ -58,11 +55,9 @@
|
||||
|
||||
public class Minepacks extends JavaPlugin implements MinepacksPlugin
|
||||
{
|
||||
private static final int BUKKIT_PROJECT_ID = 83445;
|
||||
@SuppressWarnings("unused")
|
||||
private static final String JENKINS_URL = "https://ci.pcgamingfreaks.at", JENKINS_JOB_DEV = "Minepacks Dev", JENKINS_JOB_MASTER = "Minepacks";
|
||||
private static Minepacks instance = null;
|
||||
|
||||
private ManagedUpdater updater = null;
|
||||
private Config config;
|
||||
private Language lang;
|
||||
private Database database;
|
||||
@ -115,6 +110,7 @@ public void onEnable()
|
||||
}
|
||||
/*end[STANDALONE]*/
|
||||
|
||||
updater = new ManagedUpdater(this);
|
||||
|
||||
//region Check compatibility with used minecraft version
|
||||
if(MCVersion.is(MCVersion.UNKNOWN) || !MCVersion.isUUIDsSupportAvailable() || MCVersion.isNewerThan(MCVersion.MC_NMS_1_15_R1))
|
||||
@ -141,7 +137,7 @@ public void onEnable()
|
||||
lang = new Language(this);
|
||||
load();
|
||||
|
||||
if(config.getAutoUpdate()) update(null);
|
||||
if(config.getAutoUpdate()) updater.update();
|
||||
getLogger().info(StringUtils.getPluginEnabledMessage(getDescription().getName()));
|
||||
}
|
||||
|
||||
@ -149,29 +145,16 @@ public void onEnable()
|
||||
public void onDisable()
|
||||
{
|
||||
if(config == null) return;
|
||||
Updater updater = null;
|
||||
if(config.getAutoUpdate()) updater = update(null);
|
||||
if(config.getAutoUpdate()) updater.update();
|
||||
unload();
|
||||
if(updater != null) updater.waitForAsyncOperation(); // Wait for updater to finish
|
||||
updater.waitForAsyncOperation(); // Wait for an update to finish
|
||||
getLogger().info(StringUtils.getPluginDisabledMessage(getDescription().getName()));
|
||||
instance = null;
|
||||
}
|
||||
|
||||
public @Nullable Updater update(@Nullable UpdateResponseCallback updateResponseCallback)
|
||||
public void update(final @Nullable UpdateResponseCallback updateResponseCallback)
|
||||
{
|
||||
UpdateProvider updateProvider;
|
||||
if(getDescription().getVersion().contains("Release")) updateProvider = new BukkitUpdateProvider(BUKKIT_PROJECT_ID, getLogger());
|
||||
else
|
||||
{
|
||||
/*if[STANDALONE]
|
||||
updateProvider = new JenkinsUpdateProvider(JENKINS_URL, JENKINS_JOB_MASTER, getLogger(), ".*-Standalone.*");
|
||||
else[STANDALONE]*/
|
||||
updateProvider = new JenkinsUpdateProvider(JENKINS_URL, JENKINS_JOB_DEV, getLogger());
|
||||
/*end[STANDALONE]*/
|
||||
}
|
||||
Updater updater = new Updater(this, true, updateProvider);
|
||||
updater.update(updateResponseCallback);
|
||||
return updater;
|
||||
}
|
||||
|
||||
private void load()
|
||||
|
Loading…
Reference in New Issue
Block a user