Jump to content

Creating a "Core" mod


Kloonder

Recommended Posts

So I was trying to create some "Core" mod, it is not a real core mod, to make changes of vanilla classes or so, but I was tired of creating the same classes and methods in every mod again, so I decided to create my own core mod, but my problem now is, that that my mod crashes when I'm trying to do something with it, for example:

 

BasicGun = new BasicGun();

public class BasicGun extends BasicItem{

public BasicGun() {
	super("BasicGun", 1, CreativeTabs.tabCombat, AdvancedGuns.MODID);
}

//this is the class from the core
´public class BasicItem extends Item{

protected String name;

public BasicItem(String name, int maxStackSize, CreativeTabs tab, String modid){
	this.name = name;
	setCreativeTab(tab);
	setMaxStackSize(maxStackSize);
	setUnlocalizedName(modid + "_" + name);
	Side side = FMLCommonHandler.instance().getEffectiveSide();
	GameRegistry.registerItem(this, name, modid);
	if(side == Side.CLIENT){
		Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(this, 0, new ModelResourceLocation(modid + ":" + name, "inventory"));
	}
}

public String getName(){
	return name;
}
}

And then it crahses

 

 

 

net.minecraftforge.fml.common.LoaderException: java.lang.NoSuchFieldError: field_78037_j

at net.minecraftforge.fml.common.LoadController.transition(LoadController.java:163)

at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:733)

at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:315)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:528)

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)

Caused by: java.lang.NoSuchFieldError: field_78037_j

at de.intektor.klooncore.KloonCore.init(KloonCore.java:22)

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.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:537)

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:212)

at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190)

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:119)

at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:731)

... 12 more

 

 

 

 

I added my mod only in the main folder of forge and added it then to the build path

Creator of Extra Shoes

 

Watch out, I'm total jerk, and I'll troll anybody if it feels like its necessary. Pls report me then

Link to comment
Share on other sites

Well, I'm sorry but I never used the cmd, so I have no idea how to do it, I put the jar in my forge folder, and then I tried this: gradlew deobfJar klooncore-1.0.jar

gradlew deobfJar klooncore-1.0

gradlew deobfJar -jar klooncore-1.0.jar

gradlew deobfJar -jar klooncore-1.0

 

nothing worked

 

it didn't find it

Creator of Extra Shoes

 

Watch out, I'm total jerk, and I'll troll anybody if it feels like its necessary. Pls report me then

Link to comment
Share on other sites

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.