New config option to disable the experimental warning screen on level load
This commit is contained in:
parent
b60df41c6c
commit
ba7489ee79
4 changed files with 16 additions and 1 deletions
|
@ -4,6 +4,9 @@ import ru.bclib.BCLib;
|
|||
import ru.bclib.api.dataexchange.handler.autosync.AutoSync;
|
||||
|
||||
public class ClientConfig extends NamedPathConfig {
|
||||
public static final ConfigToken<Boolean> SUPPRESS_EXPERIMENTAL_DIALOG = ConfigToken.Boolean(false, "suppressExperimentalDialogOnLoad", "ui");
|
||||
|
||||
@ConfigUI(topPadding = 12)
|
||||
public static final ConfigToken<Boolean> ENABLED = ConfigToken.Boolean(true, "enabled", AutoSync.SYNC_CATEGORY);
|
||||
|
||||
@ConfigUI(leftPadding = 8)
|
||||
|
@ -46,4 +49,7 @@ public class ClientConfig extends NamedPathConfig {
|
|||
public boolean isShowingModInfo() {
|
||||
return get(DISPLAY_MOD_INFO) /*&& isAllowingAutoSync()*/;
|
||||
}
|
||||
public boolean suppressExperimentalDialog() {
|
||||
return get(SUPPRESS_EXPERIMENTAL_DIALOG);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ import ru.bclib.api.LifeCycleAPI;
|
|||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
import ru.bclib.api.dataexchange.DataExchangeAPI;
|
||||
import ru.bclib.api.datafixer.DataFixerAPI;
|
||||
import ru.bclib.config.Configs;
|
||||
import ru.bclib.interfaces.CustomColorProvider;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
@ -72,6 +73,11 @@ public abstract class MinecraftMixin {
|
|||
else {
|
||||
LifeCycleAPI._runBeforeLevelLoad();
|
||||
}
|
||||
|
||||
if (Configs.CLIENT_CONFIG.suppressExperimentalDialog()) {
|
||||
this.doLoadLevel(levelID, RegistryAccess.builtin(), Minecraft::loadDataPacks, Minecraft::loadWorldData, false, ExperimentalDialogType.NONE);
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "createLevel", at = @At("HEAD"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue