use of me.jellysquid.mods.sodium.client.gui.options.OptionFlag in project reeses-sodium-options by FlashyReese.
the class SodiumVideoOptionsScreen method applyChanges.
private void applyChanges() {
final HashSet<OptionStorage<?>> dirtyStorages = new HashSet<>();
final EnumSet<OptionFlag> flags = EnumSet.noneOf(OptionFlag.class);
this.getAllOptions().forEach((option -> {
if (!option.hasChanged()) {
return;
}
option.applyChanges();
flags.addAll(option.getFlags());
dirtyStorages.add(option.getStorage());
}));
MinecraftClient client = MinecraftClient.getInstance();
if (flags.contains(OptionFlag.REQUIRES_RENDERER_RELOAD)) {
client.worldRenderer.reload();
}
if (flags.contains(OptionFlag.REQUIRES_ASSET_RELOAD)) {
client.setMipmapLevels(client.options.mipmapLevels);
client.reloadResourcesConcurrently();
}
for (OptionStorage<?> storage : dirtyStorages) {
storage.save();
}
}
Aggregations