Jump to content

Core Mods


Vert3xo

Recommended Posts

So for some time I wanted to learn something more about core mods but I could hardly find anything about them. I realize that for someone as inexperienced as I am it would be stupid to create core mods so this is just for learning purposes. So could anyone explain to me core mods more in depth (what's the difference between normal mod and core mod, when are core mods useful and why would someone want to create them, ...) and/ or link some tutorials? Thanks in advance.

Link to comment
Share on other sites

21 minutes ago, Vert3xo said:

(what's the difference between normal mod and core mod,

Core mods are when you make changes to the minecraft source code (vanilla, Forge, other mod) using the Java ASM package (as D7 mentions, its now done via JavaScript, but the general idea is the same, even if that JS doesn't directly interface with the ASM package). It literally lets you rewrite the compiled bytecode of any class in any way you want.*

 

Quote

when are core mods useful and why would someone want to create them

They are useful when the effect you want to achieve cannot be done in any other way. For example, lets say I want to change how long a Minecraft moon phase is in the overworld. Currently that is defined (something) like this:

 

public int getMoonPhase() {
	return (totalWorldTime() / 24000) % 8;
}

Gosh, that 24,000 looks awfully magic and awfully unchangable...

 

*But hoo boy does that sound dangerous. What if two people modify the same section of code in different ways? Well, you get a conflict, the game crashes,** and no one's happy. This is why core mods are a last resort, only to be done after a request for Forge to insert a hook for modding has failed. They are only to be done with extreme care in very specific ways in order to insure that conflicts are minimized. As such tutorials do not exist.

 

**What happens when a coremod change fails? Well, the game crashes and reports the original code as being at fault! That makes it impossible for anyone to track down what actually happened and why because the original code is incapable of throwing that error and there are no fingerprints left over from your grubby mits going in and changing things.

Edited by Draco18s

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.

Link to comment
Share on other sites

17 minutes ago, diesieben07 said:

It does. Its run via Nashorn and can access the ASM Java packages and some utilities from ModLauncher.

I had as a draft, "I'd be surprised if it doesn't use the ASM library." But as I haven't messed with it or even looked at it, I wasn't confident enough to say that it did. Good to know I was right.

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.

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.