Bypass kick/ban permission added

This commit is contained in:
Esophose 2019-05-26 21:25:13 -06:00
parent 55e2055907
commit f451ea8912
3 changed files with 17 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import me.goodandevil.skyblock.config.FileManager.Config;
import me.goodandevil.skyblock.island.Island;
import me.goodandevil.skyblock.island.IslandManager;
import me.goodandevil.skyblock.island.IslandRole;
import me.goodandevil.skyblock.island.IslandWorld;
import me.goodandevil.skyblock.message.MessageManager;
import me.goodandevil.skyblock.sound.SoundManager;
import me.goodandevil.skyblock.utils.player.OfflinePlayer;
@ -45,6 +46,9 @@ public class BanCommand extends SubCommand {
&& island.getSetting(IslandRole.Operator, "Ban").getStatus())) {
Player targetPlayer = Bukkit.getServer().getPlayer(args[0]);
if (targetPlayer != null && targetPlayer.hasPermission("fabledskyblock.bypass.ban"))
return;
UUID targetPlayerUUID = null;
String targetPlayerName = null;
@ -52,6 +56,9 @@ public class BanCommand extends SubCommand {
OfflinePlayer targetPlayerOffline = new OfflinePlayer(args[0]);
targetPlayerUUID = targetPlayerOffline.getUniqueId();
targetPlayerName = targetPlayerOffline.getName();
if (skyblock.getEconomyManager().hasPermission(skyblock.getWorldManager().getWorld(IslandWorld.Normal).getName(), Bukkit.getOfflinePlayer(targetPlayerUUID), "fabledskyblock.bypass.ban"))
return;
} else {
targetPlayerUUID = targetPlayer.getUniqueId();
targetPlayerName = targetPlayer.getName();

View File

@ -49,6 +49,9 @@ public class KickAllCommand extends SubCommand {
for (UUID islandVisitorList : islandVisitors) {
Player targetPlayer = Bukkit.getServer().getPlayer(islandVisitorList);
if (targetPlayer != null && targetPlayer.hasPermission("fabledskyblock.bypass.ban"))
continue;
IslandKickEvent islandKickEvent = new IslandKickEvent(island.getAPIWrapper(),
APIUtil.fromImplementation(IslandRole.Visitor),
Bukkit.getServer().getOfflinePlayer(islandVisitorList), player);

View File

@ -8,6 +8,7 @@ import me.goodandevil.skyblock.config.FileManager.Config;
import me.goodandevil.skyblock.island.Island;
import me.goodandevil.skyblock.island.IslandManager;
import me.goodandevil.skyblock.island.IslandRole;
import me.goodandevil.skyblock.island.IslandWorld;
import me.goodandevil.skyblock.message.MessageManager;
import me.goodandevil.skyblock.playerdata.PlayerData;
import me.goodandevil.skyblock.playerdata.PlayerDataManager;
@ -58,6 +59,9 @@ public class KickCommand extends SubCommand {
Player targetPlayer = Bukkit.getServer().getPlayer(args[0]);
if (targetPlayer != null && targetPlayer.hasPermission("fabledskyblock.bypass.ban"))
return;
Set<UUID> islandMembers = island.getRole(IslandRole.Member),
islandOperators = island.getRole(IslandRole.Operator),
islandVisitors = islandManager.getVisitorsAtIsland(island);
@ -66,6 +70,9 @@ public class KickCommand extends SubCommand {
OfflinePlayer targetPlayerOffline = new OfflinePlayer(args[0]);
targetPlayerUUID = targetPlayerOffline.getUniqueId();
targetPlayerName = targetPlayerOffline.getName();
if (skyblock.getEconomyManager().hasPermission(skyblock.getWorldManager().getWorld(IslandWorld.Normal).getName(), Bukkit.getOfflinePlayer(targetPlayerUUID), "fabledskyblock.bypass.ban"))
return;
} else {
targetPlayerUUID = targetPlayer.getUniqueId();
targetPlayerName = targetPlayer.getName();