Skip to content

Commit

Permalink
Merge branch 'dev' into 1.19.4-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
StavWasPlayZ committed Aug 27, 2023
2 parents e725f91 + cdd0e81 commit b23cca9
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,25 @@ public void setNoteRingTheme(Color noteRingTheme) {
}


protected <T> T getTheme(final Supplier<T> theme) {
if (theme.get() == null) {
protected Color getTheme(final Supplier<Color> theme) {
return getTheme(theme, Color.BLACK);
}

protected <T> T getTheme(final Supplier<T> theme, final T def) {
T _theme = theme.get();

if (_theme == null) {
LOGGER.warn("Requested theme not found, performing reload!");
performReload(Minecraft.getInstance().getResourceManager());

_theme = theme.get();
if (_theme == null) {
LOGGER.error("Failed to load instrument resources!");
return def;
}
}

return theme.get();
return _theme;
}

}

0 comments on commit b23cca9

Please sign in to comment.