Kick and ban bypass

This commit is contained in:
Fabrizio La Rosa 2020-06-17 04:29:20 +02:00
parent d0e1945183
commit 9610943e1b
3 changed files with 12 additions and 4 deletions

View File

@ -63,6 +63,9 @@ public class BanCommand extends SubCommand {
if (targetPlayerUUID == null) {
messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Found.Message"));
soundManager.playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1.0F, 1.0F);
} else if((targetPlayer.hasPermission("fabledskyblock.bypass.ban") || targetPlayer.isOp())){
messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Exempt"));
soundManager.playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1.0F, 1.0F);
} else if (targetPlayerUUID.equals(player.getUniqueId())) {
messageManager.sendMessage(player, configLoad.getString("Command.Island.Ban.Yourself.Message"));
soundManager.playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1.0F, 1.0F);

View File

@ -73,9 +73,8 @@ public class KickCommand extends SubCommand {
}
assert targetPlayer != null;
if(targetPlayer.hasPermission("fabledskyblock.bypass.kick") && islandVisitors.contains(targetPlayer.getUniqueId())){
// messageManager.sendMessage(player, languageConfig.getFileConfiguration().getString("Command.Island.Kick.Exempt")); // TODO
messageManager.sendMessage(player, "&cNon puoi cacciare questo utente!");
if((targetPlayer.hasPermission("fabledskyblock.bypass.kick") || targetPlayer.isOp()) && islandVisitors.contains(targetPlayer.getUniqueId())){
messageManager.sendMessage(player, languageConfig.getFileConfiguration().getString("Command.Island.Kick.Exempt"));
soundManager.playSound(player, CompatibleSound.BLOCK_ANVIL_LAND.getSound(), 1.0F, 1.0F);
} else if (targetPlayerUUID.equals(player.getUniqueId())) {
messageManager.sendMessage(player, languageConfig.getFileConfiguration().getString("Command.Island.Kick.Yourself.Message"));
@ -143,7 +142,9 @@ public class KickCommand extends SubCommand {
languageConfig.getFileConfiguration().getString("Command.Island.Kick.Kicked.Target.Message").replace("%player", player.getName()));
soundManager.playSound(targetPlayer, CompatibleSound.ENTITY_IRON_GOLEM_ATTACK.getSound(), 1.0F, 1.0F);
if (islandManager.isPlayerAtIsland(island, targetPlayer)) {
if (islandManager.isPlayerAtIsland(island, targetPlayer)
&& !targetPlayer.hasPermission("fabledskyblock.bypass.kick")
&& !targetPlayer.isOp()) {
LocationUtil.teleportPlayerToSpawn(targetPlayer);
}

View File

@ -433,6 +433,8 @@ Command:
Permission:
Message: '&bSkyBlock &8| &cError&8: &eYou do not have the right to delete your Island.'
Kick:
Bypass:
Message: '&bSkyBlock &8| &cError&8: &cYou can''t kick this user!'
Invalid:
Message: '&bSkyBlock &8| &cError&8: &eInvalid: /island kick <player>'
Role:
@ -766,6 +768,8 @@ Command:
Message: '&bSkyBlock &8| &aInfo&8: &eYou have banned the player &c%player &efrom the Island.'
Target:
Message: '&bSkyBlock &8| &aInfo&8: &eYou have been banned from the Island.'
Bypass:
Message: '&bSkyBlock &8| &cError&8: &cYou can''t ban this user!'
Already:
Message: '&bSkyBlock &8| &cError&8: &eThat player is already banned from the Island.'
Owner: