|
@@ -1,29 +1,11 @@
|
|
package me.lortseam.completeconfig.gui;
|
|
package me.lortseam.completeconfig.gui;
|
|
|
|
|
|
import me.lortseam.completeconfig.data.Config;
|
|
import me.lortseam.completeconfig.data.Config;
|
|
-import me.lortseam.completeconfig.gui.cloth.ClothConfigScreenBuilder;
|
|
|
|
import net.fabricmc.api.EnvType;
|
|
import net.fabricmc.api.EnvType;
|
|
import net.fabricmc.api.Environment;
|
|
import net.fabricmc.api.Environment;
|
|
-import net.fabricmc.loader.api.FabricLoader;
|
|
|
|
import net.minecraft.client.gui.screen.Screen;
|
|
import net.minecraft.client.gui.screen.Screen;
|
|
|
|
|
|
-import java.util.Optional;
|
|
|
|
-
|
|
|
|
-public interface ConfigScreenBuilder {
|
|
|
|
-
|
|
|
|
- /**
|
|
|
|
- * Returns a new instance of the default screen builder, if present.
|
|
|
|
- *
|
|
|
|
- * <p>More specifically, if installed, the {@link ClothConfigScreenBuilder} is used by default.
|
|
|
|
- *
|
|
|
|
- * @return the default screen builder or an empty value if absent
|
|
|
|
- */
|
|
|
|
- static Optional<ConfigScreenBuilder> getDefault() {
|
|
|
|
- if (FabricLoader.getInstance().isModLoaded("cloth-config2")) {
|
|
|
|
- return Optional.of(new ClothConfigScreenBuilder());
|
|
|
|
- }
|
|
|
|
- return Optional.empty();
|
|
|
|
- }
|
|
|
|
|
|
+public abstract class ConfigScreenBuilder {
|
|
|
|
|
|
/**
|
|
/**
|
|
* Builds a screen based on a config.
|
|
* Builds a screen based on a config.
|
|
@@ -33,6 +15,6 @@ public interface ConfigScreenBuilder {
|
|
* @return the built screen
|
|
* @return the built screen
|
|
*/
|
|
*/
|
|
@Environment(EnvType.CLIENT)
|
|
@Environment(EnvType.CLIENT)
|
|
- Screen build(Screen parentScreen, Config config);
|
|
|
|
|
|
+ public abstract Screen build(Screen parentScreen, Config config);
|
|
|
|
|
|
}
|
|
}
|