API updates since 1.4.2

Discussion in 'Plugin Development' started by jacklin213, Feb 8, 2013.

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

    jacklin213

    Hi all , some of you might know me but some or you won't. I have been on exam break since the end of last year and now im back. I need to update all my plugins so it would be great if you guys can point out any big changes since 1.4.2 or link me the changes :D.

    tl:dr : Been away for a while , need to know the changes since 1.4.2 API wise :D
     
  2. Offline

    Tirelessly

    If you used NMS/CraftBukkit code you have a mess on your hands. Otherwise you're fine.
     
    lDucks likes this.
  3. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    ItemMeta!
     
  4. Offline

    jacklin213

    ItemMeta? , i have a bad feeling about this =3= , link plz
     
  5. Offline

    ZeusAllMighty11 Retired Staff

    jacklin213
    Very simple
    Code:
    public ItemStack rename(ItemStack item, String newName, List<String>lore){
        item.getItemMeta().setDisplayName(newName);
        im.getItemMeta().setLore(lore);
        
        return item;
    }
    
    something like that, but don't copy+paste because it's not correct but it is close
     
  6. Offline

    chasechocolate

    There's also lots of different types of Meta, just search it up on Google (there's SkullMeta, FireworkMeta, etc.).
     
  7. Offline

    gomeow

    ItemMeta code was shown above, old code (to show how great ItemMeta is):

    Code:java
    1. public void renameItemStack(ItemStack is, String name) {
    2. CraftItemStack cis = (CraftItemStack) is;
    3. cis.getHandle().c(name);
    4. }

    This isn't too readable, and references CB code. Since the refactoring update, you would have needed to update your plugin every time a CB version came out

    Continuing on, I believe something was deprecated concerning ItemStack's constructor in favor of MaterialData, but I'm not so sure about all of that
     
  8. Offline

    Digi

    The easiest way to find absolutely all changes is to compare builds!

    Go to http://dl.bukkit.org -> "Alternate versions", select the Bukkit tab then go find your last build that you used, click on its build number to view it and on the right side you have: "Compare API: Select Artifact to compare with", click that and select the newest recommended build and wait until the site generates the changes list for you, it shouldn't take too long.
     
  9. Offline

    ZeusAllMighty11 Retired Staff

    Digi

    If you are like me and switch between an RB and the latest Dev build, it never loads for some reason
     
  10. Offline

    Digi

    ZeusAllMighty11
    I only compare RBs because they always give a summary of dev changes.
    Dev builds might add changes then undo them and they're alot more in number and it might take alot longer to process by the server... or it might just refuse to do it because there are so many builds.
     
  11. Offline

    jacklin213

    er thanks all lol , c some familier faces :D mbaxter (forgive me for tagging u) ,@ZeusAllMighty11 , Digi
    n hi all new faces . Happi chinese new year :DDD

    say everyone failed to mention this safe guard thing , how bad is it?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
  12. Offline

    Digi

  13. Offline

    mbaxter ʇıʞʞnq ɐ sɐɥ ı Retired Staff

    If only there were some sort of system for requesting code you write be pulled. Maybe I'll call it a Pull Request system ;)
     
    gomeow likes this.
  14. Offline

    Digi

    mbaxter
    I know that, however most are just sitting there, unpulled :p Alot has been added, sure, but alot is still missing :p That's why people use CB/NMS code.

    Hmm btw, where would be the place to ask if an addition idea would be likely to be pulled ? Because writing code that will be rejected very much pointless :}
     
  15. Offline

    gomeow

    You might try asking on IRC
     
  16. Offline

    jacklin213

    Ima do a few test on one plugin and c wat happens

    Thanks all
     
Thread Status:
Not open for further replies.

Share This Page