Bukkit Base Plugin Generator - OSX, Linux & Windows - Inc Project Files.

Discussion in 'Resources' started by Pezmc, Jan 26, 2011.

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

    Pezmc

    This mini-program does the entire setup for you to develop java plugin for bukkit and much more. It makes starting a project easier and supports OSX, Linux and Windows.

    Current Version: 2.2

    Features:
    - Supports All OS'
    - Creates Bukkit Java files with project and author names ready
    - Generates Eclipse, Intelij, NetBeans and Ant build files
    - Validates User Input
    - Supports Bukkit Updates, Packages and Automatic Replacing
    - Configuration file for further options

    Instructions:
    - Download from https://github.com/Pezmc/Bukkit-Plugin-Generator/zipball/master
    - Extract & Read the README
    - Either
    - Osx/Linux
    - Run create from inside a shell (terminal) with ./create
    - Windows
    - Run create.bat from windows explorer
    - Answer the questions
    - Done

    Recent Version History:
    2.2 - Juntalis - Added Powershell Script, tidied up netbeans project file, added base config
    2.1 - Juntalis - Fixed GnuWin on x64 and did optimisation
    2.0 - Juntalis - Added generation of Eclipse, Intelij, NetBeans and Ant build files,
    validating user input, further OSX compatibility checks and a configuration file.
    1.3 - Juntalis - Added windows support
    1.2 - 14mRh4X0r - Improvements to class constructor and super call
    1.1 - 14mRh4X0r - Bukkit updates, packages, automatic replacing
    1.0 - Ready for public use
    0.3 - Stability improvements, easier to use
    0.2 - Added automatic file name & content replacement
    0.1 - Original Basic Script by Sli

    If you have problems/ideas please submit issues via github: https://github.com/Pezmc/Bukkit-Plugin-Generator/
    Happy to accept pull requests!

    Many thanks to sli for the original, as well as Juntalis and 14mRh4X0r for some massive improvements (see github) and tomsik68 for the original windows version.
     
    Dimochka likes this.
  2. Offline

    kynian

    when I try to run the program it says "call_handler: couldn't get context of main thread, error 998. how do I fix this? this seems like an excellent program but I havent had a chance to try it cause of this error!
     
  3. Offline

    Pezmc

    What operating system are you trying this on?
     
  4. Offline

    kynian

    Windows 7 64 bit
     
  5. Offline

    Pezmc

    This could possibly be a problem with Windows 7 and GnuWin32, I have posted a message to the person who created these features on github!

    I will post here when we believe the problem is resolved, sorry you are having problems. It worked fine in my VMWare Windows 7
     
  6. Offline

    kynian


    Okay thanks! just so you know its also telling me:

    Bash: warning: could not find /tmp, please create!
    [sig]c:\users\(name)\desktop\programming\pezmc\libexec\bash.exe 1001 <0> call_handler: couldn't get context of main thread, error 998.


    Thats the full error if it helps whoever created that portion.
     
  7. Offline

    thegleek

    most of us plugin dev's already got a stable dev environment up, but what you did for the upcoming community is amazing! i wish this existed months ago when most of us were going thru the trials & tribulations of setting up our first bukkit/plugin dev environment. so just wanted to say thanks for giving back to the community!
     
    TienSon likes this.
  8. Offline

    Pezmc

    @kynian, the problem has now been fixed by changing the bash.exe to another and some further optimisation has been added.

    @thegleek, I am very glad you appreciate this; it is the combined work of a few people and I pass your good wishes onto them as well!

    Does anyone have any feature requests?
     
  9. Offline

    codylawyer

    I am trying to run this on Windows 7 64-bit. i get the following error: "line 205: [: ==: unary operator expected"

    Any ideas?
    Thanks.
     
  10. Offline

    juntalis

    codelawyer, what's your settings.cfg file look like? It should have a

    Code:
    gen_netbeans=0
    or

    Code:
    gen_netbeans=1
    If not, just add one of those lines in. 1 if you want a netbeans project, or 0 if you don't. I'll need to add some checks to make sure the variables each have a value, I guess.
     
  11. Offline

    codylawyer

    Thanks for the help. For some reason settings.cfg was generated without spaces. I had to add a space between each of the options. I used notepad to edit it if that would cause any differences.

    Thanks again
     
  12. Offline

    juntalis

    By the way, if any Windows users are still having issues with the current setup, I wrote a PowerShell script to possibly place the current batch script and binaries. Currently sitting in my repository if you want to test it out.
     
  13. Offline

    rakiru

    When I try to open the NetBeans project file, I get reference errors:
     
  14. Offline

    freman

    I'm having this issue and when I go to build.

    Code:
    Created dir: C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\out\production\TestPlugin
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\build.xml:112: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    Compiling 3 source files to C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\out\production\TestPlugin
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:5: package org.bukkit.entity does not exist
    import org.bukkit.entity.Player;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:6: package org.bukkit does not exist
    import org.bukkit.Server;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:7: package org.bukkit.event.Event does not exist
    import org.bukkit.event.Event.Priority;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:8: package org.bukkit.event does not exist
    import org.bukkit.event.Event;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:9: package org.bukkit.plugin does not exist
    import org.bukkit.plugin.PluginDescriptionFile;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:10: package org.bukkit.plugin does not exist
    import org.bukkit.plugin.PluginLoader;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:11: package org.bukkit.plugin.java does not exist
    import org.bukkit.plugin.java.JavaPlugin;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:12: package org.bukkit.plugin does not exist
    import org.bukkit.plugin.PluginManager;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:19: cannot find symbol
    symbol: class JavaPlugin
    public class TestPlugin extends JavaPlugin {
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPluginPlayerListener.java:3: package org.bukkit does not exist
    import org.bukkit.Location;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPluginPlayerListener.java:4: package org.bukkit.entity does not exist
    import org.bukkit.entity.Player;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPluginPlayerListener.java:5: package org.bukkit.event.player does not exist
    import org.bukkit.event.player.PlayerChatEvent;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPluginPlayerListener.java:6: package org.bukkit.event.player does not exist
    import org.bukkit.event.player.PlayerEvent;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPluginPlayerListener.java:7: package org.bukkit.event.player does not exist
    import org.bukkit.event.player.PlayerListener;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPluginPlayerListener.java:8: package org.bukkit.event.player does not exist
    import org.bukkit.event.player.PlayerMoveEvent;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPluginPlayerListener.java:14: cannot find symbol
    symbol: class PlayerListener
    public class TestPluginPlayerListener extends PlayerListener {
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPluginBlockListener.java:3: package org.bukkit.block does not exist
    import org.bukkit.block.Block;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPluginBlockListener.java:4: package org.bukkit.block does not exist
    import org.bukkit.block.BlockFace;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPluginBlockListener.java:5: package org.bukkit does not exist
    import org.bukkit.Material;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPluginBlockListener.java:6: package org.bukkit.event.block does not exist
    import org.bukkit.event.block.BlockCanBuildEvent;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPluginBlockListener.java:7: package org.bukkit.event.block does not exist
    import org.bukkit.event.block.BlockListener;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPluginBlockListener.java:8: package org.bukkit.event.block does not exist
    import org.bukkit.event.block.BlockPhysicsEvent;
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPluginBlockListener.java:14: cannot find symbol
    symbol: class BlockListener
    public class TestPluginBlockListener extends BlockListener {
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:22: cannot find symbol
    symbol  : class Player
    location: class com.bukkit.Fremnet.TestPlugin.TestPlugin
        private final HashMap<Player, Boolean> debugees = new HashMap<Player, Boolean>();
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:24: cannot find symbol
    symbol  : class PluginLoader
    location: class com.bukkit.Fremnet.TestPlugin.TestPlugin
        public TestPlugin(PluginLoader pluginLoader, Server instance, PluginDescriptionFile desc, File folder, File plugin, ClassLoader cLoader) {
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:24: cannot find symbol
    symbol  : class Server
    location: class com.bukkit.Fremnet.TestPlugin.TestPlugin
        public TestPlugin(PluginLoader pluginLoader, Server instance, PluginDescriptionFile desc, File folder, File plugin, ClassLoader cLoader) {
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:24: cannot find symbol
    symbol  : class PluginDescriptionFile
    location: class com.bukkit.Fremnet.TestPlugin.TestPlugin
        public TestPlugin(PluginLoader pluginLoader, Server instance, PluginDescriptionFile desc, File folder, File plugin, ClassLoader cLoader) {
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:52: cannot find symbol
    symbol  : class Player
    location: class com.bukkit.Fremnet.TestPlugin.TestPlugin
        public boolean isDebugging(final Player player) {
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:60: cannot find symbol
    symbol  : class Player
    location: class com.bukkit.Fremnet.TestPlugin.TestPlugin
        public void setDebugging(final Player player, final boolean value) {
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:22: cannot find symbol
    symbol  : class Player
    location: class com.bukkit.Fremnet.TestPlugin.TestPlugin
        private final HashMap<Player, Boolean> debugees = new HashMap<Player, Boolean>();
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:37: cannot find symbol
    symbol  : class PluginManager
    location: class com.bukkit.Fremnet.TestPlugin.TestPlugin
            PluginManager pm = getServer().getPluginManager();
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:37: cannot find symbol
    symbol  : method getServer()
    location: class com.bukkit.Fremnet.TestPlugin.TestPlugin
            PluginManager pm = getServer().getPluginManager();
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:41: cannot find symbol
    symbol  : class PluginDescriptionFile
    location: class com.bukkit.Fremnet.TestPlugin.TestPlugin
            PluginDescriptionFile pdfFile = this.getDescription();
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\src\com\bukkit\Fremnet\TestPlugin\TestPlugin.java:41: cannot find symbol
    symbol  : method getDescription()
    location: class com.bukkit.Fremnet.TestPlugin.TestPlugin
            PluginDescriptionFile pdfFile = this.getDescription();
    34 errors
    C:\Users\Shannon\Documents\NetBeansProjects\TestPlugin\build.xml:112: Compile failed; see the compiler error output for details.
    BUILD FAILED (total time: 2 seconds)
    
    I made sure bukkit was loaded as a library...
     
  15. Offline

    juntalis

    You need to link the BukkitMod jar file in your build script or IDE project. Since the script doesn't know where you keep it, it cant make a reference to it. I may see about writing that in soon though.

    I updated my repository with some fixes to the NetBeans project. Other than you needing to link the BukkitMod library, it should work fine.
     
  16. Offline

    Pezmc

    Changed pulled across into main repo, very interested with the PS script, will play with it later!
     
  17. Offline

    Chicken325

    I need help making a base project here.
     
  18. Offline

    rakiru

    Thanks for the great tool. A couple of problems though: The powershell script exits before you can read the yellow message at the end (saying that you have to reference bukkit manually). When first opening the project (I use NetBeans), it reports that it cannot find the folder "plugin-names_src" (or something similar), as the folder is just called "src". It breaks if the plugin name includes a space. For example:
     
  19. Offline

    Ian

    Hey, I used it to create a plugin template, and then used Eclipse to edit the individual "Plugin Name.java", "Plugin Name Block Listener.java" and "Plugin Name Player Listener.java. But, now how do i compile it into a .jar to use with my Bukkit Server. Thanks
     
  20. Offline

    Reldefo

    Code:
     ___   _     _     _     _  _____
    | |_) | | | | |_/ | |_/ | |  | |
    |_|_) \_\_/ |_| \ |_| \ |_|  |_|
    
     __    ____  _      ____  ___    __   _____  ___   ___
    / /`_ | |_  | |\ | | |_  | |_)  / /\   | |  / / \ | |_)
    \_\_/ |_|__ |_| \| |_|__ |_| \ /_/--\  |_|  \_\_/ |_| \
     
    Reading config...
    Author's name: mike
    Plugin's name: testPlugin
    Plugin Version (0.1 by default): 0.1
    Generating  manifest..
    
    Plugin: testPlugin
    Version: 0.1
    Author: mike
    
    Generating Source Files..
    sed: /Users/michael/files/BlockListener.java: No such file or directory
    sed: /Users/michael/files/PlayerListener.java: No such file or directory
    sed: /Users/michael/files/YPlugin.java: No such file or directory
    
    ~~~ Done! ~~~
    
    This is what happens when I run it through my terminal. Any solutions?
     
  21. Offline

    WMisiedjan

    How does this work with Eclipse?
     
  22. Offline

    Zombrock

    View attachment 1267

    Erm... I would love to use this program, but it seems I am unable to. Another windows 7 user here.
    --- merged: Feb 28, 2011 3:35 AM ---
    Also, Here's that picture I forgot to fully upload of the error I get.
    346363656356.JPG
     
  23. Offline

    Gness

    1ST RUN
    Code:
     ___   _     _     _     _  _____
    | |_) | | | | |_/ | |_/ | |  | |
    |_|_) \_\_/ |_| \ |_| \ |_|  |_|
    
     __    ____  _      ____  ___    __   _____  ___   ___
    / /`_ | |_  | |\ | | |_  | |_)  / /\   | |  / / \ | |_)
    \_\_/ |_|__ |_| \| |_|__ |_| \ /_/--\  |_|  \_\_/ |_| \
    
    Reading config...
    Author's name: Gness
    Plugin's name: FarmYard
    Plugin Version (0.1 by default): 0.1
    Generating  manifest..
    
    Plugin: FarmYard
    Version: 0.1
    Author: Gness
    
    
    And it freezes...

    2ND RUN
    bash.exe crashes

    3RD RUN
    bash.exe crashes again but this time sources are generated

    (Just to test)
    4TH RUN
    Same as 2ND

    5TH RUN
    Works like a charm! ^_^

    As i can see it is very unstable
     
  24. Offline

    zipfe

    Tested on OS X - works perfect. Thanks, Pezmc!
     
  25. Offline

    MationMac

    I got the base, now what?
     
  26. Offline

    rymate1234

    I also has that problem

    running windows 7 64 bit
     
  27. Offline

    DDMoose

    I'm running Windows 7 64 bit and was able to launch the bat file okay. Both of you got the same error I got the first time I ran it and it is a very easy fix. I don't have a lot of knowledge about all the cool stuff you can do with batch files, so I don't know how to properly fix this, but I do have some DOS command knowledge and had it in a rather short directory when I tried and got the error that H:\Bukkit is not blah blah blah which tipped me off right away what the problem is something can't understand a space in the directory tree cause my path to it was H:\Bukkit Plugins\.... Not sure why the error happens if it is because of the batch file or something in windows but I suspect somewhere in a file double quotes around one line just need to be added to fix this. AKA Queue plugin creator here :)

    The simply fix for the time being to check this out is to find the spaces in the file tree to the batch file and remove them.

    So....
    Code:
    C:\blah blah\create.bat
    NOT OK Will produce that error about C:\blah is not a.....

    But....
    Code:
    C:\blahblah\create.bat
    Is ok and will work and launch the bat file ok

    Hope this helps everyone
     
  28. Offline

    MrAdam

    Any plans on updating the template?
     
    phondeux likes this.
  29. Offline

    jcgurango

    I keep getting this error with the generated file:
    The constructor JavaPlugin(PluginLoader, Server, PluginDescriptionFile, File, File, ClassLoader) is undefined CraftRPG.java /CraftRPG/src/jcgurango/CraftRPG line 25 Java Problem

    Edit:
    I found the problem. This definition isn't supposed to be there:
    Code:
        public CraftRPG(PluginLoader pluginLoader, Server instance, PluginDescriptionFile desc, File folder, File plugin, ClassLoader cLoader) {
            super(pluginLoader, instance, desc, folder, plugin, cLoader);
            // TODO: Place any custom initialisation code here
    
            // NOTE: Event registration should be done in onEnable not here as all events are unregistered when a plugin is disabled
        }
    I took that out, and it was working completely fine.
     
  30. Offline

    Lame One

    "'D:\Minecraft\Bukkit' is not recognized as an internal or external command, operable program, or batch file"
    It shows this twice, then the prompt ends (says press any key to continue.) I tried this in the C: drive, and it worked fine, but I very much prefer to keep everything on the D: drive. Is this just something that I'm going to have to deal with?
     
Thread Status:
Not open for further replies.

Share This Page