Posted October 22, 2015 Has anyone had any luck with this yet? So far I've been unable to get a working successfully recompiled server.jar with any changes I made. Share this post Link to post Share on other sites
Posted October 22, 2015 I did it only to test out the process myself, and it worked for that. Others I know have changed small things like the default starting inventory etc. Share this post Link to post Share on other sites
Posted October 22, 2015 Would you be up for posting how/where you failed Alex, so others can learn too? Share this post Link to post Share on other sites
Posted October 22, 2015 Others I know have changed small things like the default starting inventory etc. Would be great if methods for doing this were shared. 2 Share this post Link to post Share on other sites
Posted October 22, 2015 Alright i got the digging working like mining where it places the dirt on the ground. Process of making most mods seems to be: Decompile server.jarCopy class you want to edit to your IDE of choiceInclude all required librariesEdit the decompiled class's code to correct mistakes made by the decompiler (comparing booleans to ints, renaming variables, missing brackets, etc)Make your changes to class for your mod, recompile your .java file to .classCopy your new .class into the correct directory in server.jarLaunch your server and enjoy your new mod Share this post Link to post Share on other sites
Posted October 22, 2015 Would be great if methods for doing this were shared. Share this post Link to post Share on other sites
Posted October 22, 2015 Not familiar with Java namespaces but surely it has a way to override classes without having to do it all in one sourcefile? Pretty much a fundamental principle of object oriented programming. Share this post Link to post Share on other sites
Posted October 23, 2015 Here is what I did. Do not use jd-gui to decompile, you will just have hundreds of errors on recompile... So what worked. eclipse and ce are free, just download them:decompile with CEused eclipse to load in the reference libraries (server.jar, common.jar) and all the files in the lib directoryload in your decompiled class (now a .java) that you want to edit.rename the container object thing (don't know the term) in eclipse to match the com.wurmonline.server.(whatever it is) (this is the header of where the .java you brought in is. if you don't rename it, there is an error. maybe a java person can explain it better, it just has to be done and I did what others told me to do)then you are basically done with the code, eclipse defaults to autocompile so go to the folder for it and it will have the .class file.take that class file and put it back into the server.jar replacing the old one. 1 Share this post Link to post Share on other sites
Posted October 23, 2015 So what worked. eclipse and ce are free, just download them:decompile with CE I can't seem to find "CE" can you link to the specific software you are speaking about? Share this post Link to post Share on other sites
Posted October 23, 2015 (edited) Here is what I did. Do not use jd-gui to decompile, you will just have hundreds of errors on recompile... So what worked. eclipse and ce are free, just download them: decompile with CE used eclipse to load in the reference libraries (server.jar, common.jar) and all the files in the lib directory load in your decompiled class (now a .java) that you want to edit. rename the container object thing (don't know the term) in eclipse to match the com.wurmonline.server.(whatever it is) (this is the header of where the .java you brought in is. if you don't rename it, there is an error. maybe a java person can explain it better, it just has to be done and I did what others told me to do) then you are basically done with the code, eclipse defaults to autocompile so go to the folder for it and it will have the .class file. take that class file and put it back into the server.jar replacing the old one. Yeah I was using jd-gui initially but switched to procyon when jg-gui was unable to decompile a bunch of methods that I had to change to allow deeding near the start deed or non allied deeds. Our pvp server is not set to be like epic or challenge, because we didn't want the curve, but as such you aren't allowed to deed within 100 tiles of another deed unless you share an alliance. Seems to be working alright except for in classes with embedded sql, because I'm not exactly sure how to compile those correctly yet. Haven't gotten that far in my databases course All I wanted to do was set boolean allianceOnly = false in Villages.class, but the server just crashes on start when I reinsert this class after decompiling, even if I make no changes. x-x Edited October 23, 2015 by Alexgopen Share this post Link to post Share on other sites
Posted October 23, 2015 Some have said they are making a framework, once that is in place it will let you make changes without digging into the code, so just have to wait a bit for things to develop more. Share this post Link to post Share on other sites
Posted October 24, 2015 I can't seem to find "CE" can you link to the specific software you are speaking about? I have no luck finding this "CE" either. Share this post Link to post Share on other sites
Posted October 24, 2015 I have no luck finding this "CE" either. I asked on IRC - I was given this: http://sourceforge.net/projects/classeditor/files/classeditor/2.23/ I can't get it to actually open any .jar files though, and there isn't much support available for it.. It just says "Reading Class C:\...server.jar" and does nothing else. I can however create a new .jar and the features seem to work. JD-GUI is definitely opening these class files instantly but are creating recomp issues. Share this post Link to post Share on other sites
Posted October 24, 2015 (edited) I asked on IRC - I was given this: http://sourceforge.net/projects/classeditor/files/classeditor/2.23/ I can't get it to actually open any .jar files though, and there isn't much support available for it.. It just says "Reading Class C:\...server.jar" and does nothing else. I can however create a new .jar and the features seem to work. JD-GUI is definitely opening these class files instantly but are creating recomp issues. I was using JD-GUI initially, but it would have many many decompilation errors, and usually decompiled parts of classes wrong, which then required me to manually go in and correct errors. It would often fail to decompile entire methods however, which I then could not fix manually, because I couldn't know what they were supposed to do. I ended up switching to a different decompiler called procyon. It works much better and has very very few errors in the code after decompiling. I'd say about 95% of the classes fully decompile correctly when using procyon, as opposed to maybe around 30% without decompilation errors from JD-GUI. I'd highly recommend using procyon as it's the best decompiler I've found so far, and upon asking other programmer friends of mine what decompiler they thought was the best, they also stated procyon. If anyone finds one that works better than procyon, or know of another one that they think is the best, feel free to share. There's still a small fraction of the server jar that it has trouble with. Edit: seeing as we're intended to use decompilers to edit the code and write mods, we might as well just be given source code in the first place *hint hint* Edited October 24, 2015 by Alexgopen 1 Share this post Link to post Share on other sites