Get source code into a plugin

Discussion in 'Plugin Development' started by Doodledew, Sep 8, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Doodledew

    Hey, this is .. well, a request kindof.
    I have some code for a spawnprotection-plugin.
    I got it from a friend, but he only sent me .class files
    So, I was just wondering if anyone here have time to help me to get the source code
    into a jar. (I tried doing this myself, but failed. As you probably can tell my friend did not include a jar or anything. Just the class files.)

    Here's the download link to the source!
    https://www.dropbox.com/s/yybf20rr2jsxyqs/SpawnProtection.zip

    If this was the wrong section please tell me, I wasn't really sure where to post this C:
     
  2. Offline

    xTrollxDudex

    Doodledew
    This is where you ask for help with creating a plugin... Just use the javac command with the JDK and decompile it with the java compiler
     
  3. wait, nvm, you can't decompile this....
     
  4. Offline

    tommycake50

    Hmm, im gonna look at these files and see what's goin' on brb.

    Doodledew
    Done try this.
    <Edit by Moderator: Redacted mediafire url>
    Haven't tested but i think it should work(Next time tell your friend to export as JAR :cool: ).

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 5, 2016
  5. Offline

    Doodledew

    tommycake50 WOW that was quick! Thank you so much!
    I'll test it now ;)
     
  6. Offline

    Chinwe

    [quote uid=90712855 name="tommycake50" post=1841981]Doodledew
    Done try this.
    <Edit by Moderator: Redacted mediafire url>
    Haven't tested but i think it should work(Next time tell your friend to export as JAR :cool: ).[/quote]


    Ninja'd by mr tommycake50, but on the off chance that that doesn't work, heres my one ;) https://dl.dropboxusercontent.com/u/23855218/SpawnProtection.jar
     
    Last edited by a moderator: Nov 5, 2016
  7. Offline

    Doodledew

  8. Offline

    tommycake50

    What way did you do it?
    I made a new .jar archive then copied the contents of the bin file into it and the .classpath and .project beside it then copied the META-INF off one of my old plugins. And as long as the .class files in the bin directory weren't out of date it works fine.
    I didn't want to import it into eclipse for simplicity's sake.
     
  9. Offline

    Doodledew

  10. Offline

    tommycake50

    Ok im gonna import it into eclipse and try again.
     
  11. Offline

    Chinwe

    tommycake50
    Made a new project in IntelliJ, then spent a while forgetting how to export it properly - then exported a 5mb jar that held bukkit.jar, WorldEdit.jar and WorldGuard.jar :'( But then did it properly - I hope
     
  12. Offline

    Doodledew

    Thanks :D

    Chinwe tommycake50 Hey, what program do you guys use to do this? Would be handy to know :3

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  13. Offline

    Chinwe

    Doodledew
    It works for me, make sure you have WorldEdit and WorldGuard installed (as the plugin will disable if one of them isn't found)

    It just seems that he didn't register the commands properly (didn't .setExecutor() for command in Events.java), and only specified /protection in plugin.yml -> try /prot from console.

    It's exported properly, but not written properly :(
     
    tommycake50 likes this.
  14. Offline

    tommycake50

    This is terribly coded im sorry to say...
    The jars do work i believe. but the coding is off.
    If you want to see if you have any more luck with this(Haven't edited the code but exported from eclipse(won't make any difference but w/e)).
    <Edit by Moderator: Redacted mediafire url>
     
    Last edited by a moderator: Nov 5, 2016
  15. Offline

    Doodledew

  16. Offline

    tommycake50

  17. Offline

    Doodledew

  18. Offline

    tommycake50

    Put the folder in my workspace and created a new project with its name.
     
  19. Offline

    Doodledew

    tommycake50 Hey, the problem in my Events class isn't the build path..
    the error is:
    p.cannot be solved to a variable

    Can you paste your Events.class here?
     
  20. Offline

    tommycake50

    I deleted it. Can you show me your Events class?
     
  21. Offline

    Doodledew

    Aha, never mind! I think I got it :D
     
  22. Offline

    caseif

    For future reference, you can usually just create a new ZIP archive, put the class files+plugin.yml into it, and rename it to *.jar (not *.jar.zip, mind you). :)
     
  23. Offline

    tommycake50

    Yeah, thats why you shouldn't use Winhell7 with hide file extensions on...
     
  24. Offline

    caseif

    Aw, Windows isn't so bad, though admittedly, I do get irrationally annoyed when people hide file extensions.
     
  25. Offline

    Cirno

    I editted my Windows to remove the shortcut icon. What'cha gonna do?
    Anyways, next time, tell your friend to just send you the entire Workspace for the plugin and only the plugin.
     
  26. Offline

    tommycake50

    No its not bad, its just full of bugs part of prism has some horrible security floors and 99% of viruses are targeted at it.
    Yeah not that bad.
     
  27. tommycake50 Linux my young padawan, Linux will save us all...

    Use jd-gui to decompile code and use intellij idea to write code.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
    tommycake50 likes this.
  28. Offline

    tommycake50

    A huge number of plugins have source on github but yeah jd-gui is pretty good.
     
  29. Offline

    caseif

    7 doesn't really have any major bugs or security holes, or at least none that other OSes wouldn't have. As for viruses, why design a vieus for OS X or Linux if you'll infect more computers with one targeted for Windows?
     
Thread Status:
Not open for further replies.

Share This Page