Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I set up a Gui Config for my mod, but when I click the button for it, it does nothing, and the console gives me the following error:

 

 

[Client thread/ERROR] [FML]: There was a critical issue trying to build the config GUI for mobrebirth
java.lang.NoSuchMethodException: f1repl4ce.mobrebirth.MobRebirthConfigGui.<init>(net.minecraft.client.gui.GuiScreen)
at java.lang.Class.getConstructor0(Unknown Source) ~[?:1.8.0_05]
at java.lang.Class.getConstructor(Unknown Source) ~[?:1.8.0_05]
at cpw.mods.fml.client.GuiModList.actionPerformed(GuiModList.java:124) [GuiModList.class:?]
at net.minecraft.client.gui.GuiScreen.mouseClicked(GuiScreen.java:254) [GuiScreen.class:?]
at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:346) [GuiScreen.class:?]
at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:315) [GuiScreen.class:?]
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1730) [Minecraft.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1038) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:961) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_05]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_05]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_05]
at GradleStart.bounce(GradleStart.java:108) [start/:?]
at GradleStart.startClient(GradleStart.java:101) [start/:?]
at GradleStart.main(GradleStart.java:56) [start/:?]

 

 

And now for my code...

Mod Base File:

 

 

package f1repl4ce.mobrebirth;

import java.util.logging.Level;

import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import cpw.mods.fml.client.event.ConfigChangedEvent;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid = "mobrebirth", name = "Mob Rebirth", version = "1.4.0", acceptedMinecraftVersions="1.7.10", canBeDeactivated = true, guiFactory = "f1repl4ce.mobrebirth.MobRebirthGuiFactory")
public class ModBase {

@Instance("mobrebirth")
public static ModBase instance;

public static Configuration file;

@EventHandler
public void PreInit(FMLPreInitializationEvent event) {
	file = new Configuration(event.getSuggestedConfigurationFile());
	syncConfig();
}
public static void syncConfig(){
	ConfigValues.SPAWNMOB = file.get(Configuration.CATEGORY_GENERAL, ConfigValues.SPAWNMOB_NAME, ConfigValues.SPAWNMOB_DEFAULT).getBoolean(ConfigValues.SPAWNMOB_DEFAULT);
	ConfigValues.SPAWNMOBCHANCE = file.get(Configuration.CATEGORY_GENERAL, ConfigValues.SPAWNMOBCHANCE_NAME, ConfigValues.SPAWNMOBCHANCE_DEFAULT).getDouble(ConfigValues.SPAWNMOBCHANCE_DEFAULT);
	ConfigValues.SPAWNANIMALS = file.get(Configuration.CATEGORY_GENERAL, ConfigValues.SPAWNANIMALS_NAME, ConfigValues.SPAWNANIMALS_DEFAULT).getBoolean(ConfigValues.SPAWNANIMALS_DEFAULT);
	if(file.hasChanged()){
        file.save();
	}
}
@EventHandler
public void Init(FMLInitializationEvent event) {
	FMLCommonHandler.instance().bus().register(instance);
	MinecraftForge.EVENT_BUS.register(new MobRebirthHandler());
}
@SubscribeEvent
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent eventArgs) {
     if(eventArgs.modID.equals("mobrebirth"))
         syncConfig();
}
}

 

 

And my GuiFactory File:

 

 

package f1repl4ce.mobrebirth;

import java.util.Set;

import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import cpw.mods.fml.client.IModGuiFactory;

public class MobRebirthGuiFactory implements IModGuiFactory {

@Override
public void initialize(Minecraft minecraftInstance) {

}

@Override
public Class<? extends GuiScreen> mainConfigGuiClass() {
	return MobRebirthConfigGui.class;
}

@Override
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
	return null;
}

@Override
public RuntimeOptionGuiHandler getHandlerFor(
		RuntimeOptionCategoryElement element) {
	return null;
}

}

 

 

and my ConfigGui file:

 

 

package f1repl4ce.mobrebirth;

import java.util.List;

import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.config.ConfigElement;
import net.minecraftforge.common.config.Configuration;
import cpw.mods.fml.client.config.GuiConfig;
import cpw.mods.fml.client.config.IConfigElement;

public class MobRebirthConfigGui extends GuiConfig {

public MobRebirthConfigGui(GuiScreen parentScreen,
		List<IConfigElement> configElements, String modID,
		boolean allRequireWorldRestart, boolean allRequireMcRestart,
		String title) {
	super(parentScreen, 
			new ConfigElement(ModBase.file.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), "mobrebirth", false,
			false, GuiConfig.getAbridgedConfigPath(ModBase.file.toString()));
}

}

 

 

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Guest
This topic is now closed to further replies.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.