-

Discussion in 'Resources' started by zombiekiller753, Nov 16, 2013.

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

    zombiekiller753

    -
     
    Last edited: Jan 20, 2015
  2. In my opinion it does not make any sense to pull your plugin into obc/nms dependency (unless it already is depending on those).

    Deprecation reason is: @deprecated This method should not be relied upon as it is a temporary work-around for a larger, more complicated issue.

    So it does not look like the method is going to be removed any time soon, and your method does the same as the (Craft)Player method does, so i rather see downs than ups here. In fact you should rather rely on Player.updateInventory, because that is less likely to change.

    I suggest always checking the Bukkit code for deprecation reasons, and CraftBukkit for the implementation. If you are using a proper IDE you should be able to clone the repositories and directly search / look into the code in a very convenient way (unless you find GitHub more convenient).
     
  3. Offline

    zombiekiller753

    -
     
    Last edited: Jan 20, 2015
  4. Offline

    BungeeTheCookie

    zombiekiller753
    Why not just use @SupressWarnings("deprecation"). Who cares if there is a line right through one snippet of code (apparently you do xD). I would much rather have that than to make my plugin depend on OBC or NMS. Now, if you could put up some reflection there, I will take your method into consideration :D
     
    Phasesaber and asofold like this.
  5. Offline

    xTrollxDudex

    zombiekiller753
    Update inventory is not needed. Normal addItem and setItem should work fine.
     
  6. Don't use something worse to get rid of the yellow lining:) - use the answer suggested by BungeeTheCookie , that is how you most likely get a more reliable and much more simple solution, it should even be available vie "quick fix" features with Eclipse and similar IDEs.

    That only goes for using one of the both. But it is most agreeable to ask for the reason of using updateInventory in the first place...

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
  7. Offline

    Ultimate_n00b

    I wooonder where you got this from..
    https://github.com/Bukkit/CraftBukk...kkit/craftbukkit/entity/CraftPlayer.java#L437
     
  8. Offline

    zombiekiller753

    -
     
    Last edited: Jan 20, 2015
  9. Offline

    Ultimate_n00b

    Doing stuff like cancelling fire placing and other such things will require a update of the player's inventory.
     
  10. Offline

    Minnymin3

    The API exists for a reason. You should NOT do what you did! Just add the simple suppress warnings annotation. Seriously you shouldn't make your plugin version dependant for such a reason.
     
  11. Offline

    Garris0n

    Sometimes you make something that causes the inventory not to update properly and you have to use updateInventory().
     
  12. Offline

    DarkBladee12

    Garris0n xTrollxDudex for example when you cancel the PlayerDropItemEvent you'd have to update the players' inventory, because otherwise the item will be invisible!
     
  13. Offline

    turt2live

  14. Offline

    Ultimate_n00b

  15. Offline

    turt2live

    I generally only skim previous posts unless I feel like reading :p
     
Thread Status:
Not open for further replies.

Share This Page