🦀 proguard is dead, clean up build.gradle
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
-ignorewarnings
|
||||
|
||||
-keep class net.fabricmc.api.** { *; }
|
||||
@@ -1,8 +1,6 @@
|
||||
package draylar.omegaconfiggui;
|
||||
|
||||
import draylar.omegaconfig.api.Config;
|
||||
import draylar.omegaconfiggui.api.screen.ModMenuHelper;
|
||||
import draylar.omegaconfiggui.api.screen.OmegaConfigScreen;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
@@ -17,8 +15,8 @@ public class OmegaConfigGui {
|
||||
* @param <T> config type
|
||||
*/
|
||||
public static <T extends Config> void registerConfigScreen(T config) {
|
||||
if (FabricLoader.getInstance().isModLoaded("modmenu")) {
|
||||
ModMenuHelper.injectScreen(config, parent -> new OmegaConfigScreen<>(config, parent));
|
||||
if(FabricLoader.getInstance().isModLoaded("modmenu")) {
|
||||
// ModMenuHelper.injectScreen(config, parent -> new OmegaConfigScreen<>(config, parent));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-12
@@ -1,21 +1,10 @@
|
||||
package draylar.omegaconfiggui.api.screen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||
import draylar.omegaconfig.api.Config;
|
||||
import draylar.omegaconfiggui.mixin.ModMenuAccessor;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class ModMenuHelper {
|
||||
|
||||
public static <T extends Config> void injectScreen(T config, OmegaConfigScreenSupplier<T> factory) {
|
||||
// they will suspect nothing
|
||||
ModMenuAccessor.setConfigScreenFactories(
|
||||
new ImmutableMap.Builder<String, ConfigScreenFactory<?>>()
|
||||
.putAll(ModMenuAccessor.getConfigScreenFactories())
|
||||
.put(config.getModid(), factory::get)
|
||||
.build());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package draylar.omegaconfiggui.mixin;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.terraformersmc.modmenu.ModMenu;
|
||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
@Mixin(ModMenu.class)
|
||||
public interface ModMenuAccessor {
|
||||
@Accessor
|
||||
static ImmutableMap<String, ConfigScreenFactory<?>> getConfigScreenFactories() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Accessor
|
||||
static void setConfigScreenFactories(ImmutableMap<String, ConfigScreenFactory<?>> configScreenFactories) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,7 @@
|
||||
"package": "draylar.omegaconfiggui.mixin",
|
||||
"compatibilityLevel": "JAVA_16",
|
||||
"mixins": [
|
||||
"ClickableWidgetInvoker",
|
||||
"ModMenuAccessor"
|
||||
"ClickableWidgetInvoker"
|
||||
],
|
||||
"client": [
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user