Board Thread:Bug Reports/@comment-25565811-20170120120301/@comment-27190591-20170204134957

LOTRMod wrote: I've never done any coremodding, to be honest. If I only I could edit the code of the method in question, it would be incredibly straightforward to fix, like a couple of lines of code. But I'm certain there is no other way to fix it.

Ranger, do you know of any good coremodding tutorials that you could point me to?

You know, I think learning this would benefit the mod quite a lot. I could accomplish some things in much better ways than the current unstable workarounds, like the mob spawning lagfix and the day-night cycle, to avoid the workarounds causing problems on Cauldron servers... and change the pathfinding code to allow us to have new door types, and fix more vanilla bugs that tend to cause trouble in the LOTR mod, like unlimited vine growth... Good tutorials? Not really. I used this tutorial for 1.6.2 when I started coremodding, and the ASM (the libary that is used by default to manipulate bytecode with a coremod) doc's are useful too, especially their FAQ. But ASM is a lowlevel, bytecode oriented API, and it's pain to work with it if your understanding of bytecode is low. There are API's which allow source level manupilation of bytecode, but none of them are supplied with minecraftforge by default, and I never tried them. The best thing you can do is to download coremods (to example CodeChickenCore) that already exist and learn from their sourcecode. Here is an example from one of my coremods how to replace an entire class, which not even needs ASM (but as you can imagine, this is a bad way if you want to replace one or two lines of code, because this overrides all changes that other coremods might have done). A better way is to replace a method (now you need ASM), or, the best way, to insert the instructions that you need (to example hooks) without replacing the whole method. You can decompile CraftingModCore to see how I did replace some vanilla methods. One last important thing is that you have account obfuscation, if you want to patch vanilla classes. Look at the sourcecode of CraftingModCore to see how I did it. I hope that this did help you a bit. If you have questions, feel free to ask.