mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Fix /geyser reload
on Velocity (#4258)
* Fix /geyser reload on Velocity * No need to create/init a new injector on Velocity * No need to warn about "abnormally long startup" on Bungee when we're reloading. And, as on velocity, no need to re-inject
This commit is contained in:
parent
4ff8b7bff4
commit
644082ae84
2 changed files with 30 additions and 5 deletions
|
@ -70,6 +70,8 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap {
|
|||
|
||||
private GeyserImpl geyser;
|
||||
|
||||
private static boolean INITIALIZED = false;
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
GeyserLocale.init(this);
|
||||
|
@ -133,7 +135,12 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap {
|
|||
// Big hack - Bungee does not provide us an event to listen to, so schedule a repeating
|
||||
// task that waits for a field to be filled which is set after the plugin enable
|
||||
// process is complete
|
||||
this.awaitStartupCompletion(0);
|
||||
if (!INITIALIZED) {
|
||||
this.awaitStartupCompletion(0);
|
||||
} else {
|
||||
// No need to "wait" for startup completion, just start Geyser - we're reloading.
|
||||
this.postStartup();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
@ -166,8 +173,10 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap {
|
|||
private void postStartup() {
|
||||
GeyserImpl.start();
|
||||
|
||||
this.geyserInjector = new GeyserBungeeInjector(this);
|
||||
this.geyserInjector.initializeLocalChannel(this);
|
||||
if (!INITIALIZED) {
|
||||
this.geyserInjector = new GeyserBungeeInjector(this);
|
||||
this.geyserInjector.initializeLocalChannel(this);
|
||||
}
|
||||
|
||||
this.geyserCommandManager = new GeyserCommandManager(geyser);
|
||||
this.geyserCommandManager.init();
|
||||
|
@ -187,6 +196,8 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap {
|
|||
} else {
|
||||
this.geyserBungeePingPassthrough = new GeyserBungeePingPassthrough(getProxy());
|
||||
}
|
||||
|
||||
INITIALIZED = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue