Jump to content

Recommended Posts

Posted

Caution: new to Minecraft modding.

I've created a basic mod that works if I launch Minecraft through Eclipse, hurray.

 

However, I'm lost for trying to package it up to put in my regular Minecraft installation or share with others. I tried File -> Export... -> Java-JAR -> and packaging up my .class files and the mcmod.info, and the structure inside the JAR file produced looks like (for instance) the one for ChickenShed, which works.

 

But if I copy my JAR to my mod folder and run Minecraft, it barfs on loading with "Caused by: java.lang.NoSuchFieldError: wool" which is pretty basic...

 

 

  Reveal hidden contents

 

 

What do I need to do different in my mod to have it work outside the Forge/Gradle/Eclipse environment?

Posted

To package a mod, you should(if you have setup the build.gradle file correctly) just have to run "gradlew build" from the command line.

 

I don't use Eclipse, so I don't know if the "Export as Jar" uses this command or not.  I would run this just in case it doesn't.

 

Hopefully this helps a bit.

 

~zombiepig333

Posted

Aha! THAT's what changed from the old tutorials! Simple idea too, and I'm a big fan of simple. For the curious bystander, it puts your built packages in \forge\build\classes\main\ and it makes your .jar in \forge\build\libs\

 

Buuut my JAR doesn't get registered as a mod. At least it doesn't make minecraft crash?

 

It does look like gradlew didn't pick up my mcmod.info and possibly not even the @Mod info from my mod class, since it made a .jar called modid-1.0.jar and the mcmod.info in it was a blank file.

 

I'll look at my build.gradlew - I probably haven't set it up right.

Posted

Yes, I use the default setup exactly as you described.

 

I haven't done Java development in a decade, baring a brief excursion a few years ago, so I'm just not touching anything unless I have to and until I know what I'm doing. Code, I can handle; everything else (build management, for example...) not so much :P

My objects and resource are

 

 

  Reveal hidden contents

 

 

and the two proxies are just the generic ones from the Forge Wiki tutorial by Havvy et al; since I just have two recipes in there, there's nothing to actually DO in either one, but I'll go mess with those later once I know how to actually make my mod go.

 

My build.gradle is (now)

 

  Reveal hidden contents

 

 

my SimpleString.java is

 

  Reveal hidden contents

 

 

And my mcmod.info is now

 

  Reveal hidden contents

 

 

Now, when I run "gradlew build" from D:\Games\forge-1.7.10-10.13.0.1170-src\ it makes

D:\Games\forge-1.7.10-10.13.0.1170-src\build\libs\[1.7.10]SyndarylSimpleString-1.0.jar which looks coherent when I peek inside it and now it has my new mcmod.info, but it doesn't seem to do anything in Minecraft. At least it doesn't crash any more?

I also tried manually zipping up the gradlew-produced class files and adding the mcmod.info by hand, as per the tutorial at http://www.minecraftforge.net/wiki/Releasing_Mods (as if the class files had been built by the MCP scripts instead) but no joy there, either. No crash, but no joy.

 

EDIT: Oh hey. Of course after hitting send, I think I see something. I refactored my classes to a better namespace, and missed updating the @SidedProxy() - but the actual proxy objects DID go to the new namespace and so aren't where it's being told to look.

I'm baffled why that doesn't generate errors, at build time or at run time, but LO AND BEHOLD it's in my mod list now!

 

aaaand now Mincraft crashed again but it's not blaming me for once. :D ("Ticking memory connection"?)

 

Posted

Doesn't seem to be related to my mod, because when I shut down and restarted it didn't reproduce... but hey.

 

This is my minecraft crash-report, where do I find the forge one?

 

  Reveal hidden contents

 

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.