Get targetted minecraft version for craftbukkit.jar in console

Discussion in 'Bukkit Discussion' started by Bertware, Dec 23, 2012.

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

    Bertware

    Hi,

    The wiki describes a way to get the current version of bukkit by using the -v argument. I'm using this for a while in my GUI now, but I want to expand the functionality of my GUI.


    Is there a way similar to this one, that shows the complete string as shown on startup?

    Example result when running with the -v argument:
    git-Bukkit-1.2.5-R4.0-b2222jnks

    What I want:
    This server is running CraftBukkit version git-Bukkit-1.1-R6-9-g66ea5a9-b2000jnks (MC: 1.2.2) (Implementing API version 1.2.2-R0.1-SNAPSHOT)

    Especially (MC: 1.2.2) is what I somehow want to retrieve.
    Does anyone know a way to do this?

    (don't look at the versions / builds , I'm experimenting for compatibility with a wide range of builds)

    Greets,
     
  2. You could try to parse the minecraft version of of Bukkit.getVersion() or you could just hardcode it (you should defenitely do this if you are referencing craftbukkit).
    For what do you need it?
     
  3. Offline

    Bertware

    I'm using it in my GUI to show the users their current craftbukkit version, notify on updates. I want to expand these functions to also show the craftbukkit version, e.g. 1.4.5-R1.0, which works, but the Minecraft version isn't shown when using the --version or -v argument. And the minecraft version doesn't always match the craftbukkit version. I can't really use java functions, I have to run it with a special argument or something similar.
     
  4. You could use the new reference i.e. net.minecraft.server.v_~~~ and take it from there maybe?
     
  5. Offline

    TnT

    1.4.5-R1.0 <- The Minecraft version is 1.4.5, the CraftBukkit version is R1.0. It always matches, unless we have a mistake in our build process. I'll admit, it has happened before, but extremely rare.
     
  6. Offline

    Bertware

    The one I tested didn't match, so that's one of the few mismatched in that case. But nice to hear that, this means I can get it without too many changes in the program :)
    Question solved!
     
Thread Status:
Not open for further replies.

Share This Page