public boolean canFly(Player player) { if (carpets.getGiven(player)) { return true; } String s = "magiccarpet.mc"; if (vault != null && vault.isPermissionsEnabled()) { return vault.getPermissionProvider().has(player, s); } return player.hasPermission(s); }
public boolean canFlyAt(Player player, int i) { if (i == carpSize) { return true; } if (carpets.getGiven(player)) { return true; } String s = "magiccarpet.mc."; Permission permission = new Permission(s + i, "Allows the carpet to operate at size " + i, PermissionDefault.OP); permission.addParent("magiccarpet.*", true); if (vault != null && vault.isPermissionsEnabled()) { return vault.getPermissionProvider().has(player, s + i); } return player.hasPermission(permission); }