Compiling Custom CraftBukkit?

Discussion in 'Plugin Development' started by MrTwiggy, Jan 31, 2013.

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

    MrTwiggy

    Hey, there. I need to add one or two lines of code to the craftbukkit I'm using on a server to fix an issue that I've been having, however, I'm having issues figuring out how to implement the change and then compile the new modified version of craftbukkit. This is what I attempted to do.

    I made a fork from github.com/Bukkit/CraftBukkit

    I cloned the fork onto my local disc so that I have the CraftBukkit files. I imported it into Eclipse used the EGit plugin and made the modifications to the source file I needed to, saved the change, but when I went to do Export > Jar File, like I normally do for regular plugins, the 'CraftBukkit' project wasn't showing up as an option to export. So then I read up, and it looked like I might need maven, so when I installed maven and put the .POM in my directory and typed 'mvn package' into my CMD, it compiled it correctly, however it looks like it is downloading the CraftBukkit file from the only repository and compiling that, NOT my modified craftbukkit version.

    If anyone could help, I'd appreciate it. Basically, I need to modify craftbukkit.jar slightly, and I don't know how to go about making the modification and compiling it for use.

    Or, is there another way I should go about this, rather then modifying the craftbukkit.jar and somehow doing something else in my plugin instead to get the changes going?
     
  2. Offline

    Jack1312

    I would suggest you don't go changing the craftbukkit.jar without receiving proper guidance as it could lead to serious implications and/or problems. Maybe you can inform us of what this "problem" of yours is and we can hopefully go about a different method of achieving a resolution.
     
  3. Offline

    MrTwiggy

    There's an issue that occurs when opening/closing a player's inventory with the Bukkit API that sometimes causes dead inventories for players when called in conjunction with InventoryClickEvent, which stops Inventory events being fired for players. Someone provided me with a simple solution, but it requires adding 1 line of code into the PlayerConnection.java file, specifically in the handleContainerClose method.

    So, nothing major. It's one line of code that simply performs an extra check, and I just need help compiling the modified code.
     
  4. Offline

    Jack1312

  5. Offline

    MrTwiggy

    Been google searching for the past 2 and a half hours. Anything that is similar either has outdated info / files for me to use referencing older versions of minecraft, or skips large sections of what they did to initially set up the project. Stuff like this: I am compiling the modified project using maven, and am having Y issue. Then Y issue is solved, but I still don't know how I'm supposed to direct my pom.xml compilation to my local modified version of craftbukkit rather then the online updated non-modified version
     
  6. Offline

    Jack1312

    Is this problem you have specific to your server only or is it a known bug?
    If it isn't specific to your server I would suggest reporting it at:

    https://bukkit.atlassian.net/secure/Dashboard.jspa

    Since this isn't really my area of expertise and I haven't really had much experience in this area, nor really required to being a plugin developer, I would suggest to wait for a more knowledgeable Bukkit member to ease your concerns in this area.
     
  7. Offline

    MrTwiggy

    Bumpn
     
  8. Offline

    agaricus

    The pom.xml is included in the repository, it should have already been added to your directory when you did 'git clone'..

    'mvn package' is the correct command. Note it will download the Bukkit API and vanilla server for you, as dependencies of CraftBukkit you might be seeing, but (as long as you're using the pom.xml within the CraftBukkit repo) it will package your modified CraftBukkit code.
     
Thread Status:
Not open for further replies.

Share This Page