[SOLVED] CraftBukkit vs Bukkit

Discussion in 'Plugin Development' started by Courier, Jun 20, 2012.

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

    Courier

    I am a little confused. What is CraftBukkit relative to Bukkit? I've seen people say to link to the Bukkit jar as a library instead of the CraftBukkit jar, but I've seen code which uses calls to CraftBukkit which aren't in Bukkit. Specifically, having to do with PathFinderGoals.

    When I run a server I use the CraftBukkit jar, and when I compile plugins I use the Bukkit jar library. I thought CraftBukkit was just a program for loading plugins (compiled with the Bukkit library) into MC servers, but now I'm not sure exactly what CraftBukkit is.
     
  2. Offline

    Insanehero

    Craftbukkit= Server side
    Bukkit = Plugin development
     
  3. Offline

    ZeusAllMighty11

    I always use craftbukkit 0_o
     
  4. Offline

    Courier

    Okay, so I was pretty much correct.

    I guess my real question is, what is with the bukkit.craftbukkit.* package? Things like CraftEntity, Craft______. They have some useful methods, but are not documented in the Bukkit JavaDocs because they are not in bukkit.jar. Is there any documentation for them? Or do I just have to experiment?
    Why are they not in bukkit.jar? Is is unsafe to use them?
     
  5. Offline

    ImminentFate

    They are constructed files, ready for use by a server.
    The bukkit.jar contains api references, that give you control over everything.
    They are not unsafe to use (I don't think), but Bukkit.jar is more a compilation of the api's and methods, while craftbukkit.jar is an executable that runs the server. Bukkit is also focused on development, and gives you help when you're coding with it. Craftbukkit doesn't.
     
  6. Offline

    Courier

    That makes sense.

    I still don't understand why Bukkit does not have all the API calls CraftBukkit has, namely bukkit.craftbukkit.*.
     
  7. Offline

    ImminentFate

    i don't honestly know. My best guess is that the API calls in craftbukkit are combined from two or more that are found in bukkit. Like, lets say you had CraftEntity, it could be a combination of CraftItemEvent and CraftingInventory, and maybe PlayerInteractEvent.
     
  8. Offline

    desht

    Bukkit is the API that plugins can use. It is a stable API, meaning classes/interfaces/methods won't change without warning. Most plugins only need to develop against this. It has a good set of JavaDoc documentation.

    CraftBukkit is a modified version of the vanilla Minecraft server. It implements the interfaces that Bukkit specifies. Plugins can use CraftBukkit and net.minecraft.server methods directly to achieve some advanced tasks, but there's no stability guarantee. I.e. if your plugin breaks because of a Minecraft/CraftBukkit update, it's your problem. It has no official documentation - you need to use a little initiative to understand the net.minecraft.server structure.
     
    Froshin, tom1000o, Tempelchat and 3 others like this.
  9. Offline

    Courier

    desht: Thanks for the straight answer. That is what I expected, especially after finding net.minecraft.server (which is familiar to me from MCP) in CraftBukkit. I always thought I needed minecraft_server.jar in the same directory as CraftBukkit, but just realised that is completely unused.
     
  10. Offline

    generaldon

    So how do you implement Craftbukkit in a plugin? I've seen it done, but I don't know what files are needed
     
  11. Offline

    Courier

    Just reference craftbukkit.jar instead of bukkit.jar. You can still link to the same JavaDoc too.
     
  12. Offline

    generaldon

    Oh awesome. Thanks!
     
  13. Offline

    Wulf ϡ

    where is the JavaDoc again?
     
  14. Offline

    hawkfalcon

    Jd.bukkit.org
     
  15. Offline

    Courier

  16. Offline

    Wulf ϡ

    I would have to right-click on the project folder right?
    Currently, the link doesn't seem to work...
     
  17. Offline

    Courier

    Yeah, right click the project folder and click properties, or Project > Properties from the ToolStrip while the right project is selected.

    Then here:
    http://imgur.com/znhXy
     
  18. Offline

    scorbin60943

    This was helpful but could I see a example of how the craftbukkit is used?
     
Thread Status:
Not open for further replies.

Share This Page