mirror of
https://github.com/GeyserMC/Geyser.git
synced 2026-01-04 15:31:36 +00:00
Don't attempt to clear registry that hasn't been loaded yet (#5101)
This commit is contained in:
@@ -723,7 +723,9 @@ public class GeyserImpl implements GeyserApi, EventRegistrar {
|
||||
runIfNonNull(newsHandler, NewsHandler::shutdown);
|
||||
runIfNonNull(erosionUnixListener, UnixSocketClientListener::close);
|
||||
|
||||
Registries.RESOURCE_PACKS.get().clear();
|
||||
if (Registries.RESOURCE_PACKS.loaded()) {
|
||||
Registries.RESOURCE_PACKS.get().clear();
|
||||
}
|
||||
|
||||
this.setEnabled(false);
|
||||
}
|
||||
|
||||
@@ -112,6 +112,13 @@ public final class DeferredRegistry<M> implements IRegistry<M> {
|
||||
this.loaded = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this registry was loaded.
|
||||
*/
|
||||
public boolean loaded() {
|
||||
return this.loaded;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new deferred registry.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user