It appears that that newer bukkit releases to not require minecraft_server.jar to operate. How ?

Discussion in 'Bukkit Discussion' started by yanom, Jul 22, 2012.

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

    yanom

    I used Bukkit about half a year ago, and then my server closed down. Now I'm restarting it, and it appears that the latest bukkit releases do not require Mojang's minecraft_server.jar to operate. IIRC, older bukkit did need that .jar file. How does this work? how can it operate a server without any of Mojang's code?
     
  2. Offline

    TnT

    From the very first version of Bukkit released up until today, Bukkit has never required the minecraft_server.jar. It is a replacement for it.

    See here: wiki.bukkit.org/Setting_up_a_server
     
  3. Offline

    yanom

    how does that work? Did they completely reverse-engineer the minecraft_server.jar? Or is Mojang's code hidden inside craftbukkit.jar? (I heard the bukkit people work for Mojang now).
     
  4. Offline

    PurelySatanic

    CraftBukkit encapsulates the original Minecraft server code. Java is incredibly easy to decompile, however in Minecraft's case it was obfuscated so trying to figure out what the methods are actually used for is the hard part.
     
  5. Offline

    DrAgonmoray

    CraftBukkit is actually a mod of the minecraft_server.jar. It indeed does have Mojang code 'hidden' (its actually not really hidden) inside the jar.

    But it has always been this way. I don't know where you have been. :confused:
     
  6. Offline

    deltahat

    To give you a little more detail, in case you are interested, a .jar file is just a renamed .zip file with a special directory structure. If you rename craftbukkit.jar to craftbukkit.zip, you can open it up and see all its contents. Each directory in a .jar file represents what is called a package in Java. Within these directories you will find files that end in a .class extension. Class files are the compiled units of code in Java and their place in the directory structure describes their complete and unique name. For example, the code module called org.bukkit.entity.Player is stored in the \org\bukkit\entity\Player.class file. When the bukkit server attempts to call code in the Player class, the Java runtime looks through all the .jar files it knows about, trying to find a .class file with a directory path that matches the full name of Player. Java doesn't care which .jar file the class is found in, as long as it finds it somewhere.

    The fact that Java doesn't care which .jar file contains the compiled classes it is looking for is leveraged to make craftbukkit run completely inside a single .jar file. The last step of craftbukkit's compilation step is to take all the .class files from all the different .jar files craftbukkit is dependent on and merge them into a single, monolithic craftbukkit.jar. If you open up craftbukkit.jar you will see the bukkit code plugins use (org\bukkit), the craftbukkit code used to bridge plugins and the core game (org\bukkit\craftbukkit), the core minecraft server from Mojang (net\minecraft\server), and lots of other supporting libraries. By combining all these files into a single .jar, craftbukkit is able to run without any outside dependencies.

    I hope that answers your question.
     
    TnT likes this.
  7. Offline

    Jade

    tl;dr It's all inside Craftbukkit.jar and Java doesn't care where the server files are, it looks for them in the booting jar.
     
Thread Status:
Not open for further replies.

Share This Page