7 Most Useful Tools For Plugin Developers

Discussion in 'Resources' started by Icyene, Aug 13, 2012.


What This Post In Any Way Useful For You

Poll closed Aug 27, 2012.
  1. Yes

  2. Partially

  3. No

    0 vote(s)
Thread Status:
Not open for further replies.
  1. Offline


    I just found a couple of cool and useful tools that help greatly in developing all sorts of plugins. By the end of this tutorial, I hope you shall have an understanding of what these tools do, how to use them, and maybe even use them in the future. They are ordered in list of most useful to least useful.

    Link: http://findbugs.sourceforge.net/

    FindBugs is a program developed by the Maryland University to help in tracking down bugs. You give it the BukkitAPI.jar, craftbukkit.jar, and yourPlugin.jar, and it is guaranteed to find at least 5 bugs in it. Don't take this personally, however, as alot of these 'bugs' are just dodgy code, switches without default case, etc. Occasionally, however it will find more serious bugs, such as memory leaks, unhandled exceptions, and so on.

    Eclipse and/or Netbeans and/or IntelliJ
    Links: http://www.eclipse.org/downloads/ | http://netbeans.org/downloads/ | http://www.jetbrains.com/idea/

    Well... Obviously. I personally recommend Eclipse Juno, as it has some handy features. Take this scenario: you have 100 variables in a class. You have a method that needs a variable. You type in the class the variable is in name, and Eclipse tries to guess which variable is most useful to you, based on
    how you have used it, and the name of the argument in the function. Very cool. Don't know much about Netbeans, though, but it seems to be like Eclipse, but with a very nice GUI designer. I have used IntelliJ briefly, I can say that it loads hundreds times faster than Eclipse or Netbeans.

    Link: http://www.softpedia.com/get/Programming/Debuggers-Decompilers-Dissasemblers/JD-GUI.shtml

    JD-GUI is a decompiler, that takes .class files and decompiles them for you in a nice GUI. All you do is download it, run the executable, hit the little folder button, and select your class files! Unlike other decompilers such as JAD, JD-GUI will never screw up and return source code full of gotos. While gotos exist in bytecode, they don't in the Java language. JD-GUI understands that, JAD doesn't.
    All in all a very useful tool in many scenarios, if you lost the source of your plugin but still have its jar, or if you want to take a "peak" into a plugin for LEARNING (and ONLY learning) purposes.

    Link: http://mcp.ocean-labs.de/index.php/MCP_Releases

    A very useful tool if you wish to modify the net.minecraft.server classes. It deobfuscates and inserts nice comments into the code to tell you what each function does. There is a README.txt inside the download, and that explains how to install it.

    Link: http://proguard.sourceforge.net/

    Proguard is amazing, in many ways. It has 2 main utilities: optimization, shrinking. Particularly useful if you think your code is inefficient: Proguard will sort things out on a bytecode level. Additionally, you can also run the shrinker. Trust me, its useful. To see what to expect, take a look at the chart on this page, and be amazed.

    Saros Plugin for Eclipse
    Link: http://www.saros-project.org/

    Its basically a Google Docs for Eclipse. Its not updated for Juno, however, so if you plan on using it you must use Eclipse Indigo.

    Link: You should probably already know... http://www.youtube.com

    I swear, there is some very good music on Youtube that can keep you motivated as you crawl through piles of exceptions. Take this one, for example. While listening to that, even writing a 'Hello World' program in Visual Basic makes you feel like a bad arse.

    And thats it! Some other useful things to mention would be the Bukkit forums, StackOverFlow (for any code related problem), Egit and Maven plugin for Eclipse, and having a Github account and repository for your plugins. That way you'll never have to decompile your own jars.

    Hope that helped!
  2. Offline


    Woohoo love the first tool :p The findbugs tool ;P
  3. Offline


    This list is very usefull! I hope someone has some more smart tools!
    I think you should add Git and Maven to the list. And also Github:Windows
  4. 8*

    Link: http://yourkit.com/

    YourKit is a Java profiler that let's you view your server's, and more importantly plugins, performance in real time. Coming with Eclipse integration it's great for any developer, be it Bukkit Minecraft and beyond. Although costly, it's an amazing program worthy of your money.
  5. Offline

    Infamous Jeezy

    I'm not good at locating memory leaks,
    I'm sure I will be forever grateful in the future for you providing us with findbugs, thanks!
  6. Offline


    Icyene have you used Proguard on a Maven project where other libraries are shaded in? I ask because I've been trying to find a clean of doing it with e.g. my ChessCraft plugin. It shades in a common utilities library (dhutils) - the me.desht.dhutils package gets mapped by Maven to me.desht.chesscraft.dhutils when dhutils is shaded into ChessCraft. All well and good, but when I try to run Proguard on the final ChessCraft.jar, I get lots of errors like this:

    Warning: me.desht.chesscraft.dhutils.PersistableLocation: can't find referenced field 'double x' in class me.desht.dhutils.PersistableLocation
    Where PersistableLocation is one of the classes from dhutils that's been shaded into ChessCraft.
    I'm hoping there's some kind of Proguard option you can add to tell it that a package has been mapped, but I haven't been find it so far...
  7. Offline


    desht Sorry, I've never used Maven before :(
  8. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    List o' criticism:

    Bukkit doesn't use MCP deobfuscation, suggesting using MCP for Bukkit plugins is not particularly a good idea as they'll only be more confused when methods they're calling don't exist.

    You forgot intellij on your list of popular IDEs.

    FindBugs is hardly practical in most situations, since most bugs manifest themselves as convenient stack traces.

    Nearly all plugin developers happily share their source code. jd-gui isn't useful unless you're bukkit staff having to approve plugins.

    Advising Proguard obfuscation (even decompiler breaking!) in a community that's into openness and sharing is a terrible, terrible idea. Please remove that from your list. It only encourages selfishness.
  9. Offline


    I do agree with mbaxter here. Except the jd-gui part. Even tho people provide sources, and it is still highly recommended that you get their permission first before poking around in the code, I like it because it helps me When i lost my sources, or all my projects. That has happened to me before. It is also a good tool for server owners to use because they can look and see if anything that isn't supposed to be there is. Like NoCheat++, prime example...

    But other than that i agree!
  10. Offline


    1. Yet MCP is still very, very useful for figuring what method does what. Otherwise, one has to infer what "b()" in class World does. Why reinvent the wheel when its already there? And translating from MCP function calls to Bukkit methods is a trivial task, and you save loads of time.

    2. Added.

    3. I have to disagree on that one; some bugs also manifest themselves as stupid mistakes. If you have a large program to maintain, hunting even the smallest bugs becomes very hard. FindBugs helps in that case. Additionally, it can at times also point out performance issues.

    4. Most cases yes, but I still found it useful in quite a few. I have a tendency to not commit very often, and at one point I accidental did git rm -f on a directory one above the one I wanted to, and all my source code was gone. Hadn't pushed in 10 days, too. JD-GUI truly helped in that case, since I had a binary of my plugin compiled just minutes before.

    5. I'm not advising it, I'm sorry if it appeared like that. I am simply stating its features. Its optimization is the most useful for general plugins, but the obfuscation is part of Proguard, and I'm just saying what its capable of. Plus it is useful for "All Rights Reserved" licensed plugins (I am not encouraging these, don't get me wrong; all my plugins are released under LGPL, and code snippets under WTFPL).
    jtjj222 likes this.
  11. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    You posted a thread labeled 7 most useful tools. You're advising it, promoting it, and suggesting developers hide their code with it. That's completely contrary to this community's style. That's why I asked for its removal.
  12. Offline


    As that may be the "Style" of this community, each developer has the right to protect their own work.

    Am I Wrong?
    jtjj222 likes this.
  13. Offline


    mbaxter I would argue against that. However, I've removed the part about obfuscation from the Proguard section. I still do feel that hiding features of a tool is wrong, but since you requested it I have done it. Either way, a simple reading of the Proguard front page would alert someone of that. Also, as I said before: I am not suggesting they use it, I am just saying that its there if they want to. I don't see how this is harming the open nature of the community at all. This would only be practical on All Rights Reserved plugins, of which there are few. I think having a All Rights Reserved license is more harmful to openness than a tool mentioned in a short paragraph in the Resource section of Bukkit, where lots of developers rarely go,
  14. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    Just because you have the right to it doesn't make it the right thing to do. We're a community all about sharing code, sharing help, sharing resources (or this forum wouldn't be here). Not about writing something and locking it away so nobody can learn from how you implemented your ideas.
  15. Offline


    mbaxter I never said it was the right thing to do. Saying that it is wrong that I said it exists is like not telling someone that you've found a time travel machine in the fear that they will use it to take a bath in it.
  16. Offline


    I agree.

    Open source only betters the community.


    He was talking to me about the right thing to do
  17. Offline


    mbaxter I don't think Icyene was advocating code obfuscation at all - I certainly didn't get that from his original post. Obfuscation is only one of the things Proguard does, and I see no problem with recommending its use. In any case, the whole of Bukkit & CraftBukkit wouldn't exist if it weren't for a closed source game in the first place, so it's kind of hard to justify a Thou Shalt Not Obfuscate Thy Code position (not that I ever would myself, always been an OSS advocate).
    jtjj222 and Icyene like this.
Thread Status:
Not open for further replies.

Share This Page