Concluding_Ninja Posted April 10, 2016 Share Posted April 10, 2016 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...) Quote Link to comment Share on other sites More sharing options...
Draco18s Posted April 10, 2016 Share Posted April 10, 2016 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. Quote 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 More sharing options...
Concluding_Ninja Posted April 11, 2016 Author Share Posted April 11, 2016 Thank you for the information and recommendation. I was able to dig deep enough to find out how one might do that through forge. That in conjunction with Cloning the Random class I should be able to do what I need to do. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.