Skip to content

Commit

Permalink
Don't attempt to clear registry that hasn't been loaded yet (#5101)
Browse files Browse the repository at this point in the history
  • Loading branch information
onebeastchris authored Oct 24, 2024
1 parent e7ecb55 commit 29fe033
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/java/org/geysermc/geyser/GeyserImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,9 @@ public void disable() {
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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ public void load() {
this.loaded = true;
}

/**
* Whether this registry was loaded.
*/
public boolean loaded() {
return this.loaded;
}

/**
* Creates a new deferred registry.
*
Expand Down

0 comments on commit 29fe033

Please sign in to comment.