Detecting craftbukkit build within plugin enable.

Discussion in 'Plugin Development' started by Acru, Feb 18, 2011.

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

    Acru

    It seems that every day I get a couple posts saying 'plugin does not work', only to find the person is using a version of craftbukkit lower than the specified required build number.

    I was wondering if there is a way to check what build a person is using when the plugin is enables, so I can print out an appropriate message? If not, there should be~ :3

    Thanks to anyone who can help!
    --- merged: Feb 18, 2011 9:16 PM ---
    Edit:
    Someone messaged me about this.getServer().getVersion(), but the build number isn't in this string since build 327!
     
  2. Offline

    Plutonium239

    Code:
    CraftServer.class.getPackage().getImplementationVersion()
    That will get you something like this "git-Bukkit-0.0.0-398-ge2ce3db-b311"
     
  3. Offline

    Acru

    This returns the same as this.getServer().getVersion() but minus the " (MC: " + protocolVersion + ")"

    In the more recent builds, it will only return something like git-Bukkit-"39a3bf4", which doesn't help me. Also versions older than build 231 don't include a build number. (Perhaps someone forgot to add the build number to the string during the recent bamboo migration?)
    --- merged: Feb 18, 2011 10:48 PM ---
    Edit:
    Or perhaps there is some way to lookup the "39a3bf4" into a build version?
    In any case, I think the build version needs to be re-added asap, so such a lookup table doesn't have to be long.
    --- merged: Feb 19, 2011 2:20 AM ---
    Linking to:
    http://forums.bukkit.org/threads/high-priority-re-add-build-number-to-implementation-version.4837/
    and
    https://github.com/Bukkit/CraftBukkit/commit/8d1ca4ce0432c32b234a049997cafc264b0887fb#comments
     
Thread Status:
Not open for further replies.

Share This Page