How do you update a plugin?

Discussion in 'Plugin Development' started by Dubzay, Jun 26, 2015.

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

    Dubzay

    I have a plugin but I was wondering how in the world do you update it?
     
  2. Offline

    justin_393

    depends, what's broken?
     
  3. Offline

    Epicballzy

    You use an updated bukkit jar in place of the old one. If some of the code seems to have errors or if things are out of date, update you code.
     
  4. Offline

    xXCapzXx

    Send me the code of the plugin.
    Or if it isn't your's, send me the plugin.
     
  5. Offline

    meguy26

  6. Offline

    justin_393

  7. Offline

    xXCapzXx

    I think it is broken and maybe some code isn't compatible anymore.
    And it needs to be updated to 1.8. Maybe that is the case.
     
  8. Offline

    meguy26

    @Dubzay @xXCapzXx
    Would be nice if we had the OP's input, but yes that makes sense.
     
  9. Offline

    teej107

    Of coarse
    This question is just as important. Some plugins don't even need to be updated. I wrote many plugins on the 1.7 API and had no worries of it breaking on 1.8.
     
  10. Offline

    FisheyLP

    What about Bukkit.getOnlinePlayers() returning a Collection<? extends Player> instead of Player[] in 1.8 ??
     
  11. Offline

    Dubzay

    It was a couple of errors but this really helped, thanks :D
     
  12. Offline

    teej107

    I don't worry about that because I only use those in for-each loops which can handle both.
     
  13. Offline

    FisheyLP

    No. When you compile your code it knows the method name it accesses and its return type
     
  14. Offline

    justin_393

    Works perfectly fine for me. All I do is access it in a for loop. Never had any issues.
     
  15. Offline

    nverdier

    Yes, but the new return type still works in a fit loop, as long as that's the only time you're using it.

    Well actually, what do you mean by it knows the return type? Are you saying that somewhere it's stored what the method returns other than in the API code?
     
  16. Offline

    FisheyLP

    Exactly. I tried my 1.7.2 plugin where I accessed Bukkit.getOnlinePlayers() and got a MethodNotFoundException or something like that on a 1.8 Server. https://www.spigotmc.org/threads/get-online-players-count-in-both-1-5-2-and-1-8.54819/ It is possible to avoid that using reflections :|

    EDIT: Nested looping over it is ok but .length vs .size() or setting it to a variable can be a huge problem
     
    Last edited: Jul 1, 2015
  17. Offline

    Konato_K

    @FisheyLP Was the Player[] method removed? I recall using a player array in v1_7_R4 (The one that had both methods, but one was deprecated) and everything worked fine.
     
  18. Offline

    FisheyLP

    in 1.8 the method return type changed to Collection<? extends Player>
     
  19. Offline

    Konato_K

    @FisheyLP That happened since 1.7.10 (v1_7_R4), but since both methods were kept (the one with Collection and the one with Player[]) compatibility was not a problem.
     
  20. Offline

    FisheyLP

    craftbukkit 1.8:

    [​IMG]
     
  21. Offline

    crolemol

    @FisheyLP
    in bukkit both methods were kept :p
     
Thread Status:
Not open for further replies.

Share This Page