Fixing softreload
Dieser Commit ist enthalten in:
Ursprung
9dae263d9b
Commit
b8d343f3f1
@ -1,9 +1,8 @@
|
|||||||
package de.steamwar.bungeecore;
|
package de.steamwar.bungeecore;
|
||||||
|
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
import net.md_5.bungee.api.event.ProxyReloadEvent;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.plugin.*;
|
import net.md_5.bungee.api.plugin.*;
|
||||||
import net.md_5.bungee.event.EventHandler;
|
|
||||||
import org.yaml.snakeyaml.Yaml;
|
import org.yaml.snakeyaml.Yaml;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -18,7 +17,7 @@ import java.util.jar.JarFile;
|
|||||||
import java.util.logging.Handler;
|
import java.util.logging.Handler;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
public class Persistent extends Plugin implements Listener {
|
public class Persistent extends Plugin {
|
||||||
|
|
||||||
private static Persistent instance;
|
private static Persistent instance;
|
||||||
private static String chatPrefix = "";
|
private static String chatPrefix = "";
|
||||||
@ -27,15 +26,9 @@ public class Persistent extends Plugin implements Listener {
|
|||||||
@Override
|
@Override
|
||||||
public void onEnable(){
|
public void onEnable(){
|
||||||
instance = this;
|
instance = this;
|
||||||
}
|
getProxy().getPluginManager().registerCommand(this, new Command("softreload", "bungeecore.softreload"){
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable(){
|
public void execute(CommandSender sender, String[] args) {
|
||||||
Subserver.shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onGReload(ProxyReloadEvent e){
|
|
||||||
// Copied from https://www.spigotmc.org/resources/bungeepluginmanager-manage-your-bungee-plugin-at-runtime.63861/
|
// Copied from https://www.spigotmc.org/resources/bungeepluginmanager-manage-your-bungee-plugin-at-runtime.63861/
|
||||||
PluginManager pluginManager = getProxy().getPluginManager();
|
PluginManager pluginManager = getProxy().getPluginManager();
|
||||||
Plugin bungeecore = pluginManager.getPlugin("BungeeCore");
|
Plugin bungeecore = pluginManager.getPlugin("BungeeCore");
|
||||||
@ -136,6 +129,13 @@ public class Persistent extends Plugin implements Listener {
|
|||||||
getLogger().log(Level.SEVERE, "Failed to load plugin", t);
|
getLogger().log(Level.SEVERE, "Failed to load plugin", t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable(){
|
||||||
|
Subserver.shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
public static void setLobbyServer(String lobbyServer) {
|
public static void setLobbyServer(String lobbyServer) {
|
||||||
Persistent.lobbyServer = lobbyServer;
|
Persistent.lobbyServer = lobbyServer;
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren