This is 2018

This commit is contained in:
ZeroEpoch1969 2018-07-25 15:06:19 -07:00
parent 38e1769f0d
commit 0d0ad7d947
No known key found for this signature in database
GPG Key ID: A7BAB4E14F089CF3
4 changed files with 61 additions and 4 deletions

View File

@ -18,7 +18,7 @@ import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH, blockHostConsole = true)
@CommandParameters(description = "Bans a player", usage = "/<command> <username> [reason] [-nrb]")
@CommandParameters(description = "Bans a player", usage = "/<command> <username> [reason] [-nrb]", aliases = "ban")
public class Command_gtfo extends FreedomCommand
{

View File

@ -9,7 +9,7 @@ import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
@CommandParameters(description = "Superadmin command - Purge everything! (except for bans).", usage = "/<command>")
@CommandParameters(description = "Purge everything! (except for bans).", usage = "/<command>")
public class Command_purgeall extends FreedomCommand
{

View File

@ -0,0 +1,58 @@
package me.totalfreedom.totalfreedommod.command;
import java.util.ArrayList;
import java.util.List;
import me.totalfreedom.totalfreedommod.banning.Ban;
import me.totalfreedom.totalfreedommod.player.PlayerData;
import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FUtil;
import org.apache.commons.lang3.StringUtils;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
@CommandParameters(description = "Unbans a player", usage = "/<command> <username>")
public class Command_unban extends FreedomCommand
{
@Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
if (args.length == 1)
{
String username;
final List<String> ips = new ArrayList<>();
final PlayerData entry = plugin.pl.getData(args[0]);
if (entry == null)
{
msg("Can't find that user.");
return true;
}
username = entry.getUsername();
ips.addAll(entry.getIps());
FUtil.adminAction(sender.getName(), "Unbanning " + username + " and IPs: " + StringUtils.join(ips, ", "), true);
plugin.bm.removeBan(plugin.bm.getByUsername(username));
for (String ip : ips)
{
Ban ban = plugin.bm.getByIp(ip);
if (ban != null)
{
plugin.bm.removeBan(ban);
}
ban = plugin.bm.getByIp(FUtil.getFuzzyIp(ip));
if (ban != null)
{
plugin.bm.removeBan(ban);
}
}
return true;
}
return false;
}
}

View File

@ -119,7 +119,6 @@ blocked_commands:
# Disabled commands
- 'n:b:/time:Server-side time changing is disabled. Please use /ptime to set your own personal time.'
- 'n:b:/gamemode:Use /creative and /survival to set your gamemode.'
- 'n:b:/ban:_'
- 'n:b:/pardon:_'
- 'n:b:/ban-ip:_'
- 'n:b:/pardon-ip:_'
@ -237,7 +236,7 @@ flatlands:
# Admin-Only Mode
admin_only_mode: false
# Protected Areas - Protect areas so that only superadmins can directly modify blocks in those areas. WorldEdit and other such plugins might bypass this.
# Protected Areas - Protect areas so that only admins can directly modify blocks in those areas. WorldEdit and other such plugins might bypass this.
protectarea:
enabled: true
auto_protect_spawnpoints: true