Jump to content

[SOLVED][1.9] Changing Forge/Minecraft Code I.E. Base Modding?


Concluding_Ninja

Recommended Posts

Hello All,

 

I'm looking into implementing a mod that shows possible spawner locations. Something along the lines of

for use with identifying some behaviors within Vanilla MC.

 

Implementation details aside. I have identified the classes that need I need to modify or hook into. I need to make some tweaks to net.minecraft.world.gen.feature.WorldGenDungeons.class and net.minecraft.world.gen.ChunkProviderOverworld.class to get the needed information for rendering. WorldGenDungeons has a hook, but I can't use it without querying the Random class which changes the results of the actual generation (Something I am explicitly avoiding). As such, I need to modify the code for Forge or Minecraft directly to get the information without changing the state.

 

How would I go about doing this? The best I can come up with is jar modding Forge itself, but that seems wrong on multiple levels. It seems like there must be a better way. Any pointers? (If you'll pardon the programing pun...)

 

Link to comment
Share on other sites

What you want is a coremod that operates via ASM.

 

ASM is a very deep, dark abyss and you will get minimal help figuring out how to make a coremod.  Primarily because:

 

1) You should not be modifying base classes at all ever, doing so can very easily introduce mod conflicts.

2) ASM requires understanding Java bytecode, you will need to know this before you can start, at all.

3) Providing resources on how to coremod will cause more people to go "yay, I can modify base classes!" when they didn't need to.

 

Given that you are interested in doing this on 1.9, I suggest actually supplying a patch back to Forge as a Pull Request that inserts an event hook where you want it, that way you don't have to modify vanilla classes.

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.