Jump to content

Recommended Posts

Posted

Hello guys!

 

Some time ago I thought about creating a coremod to have all the classes I need frequently, like PacketHandler or RenderingUtility in a mod which can be accessed by all of my other mods, rather than having the same code in several mods. But then I read something about: Coremods are only for modifying base classes and so on. Is this true? I have no clue how to use this ASM and I don't want to deal with it if it's not necessary. And until now it wasn't and it doesn't look like it will be in future.

So, can I create a coremod just to store some basic structures, register them and use them from my other mods? And is there anything you have to look for or can you just create a normal Mod and use it from elsewhere? Well and if it would go like this there's still the question how to compile the mods which use the coremod...

 

Many questions, I hope anyone can make this clearer to me  ;D

Posted

Honestly I couldn't tell you how bad a core mod is but I've heard that they're horrible.

If you really wanted to do this you could make a mod with the classes that you need, and then create a type of add-on.

I don't know if add-ons are different than any other mod except that it imports another mod's classes.

The proud(ish) developer of Ancients

Posted

Coremod are for advanced patching of Minecraft.

 

What you describe is not a coremod.

You are just spliting into modules, which is doable with no more knowledge than any other mod.

Just move the built jar from the main mod into the folders of each modules, so that gradle will be able to built them.

Posted

from what i read in you first post you want to use dependencies,

thats depending on methods / classes in another mod,

never done it myself, but intend to soon as i'm getting copies of the same classes in several of my mods

 

anyone know of a good and simple tutorial for working with dependencies

 

 

Posted

Honestly I couldn't tell you how bad a core mod is but I've heard that they're horrible.

If you really wanted to do this you could make a mod with the classes that you need, and then create a type of add-on.

I don't know if add-ons are different than any other mod except that it imports another mod's classes.

Horrible in what respect? Horrible when the developer has no clue what they're doing? potentially. But as far as outcome, performance impact, and stability they're pretty much like any other mod out there. In fact it is going to be a bit better in some cases since when used right, it alleviates the need for reflection. And since the changes are only run as the classes are serialized, it's the same as loading pre modified classes.

 

And what Bedrock_Miner was talking about is known as a library. A resource for development. Commonly used classes between mods can be packaged into a library.

 

Dependencies are just adding the modid of the required mod with an argument after./before.  this means you could ship the library with a @mod file/dummy container to have the dependency list, but that's not a crucial aspect if you distribute the library properly.

I think its my java of the variables.

Posted

Heyho Guys!

Thanks so far!

 

Now a new thing:

How can I check if the correct version of the library is installed?

I have found out that you could add requirements to the @Mod annotation like this: dependencies="required-after:minersbasic"

Also I've seen that there is a version control implemented if you add @[1.0.0 or something. But I always use a String in front of the version to clarify whether its a full version or a prerelease (pre-0.1.0 or v.1.0.0). I don't want to change this because it shows clearly whether its a complete Mod or a prerelease. But I don't think, the built-in Version control can work with this. I've created a method which checks the version like I want it to but I don't know how I can get the version of the Mod.

I want to do it as follows:

 

1st: in @Mod I'll add required-after:minersbasic

2nd: in the client and server proxy's preInit I'll add the check if the correct version of the library is loaded.

3rd: if not, I'll add some console output on a dedicated server and a popup window on a combined client to inform the user about what's happening, then I'll shutdown the game.

Is this a good procedure? And my main question: How do I get the Version from the Modid "minersbasic"?

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.