How to make sure your plugin won't break in 1.2

Discussion in 'Plugin Development' started by Dinnerbone, Feb 15, 2012.

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

    Dinnerbone Bukkit Team Member

    Do you use the world height anywhere?

    Bukkit has a method "getMaxHeight()" that will guarantee your plugin will work with either the current height, 1.2's height, or the height five years from now. Please use that instead of hardcoding 127! Also, if you use the sea level - don't just hardcode 64 or height/2, use world.getSeaLevel()!

    Do you use net.minecraft.server stuff, or build for CraftBukkit?

    Please don't! This is a *guaranteed* way that your plugin will break, and we can't help you when it does. Please review every use of you using that code and ask yourself if it's still needed - we've added a lot of cool new API lately that should remove the need for anyone to depend on CraftBukkit!

    Do you use any deprecated methods?

    We're planning to remove all deprecated methods (apart from Player.updateInventory()) in R5. Save yourself a lot of time and effort by making sure you're up to date with the latest code!

    Are you building with an old version of Bukkit?

    We may have changed some API around or deprecated some things since you last downloaded Bukkit. Go download the latest version now, compile and make sure it's all fine. If you're using maven, the latest <version> is "1.1-R4".

    Do you access any of Minecraft's save files directly?

    They're all changing in 1.2, so your plugin likely won't work correctly. Please make absolute sure that you still need to use these files, because we've added a lot of API recently which may be exactly what you need!

    Have a look at the latest specifics on what to change!

    It's just a few pages later in this topic!
    dadaemon, Juze, RROD and 7 others like this.
  2. Offline


    Then treat it as my bad and hate me forever for deleting something that should have been deprecated, but wasn't. That's fine by me.:)
  3. Offline


    This is why this thread was created (and the huge announcement placed at the top of the forums), so you can prepare your plugins before this happens. It's perfectly possible to rewrite your code to be compatible with both R4 and R5, so I don't see the problem. Ample warning is being given.
  4. Offline


    I don't hate anyone and I wasn't commenting on the rest - just noting that I'm not going to notice a change in tutorials after I've written my plugin :)
  5. Offline


    True, some people look at guides on how to use the new things though. ;)
  6. Offline


    Weird statement. Why would I _not_ make as few changes as possible to existing code to be API compliant with the new Event system? There were no indications that the code I had already done (according to guides) was deprecated or even "old", and no code was removed (only added).

    To be fair, I'm only really bothered by having to send out a no-feature added update to the plugin. I also managed to catch the issue simply because I made an extra verification (just running the plugin wasn't enough - I had to test a few cases) - I did rely on deprecation warnings keeping me from having to do that.

    Let's hope I'm the only plugin author that trusts deprecation warnings.
  7. Offline


    How about a "isBlocking" method? I always have to call EntityHuman's boolean method.
  8. Offline


    I don't know about you, but I know eclipse was bitching at me before I changed to the new event system.

    Actually look at this (note I am building against R4 here):
  9. Offline


    Read a bit more than just the last reply... he know this already and relied on it to be everything needed to be changed, but the Event(String) constructor will be removed without preceding deprecation.
  10. Offline


    Aye, I see this now. I was in a hurry cause I had to make dinner, thus didn't read properly and assumed this was what he was complaining about. My bad.
  11. Hello Bukkit Plugin Developers!

    I know you've all been watching the repository and twitter feed for changes, but in case you missed one or two, here's a (living) list of things you should verify to make sure your plugins are ready for 1.1-R5!

    High Priority
    • Old Configuration class removed
    • Old Event System removed
    • Events now have no constructors
    • Events are no longer serializable
      • Don't save Events.
    • loadPlugin(File,boolean) -> loadPlugin(File)
      • Just remove the parameter (it wasn't working as it appeared as of the loader fix anyway).
    • UnknownSoftDependencyException no longer exists
      • If a plugin relied on this they should use pluginLoader.getPluginDescription(File) and check the dependencies themselves.
    Medium Priority
    • Return types of the Recipe input accessorschanged. Review the following methods:
      • FurnaceRecipe.getInput()
      • ShapedRecipe.getIngredientMap()
      • ShapelessRecipe.getIngredientList()
    • The following methods in LivingEntity have been deprecated in favor of launchProjectile:
      • shootArrow() - use launchProjectile(Arrow.class)
      • throwSnowball() - use launchProjectile(Snowball.class)
      • throwEgg() - use launchProjectile(Egg.class)
    • MaterialData
      • If a plugin extended MaterialData or ItemStack, they should be using super.clone() to get the object, instead of explicitly using a constructor.
  12. Offline


    Thanks! Now my 1.1-R4 plugin wont break on 1.2-R1 :D
  13. Offline



    I was wondering what exactly changed. Hopefully this will make all of our servers run more efficiently :)
  14. Offline


    I realize that I "assumed" something (and you know how that normally goes) but I wanted to send a heads up for those of you working on WGens, Bukkit doesn't really support the "taller" game space quite yet. Changing your code to not use 128 and using getMaxHeight() instead will cause you nothing but oddities right now. :)
  15. Offline


    Yeah, I tried changing your height and it was one of the most surreal experiences I had ever had in Minecraft. :p
Thread Status:
Not open for further replies.

Share This Page