mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-12-23 06:50:26 +01:00
Don't attempt to clear registry that hasn't been loaded yet (#5101)
This commit is contained in:
parent
e7ecb55f33
commit
29fe033257
2 changed files with 10 additions and 1 deletions
|
@ -723,7 +723,9 @@ public class GeyserImpl implements GeyserApi, EventRegistrar {
|
||||||
runIfNonNull(newsHandler, NewsHandler::shutdown);
|
runIfNonNull(newsHandler, NewsHandler::shutdown);
|
||||||
runIfNonNull(erosionUnixListener, UnixSocketClientListener::close);
|
runIfNonNull(erosionUnixListener, UnixSocketClientListener::close);
|
||||||
|
|
||||||
Registries.RESOURCE_PACKS.get().clear();
|
if (Registries.RESOURCE_PACKS.loaded()) {
|
||||||
|
Registries.RESOURCE_PACKS.get().clear();
|
||||||
|
}
|
||||||
|
|
||||||
this.setEnabled(false);
|
this.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,6 +112,13 @@ public final class DeferredRegistry<M> implements IRegistry<M> {
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether this registry was loaded.
|
||||||
|
*/
|
||||||
|
public boolean loaded() {
|
||||||
|
return this.loaded;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new deferred registry.
|
* Creates a new deferred registry.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue