decompiling and editing craftbukkit

Discussion in 'Plugin Development' started by Megolas, Aug 20, 2012.

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

    Megolas

    Hello - I read that craftbukkit is an open source project and i wanted to change something in it in order to add another feature to my plugin easily.
    How do I do that? Is there a tutorial?
    I tried the github, but when i try to load it into eclipse i get a lot of missing types - what library should i add to the build path?
    Thanks
     
  2. Offline

    greatman

    Normally if you load it with maven it should download everything.
     
  3. Offline

    Megolas

    and how do i make Maven do that? (I have maven installed on eclipse already)

    bump

    Bump

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

    greatman

    Import a maven project and point it at where you downloaded the CB files.
     
  5. Offline

    Goblom

    CraftBukkit and Bukkit (There is a difference) both use Maven which is made by Apache Software. It is fairly simple to use and install and requires little to no work.

    From The Command Line: (instead of downloading the zip you could clone the repo with git.
    git clone git://github.com/bukkit/<repo name>.git)
    Code:
    1 - You need to download Maven at (http://maven.apache.org/download.html)
    2 - Open the contents of the folder you have just downloaded and read the README
    3 - Drag all contents of the zip folder to a place of your choice and add the bin directory of maven to your path (ex. the directory i have installed Maven is C:\Tools\Apache\Maven\, So the PATH that i add is "C:\Tools\Apache\Maven\bin\"
    4 - In order for maven to work you also must need to have javajdk installed and have it added to your PATH, as well as a "JAVA_HOME" PATH which is just the directory that JavaJDK is installed.
    5 - If you have not downloaded CraftBukkit or Bukkit from github do it now and cd into the directory that you have downloaded CraftBukkit or Bukkit.
    6 - From the command line do "mv clean package" without quotes and it should download all necessary packages in order for you to build and run your modified version.
    7 - Now you can edit like crazy from and IDE or text editor of your choice but in order to build CraftBukkit or Bukkit you must do "mv clean package" every time.
    
    From Eclipse:
    Code:
    1 - You first need to install Maven & EGIT for Eclipse to do this go to "Help > Install New Software". Where it says work with select the drop down arrow then "All Available sites". Then where it says "Type filter text" type in "Maven" select both option then search for "Egit" you want to select both "Eclipse EGIT" and Eclipse EGIT Mylyn GitHub Feature" then click next twice and then accept the terms of the license agreement. You will need to restart Eclipse.
    2 - Now you need to download the repository. to do this go to "File > Import > Git > Repositories from GitHub" then "File > Import > Maven > Existing Maven Projects" from there go to your Users folder (ex. C:\Users\Goblom\) once in there select the folder named "git" it will search for the main pom.xml file. Press select all then click finish. Now you chould have a new project named either craftbukkit or bukkit. After you click finish Eclipse will download everything needed to build that project.
    3 - You can now edit and build CraftBukkit and/or Bukkit.
    Hope That Helps :)
     
  6. Offline

    Megolas

    Goblom
    It sure did, thanks! Just a quick question - how do i compile it correctly with the manifest file? Currently im getting errors about the main class (Kind of new to java generally, only done plugins and mini softwares so far)
     
  7. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

  8. Offline

    Megolas

    mbaxter
    There's no maven option in the export (Eclipse) - do I have to use the non-Eclipse maven?
     
  9. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    Run maven separately from eclipse.
     
  10. Offline

    Goblom


    If you did everything exactly as i said earlier then all you need to do is select the project "Export > Java > Jar File"
    If you have correctly edited craftbukkit or bukkit it should compile and export into a jar file ready to be run. If it does not compile please check your syntax and look for any errors, if you think you have done everything correctly but it still does not compile post the errors that you have here and i will help you fix them.

    Also, Make sure you never used the "Tab" button. Java hates it and it will always produce errors. Use "Space" instead.


    If you do prefer the command line which mbaxter has said to use all you need to do is cd into the directory and /mvn clean package
     
  11. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı

    With a default eclipse install you cannot simply "export" craftbukkit. It won't run as it won't shade all the required dependencies.

    Java doesn't care if you use tabs or spaces. At all. It's purely a programmer's choice (spaces are better!)
     
  12. Offline

    Goblom

    hmmm... learned something new. So everytime you want to build bukkit or craftbukkit you have to do it from the command line?
     
  13. Offline

    Shiny Quagsire

    They do have a Maven plugin for Eclipse if you don't feel like running to the command line when you wish to compile.
     
  14. Offline

    Megolas

    Thanks, but i already solved this :)
     
Thread Status:
Not open for further replies.

Share This Page