Listener optimizations (#1884)

* Drop CraftBukkit support, listeners cleanup

* Codestyle

* Codestyle

* Remove useless player.saveData() calls

* Micro optimization on the join process

* Requested changes

* Fix unit test

* Test onPlayerHeldItem listener

* Requested changes

* Remove unused import
This commit is contained in:
Gabriele C
2019-08-11 23:47:50 +02:00
committed by GitHub
parent e2f2ff0763
commit d30580d5d4
24 changed files with 498 additions and 557 deletions
@@ -89,8 +89,9 @@ public class AsynchronousJoin implements AsynchronousProcess {
}
if (service.getProperty(RestrictionSettings.FORCE_SURVIVAL_MODE)
&& player.getGameMode() != GameMode.SURVIVAL
&& !service.hasPermission(player, PlayerStatePermission.BYPASS_FORCE_SURVIVAL)) {
bukkitService.runTask(() -> player.setGameMode(GameMode.SURVIVAL));
bukkitService.scheduleSyncTaskFromOptionallyAsyncTask(() -> player.setGameMode(GameMode.SURVIVAL));
}
if (service.getProperty(HooksSettings.DISABLE_SOCIAL_SPY)) {