Blackixx / BossShop

Minecraft Bukkit Plugin | The most player friendly shop plugin
16 stars 16 forks source link

Deprecated getOnlinePlayers() method is causing scheduler exception #19

Closed tmad40blue closed 8 years ago

tmad40blue commented 8 years ago

Hi, looks like BossShop is using the getOnlinePlayers() method, which is deprecated as of Spigot 1.9 -

[16:52:54 WARN]: Exception in thread "Craft Scheduler Thread - 388" 
[16:52:54 WARN]: org.apache.commons.lang.UnhandledException: Plugin BossShop v2.2.1 generated an exception while executing task 212
        at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodError: org.bukkit.Server.getOnlinePlayers()[Lorg/bukkit/entity/Player;
        at org.black_ixx.bossshop.mcstats.Metrics.postPlugin(Metrics.java:357)
        at org.black_ixx.bossshop.mcstats.Metrics.access$400(Metrics.java:64)
        at org.black_ixx.bossshop.mcstats.Metrics$1.run(Metrics.java:245)
        at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftTask.run(CraftTask.java:71)
        at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
        ... 3 more
JayDeDoubleU commented 8 years ago

When was the last time you ran BuildTools?

Michael (md_5) has already said that you need to update the server at least twice a day due to the amount of bug fixes being completed.

tmad40blue commented 8 years ago

@RunsWithShovels

5 minutes ago. Same error.

MineTheCube commented 8 years ago

Its because BossShop use an old version of Metrics that use the old getOnlinePlayers() method, which have been removed from spigot 1.9. So BossShop must use at least R8 version of Metrics to works with 1.9..

confuser commented 8 years ago

I believe in the mean time, there's a patch provided by the spigot team for plugins that are affected by the removal of such deprecated methods, so it's not a complete blocker.

tmad40blue commented 8 years ago

@confuser

Confirmed, the SpecialSource quick-fix posted by md_5 in this thread works great for BossShop as a temporary solution. Running fine on my server so far, YMMV.

confuser commented 8 years ago

Great, thanks for confirming @tmad40blue I'll bump Metrics at the weekend and arrange a release with @Blackixx

confuser commented 8 years ago

https://ci.frostcast.net/job/BossShop/