mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
This is 2018
This commit is contained in:
parent
38e1769f0d
commit
0d0ad7d947
@ -18,7 +18,7 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH, blockHostConsole = true)
|
@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
|
public class Command_gtfo extends FreedomCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
|
|
||||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
@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
|
public class Command_purgeall extends FreedomCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
@ -119,7 +119,6 @@ blocked_commands:
|
|||||||
# Disabled commands
|
# Disabled commands
|
||||||
- 'n:b:/time:Server-side time changing is disabled. Please use /ptime to set your own personal time.'
|
- '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:/gamemode:Use /creative and /survival to set your gamemode.'
|
||||||
- 'n:b:/ban:_'
|
|
||||||
- 'n:b:/pardon:_'
|
- 'n:b:/pardon:_'
|
||||||
- 'n:b:/ban-ip:_'
|
- 'n:b:/ban-ip:_'
|
||||||
- 'n:b:/pardon-ip:_'
|
- 'n:b:/pardon-ip:_'
|
||||||
@ -237,7 +236,7 @@ flatlands:
|
|||||||
# Admin-Only Mode
|
# Admin-Only Mode
|
||||||
admin_only_mode: false
|
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:
|
protectarea:
|
||||||
enabled: true
|
enabled: true
|
||||||
auto_protect_spawnpoints: true
|
auto_protect_spawnpoints: true
|
||||||
|
Loading…
Reference in New Issue
Block a user