Jump to content

Recommended Posts

Posted

When I was programming in Minecraft 1.7, I used to code all of my mods in one instance of Eclipse. I had my core mod, then set the "dependencies" in the @Mod section for other mods to my core mod. However, in 1.8, when I add a second class with an @Mod at the start, it seems to error and none of my mods load. How do I go about fixing this problem? Do I need to program each mod in a separate instance of Eclipse now? If so, how do I go about making that work? I've never had this error before, and it only happens when I put in the @Mod coding into two separate classes because they're two separate mods (though, I set the dependencies of the second mod to the first mod).

 

I should note that if I don't have the dependency set, Forge just crashes and doesn't run either mod. Here's my coding for the two main class files:

package sureen.core;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import sureen.core.events.ConfigEvent;
import sureen.core.events.CustomDrops;
import sureen.core.gen.SureenWorldGen;
import sureen.core.proxy.CommonProxy;
import sureen.core.registry.SureenBlocks;
import sureen.core.registry.SureenCraftingManager;
import sureen.core.registry.SureenItems;

@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION)
public class SureenCore {

@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
public static CommonProxy proxy;
public static Logger logger = LogManager.getLogger(Reference.MOD_NAME);

@Mod.Instance("sureencore")
public static SureenCore instance;

public static ToolMaterial CrystalMaterial = EnumHelper.addToolMaterial("Crystal", 4, 2146, 12.0F, 5.0F, 20);
public static ArmorMaterial CrystalArmor = EnumHelper.addArmorMaterial("CrystalArmor", "sureencore:crystal", 40, new int[]{4, 10, 8, 4}, 20);

public static CreativeTabs SureenCoreTab = new CreativeTabs("SureenCoreTab") {
	public Item getTabIconItem() {
		return SureenItems.tab_icon;
	}
};

@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
        logger.info(TextHelper.localize("info." + Reference.MOD_ID + ".console.load.preInit"));

        SureenItems.init();
	SureenItems.register();
        SureenBlocks.init();
	SureenBlocks.register();

	SureenCraftingManager.init();

        FMLCommonHandler.instance().bus().register(new ConfigEvent());
        FMLCommonHandler.instance().bus().register(new CustomDrops());

        GameRegistry.registerWorldGenerator(new SureenWorldGen(), 2);
}

@EventHandler
public void init(FMLInitializationEvent event)
{
        logger.info(TextHelper.localize("info." + Reference.MOD_ID + ".console.load.init"));

        proxy.registerRenders();
}

@EventHandler
public void postInit(FMLPostInitializationEvent event)
{
        logger.info(TextHelper.localize("info." + Reference.MOD_ID + ".console.load.postInit"));

}

}

And Reference:

package sureen.core;

public class Reference {
public static final String MOD_ID = "sureencore";
public static final String MOD_NAME = "Sureen Core";
public static final String VERSION = "1.0-FML1.8";
public static final String CLIENT_PROXY_CLASS = "sureen.core.proxy.ClientProxy";
public static final String SERVER_PROXY_CLASS = "sureen.core.proxy.CommonProxy";

}

 

package sureen.youtubers;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import sureen.youtubers.proxy.CommonProxy;
import sureen.youtubers.registry.YoutubersItems;

@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION, dependencies = Reference.DEPENDENCIES)
public class YoutubersCore {

@Mod.Instance("youtubers")
public static YoutubersCore instance;

@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
public static CommonProxy proxy;
public static Logger logger = LogManager.getLogger(Reference.MOD_NAME);

public static ToolMaterial YoutubersMaterial = EnumHelper.addToolMaterial("YoutubersTool", 5, 2731, 16.0F, 8.0F, 20);
/*
public static CreativeTabs CaptainSparklez = new CreativeTabs("CaptainSparklezTab") {
	public Item getTabIconItem() {
		return YoutubersItems.sparklez_essence;
	}
};

public static CreativeTabs FuriousDestroyer = new CreativeTabs("FuriousDestroyerTab") {
	public Item getTabIconItem() {
		return YoutubersItems.pat_essence;
	}
};

public static CreativeTabs SuperGirlyGamer = new CreativeTabs("SuperGirlyGamerTab") {
	public Item getTabIconItem() {
		return YoutubersItems.jen_essence;
	}
};

public static CreativeTabs DanTDM = new CreativeTabs("DanTDMTab") {
	public Item getTabIconItem() {
		return YoutubersItems.dan_essence;
	}
};

public static CreativeTabs SethBling = new CreativeTabs("SethBlingTab") {
	public Item getTabIconItem() {
		return YoutubersItems.seth_essence;
	}
};

public static CreativeTabs CraftyGirls = new CreativeTabs("CraftyTab") {
	public Item getTabIconItem() {
		return YoutubersItems.stef_essence;
	}
};

public static CreativeTabs Aureylian = new CreativeTabs("AureylianTab") {
	public Item getTabIconItem() {
		return YoutubersItems.aureylian_essence;
	}
};

public static CreativeTabs Vechs = new CreativeTabs("VechsTab") {
	public Item getTabIconItem() {
		return YoutubersItems.vechs_essence;
	}
};

public static CreativeTabs YoutuberSpawnEgg = new CreativeTabs("YoutuberSpawnEggTab") {
	public Item getTabIconItem() {
		return YoutubersItems.youtubers_egg_icon;
	}
};
*/
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
        logger.info(TextHelper.localize("info." + Reference.MOD_ID + ".console.load.preInit"));
}

@EventHandler
public void init(FMLInitializationEvent event)
{
        logger.info(TextHelper.localize("info." + Reference.MOD_ID + ".console.load.init"));

        proxy.registerRenders();
}

@EventHandler
public void postInit(FMLPostInitializationEvent event)
{
        logger.info(TextHelper.localize("info." + Reference.MOD_ID + ".console.load.postInit"));

}

}

And Reference:

package sureen.youtubers;

public class Reference {
public static final String MOD_ID = "youtubers";
public static final String MOD_NAME = "Minecraft-Youtubers";
public static final String VERSION = "1.0-FML1.8";
public static final String CLIENT_PROXY_CLASS = "sureen.youtubers.proxy.ClientProxy";
public static final String SERVER_PROXY_CLASS = "sureen.youtubers.proxy.CommonProxy";
public static final String GUIFACTORY = "sureen.youtubers.client.gui.ConfigGuiFactory";
public static final String DEPENDENCIES = "sureencore";

}

 

Here's my error report with the dependencies:

[00:39:51] [Client thread/INFO] [FML]: Searching C:\Users\Sureen Ink\Desktop\Minecraft Mods\forge-1.8-1334\eclipse\mods for mods
[00:39:51] [Client thread/WARN] [FML]: Unable to parse dependency string sureencore
[00:39:51] [Client thread/WARN] [FML]: Identified a problem with the mod candidate C:\Users\Sureen Ink\Desktop\Minecraft Mods\forge-1.8-1334\bin, ignoring this source
net.minecraftforge.fml.common.LoaderException
at net.minecraftforge.fml.common.Loader.computeDependencies(Loader.java:680) ~[Loader.class:?]
at net.minecraftforge.fml.common.FMLModContainer.bindMetadata(FMLModContainer.java:152) ~[FMLModContainer.class:?]
at net.minecraftforge.fml.common.discovery.DirectoryDiscoverer.exploreFileSystem(DirectoryDiscoverer.java:120) ~[DirectoryDiscoverer.class:?]
at net.minecraftforge.fml.common.discovery.DirectoryDiscoverer.exploreFileSystem(DirectoryDiscoverer.java:89) ~[DirectoryDiscoverer.class:?]
at net.minecraftforge.fml.common.discovery.DirectoryDiscoverer.exploreFileSystem(DirectoryDiscoverer.java:89) ~[DirectoryDiscoverer.class:?]
at net.minecraftforge.fml.common.discovery.DirectoryDiscoverer.discover(DirectoryDiscoverer.java:53) ~[DirectoryDiscoverer.class:?]
at net.minecraftforge.fml.common.discovery.ContainerType.findMods(ContainerType.java:42) ~[ContainerType.class:?]
at net.minecraftforge.fml.common.discovery.ModCandidate.explore(ModCandidate.java:71) ~[ModCandidate.class:?]
at net.minecraftforge.fml.common.discovery.ModDiscoverer.identifyMods(ModDiscoverer.java:131) [ModDiscoverer.class:?]
at net.minecraftforge.fml.common.Loader.identifyMods(Loader.java:348) [Loader.class:?]
at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:469) [Loader.class:?]
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:208) [FMLClientHandler.class:?]
at net.minecraft.client.Minecraft.startGame(Minecraft.java:446) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:356) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
at GradleStart.main(Unknown Source) [start/:?]
[00:39:52] [Client thread/INFO] [FML]: Forge Mod Loader has identified 3 mods to load

 

And here's the error report without the dependency plugged in:

---- Minecraft Crash Report ----
// I blame Dinnerbone.

Time: 5/18/15 12:32 AM
Description: Initializing game

java.lang.IllegalArgumentException: Can not set static sureen.core.SureenCore field sureen.core.SureenCore.instance to sureen.youtubers.YoutubersCore
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(Unknown Source)
at java.lang.reflect.Field.set(Unknown Source)
at net.minecraftforge.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:411)
at net.minecraftforge.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:342)
at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:498)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:493)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:208)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:446)
at net.minecraft.client.Minecraft.run(Minecraft.java:356)
at net.minecraft.client.main.Main.main(Main.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
at GradleStart.main(Unknown Source)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Stacktrace:
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(Unknown Source)
at sun.reflect.UnsafeStaticObjectFieldAccessorImpl.set(Unknown Source)
at java.lang.reflect.Field.set(Unknown Source)
at net.minecraftforge.fml.common.FMLModContainer.parseSimpleFieldAnnotation(FMLModContainer.java:411)
at net.minecraftforge.fml.common.FMLModContainer.processFieldAnnotations(FMLModContainer.java:342)
at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:498)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:493)
at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:208)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:446)

-- Initialization --
Details:
Stacktrace:
at net.minecraft.client.Minecraft.run(Minecraft.java:356)
at net.minecraft.client.main.Main.main(Main.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
at GradleStart.main(Unknown Source)

-- System Details --
Details:
Minecraft Version: 1.8
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.8.0_45, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 796569776 bytes (759 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.10 FML v8.0.37.1334 Minecraft Forge 11.14.1.1334 5 mods loaded, 5 mods active
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed
FML{8.0.37.1334} [Forge Mod Loader] (forgeSrc-1.8-11.14.1.1334.jar) Unloaded->Constructed
Forge{11.14.1.1334} [Minecraft Forge] (forgeSrc-1.8-11.14.1.1334.jar) Unloaded->Constructed
sureencore{1.0-FML1.8} [sureen Core] (bin) Unloaded->Errored
youtubers{1.0-FML1.8} [Youtubers] (bin) Unloaded->Errored
Loaded coremods (and transformers): 
Launched Version: 1.8
LWJGL: 2.9.1
OpenGL: GeForce GT 635/PCIe/SSE2 GL version 4.3.0, NVIDIA Corporation
GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

Using VBOs: No
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: []
Current Language: English (US)
Profiler Position: N/A (disabled)

Posted

note:

version numbers can be a range, too.  E.g.

[1.0.0,]

meaning "1.0.0 and later" (note the comma) or

[1.0.0,2.0.0]

meaning "1.0.0 to 2.0.0" (inclusive).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

-headdesk- I feel stupid now... once I read the replies, I checked the original coding of my mod for 1.7 and noticed that same thing... I should have just checked that to begin with xD Sorry I had to trouble you all with something so simple. Thanks for helping me fix it ^^

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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