Skip to content

Commit

Permalink
obfuscate old forge config guis - saves ~500 bytes
Browse files Browse the repository at this point in the history
just need the providers
also not tested
  • Loading branch information
rhysdh540 committed May 31, 2024
1 parent a1f068d commit 2544a77
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,6 @@
@SuppressWarnings("unused")
public class ArchaicConfigProvider implements IModGuiFactory {

public static class ArchaicZumeConfigGUI extends GuiConfig {

public ArchaicZumeConfigGUI(GuiScreen parentScreen) {
super(parentScreen, Collections.emptyList(), MOD_ID, false, false, "config");

ZumeAPI.openConfigFile();
}

@Override
public void initGui() {
Minecraft.getMinecraft().displayGuiScreen(parentScreen);
}

}

@Override
public Class<? extends GuiScreen> mainConfigGuiClass() {
return ArchaicZumeConfigGUI.class;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package dev.nolij.zume.archaic;

import cpw.mods.fml.client.config.GuiConfig;
import dev.nolij.zume.api.platform.v1.ZumeAPI;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;

import java.util.Collections;

import static dev.nolij.zume.impl.ZumeConstants.MOD_ID;

public class ArchaicZumeConfigGUI extends GuiConfig {

public ArchaicZumeConfigGUI(GuiScreen parentScreen) {
super(parentScreen, Collections.emptyList(), MOD_ID, false, false, "config");

ZumeAPI.openConfigFile();
}

@Override
public void initGui() {
Minecraft.getMinecraft().displayGuiScreen(parentScreen);
}

}
2 changes: 1 addition & 1 deletion proguard.pro
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

# Legacy Forge config providers
-keep,allowoptimization class dev.nolij.zume.** implements *.*.fml.client.IModGuiFactory
-keep,allowoptimization class dev.nolij.zume.** extends *.*.fml.client.config.GuiConfig { *; }
-keep,allowoptimization,allowobfuscation class dev.nolij.zume.** extends *.*.fml.client.config.GuiConfig { *; }

-keep,allowoptimization class io.github.prospector.modmenu.** { *; } # ugly classloader hack

Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,14 @@
package dev.nolij.zume.vintage;

import dev.nolij.zume.api.platform.v1.ZumeAPI;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.fml.client.IModGuiFactory;
import net.minecraftforge.fml.client.config.GuiConfig;

import java.util.Collections;
import java.util.Set;

import static dev.nolij.zume.impl.ZumeConstants.MOD_ID;

@SuppressWarnings("unused")
public class VintageConfigProvider implements IModGuiFactory {

public static class VintageZumeConfigGUI extends GuiConfig {

public VintageZumeConfigGUI(GuiScreen parentScreen) {
super(parentScreen, Collections.emptyList(), MOD_ID, false, false, "config");

ZumeAPI.openConfigFile();
}

@Override
public void initGui() {
this.onGuiClosed();
Minecraft.getMinecraft().displayGuiScreen(parentScreen);
}

}

@Override
public GuiScreen createConfigGui(GuiScreen parentScreen) {
return new VintageZumeConfigGUI(parentScreen);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package dev.nolij.zume.vintage;

import dev.nolij.zume.api.platform.v1.ZumeAPI;
import net.minecraftforge.fml.client.config.GuiConfig;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;

import java.util.Collections;

import static dev.nolij.zume.impl.ZumeConstants.MOD_ID;

public class VintageZumeConfigGUI extends GuiConfig {

public VintageZumeConfigGUI(GuiScreen parentScreen) {
super(parentScreen, Collections.emptyList(), MOD_ID, false, false, "config");

ZumeAPI.openConfigFile();
}

@Override
public void initGui() {
this.onGuiClosed();
Minecraft.getMinecraft().displayGuiScreen(parentScreen);
}

}

0 comments on commit 2544a77

Please sign in to comment.