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
@@ -4,7 +4,6 @@ import com.google.common.annotations.VisibleForTesting;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.initialization.Reloadable;
import fr.xephi.authme.output.ConsoleLoggerFactory;
import fr.xephi.authme.listener.JoiningPlayer;
import fr.xephi.authme.permission.handlers.LuckPermsHandler;
import fr.xephi.authme.permission.handlers.PermissionHandler;
import fr.xephi.authme.permission.handlers.PermissionHandlerException;
@@ -227,18 +226,6 @@ public class PermissionsManager implements Reloadable {
return player.hasPermission(permissionNode.getNode());
}
/**
* Check if the given player has permission for the given permission node.
*
* @param joiningPlayer The player to check
* @param permissionNode The permission node to verify
*
* @return true if the player has permission, false otherwise
*/
public boolean hasPermission(JoiningPlayer joiningPlayer, PermissionNode permissionNode) {
return joiningPlayer.getPermissionLookupFunction().apply(this, permissionNode);
}
/**
* Check if a player has permission for the given permission node. This is for offline player checks.
* If no permissions system is used, then the player will not have permission.