mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-26 17:05:01 +00:00
Cool stuff (#101)
* add twitter link * Add /pardon as an alias * Add /unban -redo
This commit is contained in:
parent
519b456807
commit
45a10a871f
@ -10,6 +10,7 @@
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: net.coreprotect:coreprotect:2.15.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.projectlombok:lombok:1.18.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot:1.13-R0.1-SNAPSHOT" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.Pravian:Aero:5f82926" level="project" />
|
||||
|
@ -119,7 +119,7 @@ public class CoreProtectBridge extends FreedomService
|
||||
}
|
||||
|
||||
// Reverts a rollback for the specifed player's edits that were in the last 24 hours.
|
||||
public void undoRollback(final String name)
|
||||
public void restore(final String name)
|
||||
{
|
||||
final CoreProtectAPI coreProtect = getCoreProtectAPI();
|
||||
|
||||
|
@ -13,18 +13,19 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Unbans a player", usage = "/<command> <username>")
|
||||
@CommandParameters(description = "Unbans a player", usage = "/<command> <username> [-restore]", aliases = "pardon")
|
||||
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)
|
||||
if (args.length > 0)
|
||||
{
|
||||
String username;
|
||||
final List<String> ips = new ArrayList<>();
|
||||
final PlayerData entry = plugin.pl.getData(args[0]);
|
||||
final Player player = getPlayer(args[0]);
|
||||
|
||||
if (entry == null)
|
||||
{
|
||||
@ -38,6 +39,31 @@ public class Command_unban extends FreedomCommand
|
||||
FUtil.adminAction(sender.getName(), "Unbanning " + username + " and IPs: " + StringUtils.join(ips, ", "), true);
|
||||
plugin.bm.removeBan(plugin.bm.getByUsername(username));
|
||||
|
||||
if (args.length >= 2)
|
||||
{
|
||||
if (args[args.length - 1].equals("-restore"))
|
||||
{
|
||||
if (!plugin.cpb.isEnabled())
|
||||
{
|
||||
// Redo WorldEdits
|
||||
try
|
||||
{
|
||||
plugin.web.redo(player, 15);
|
||||
}
|
||||
catch (NoClassDefFoundError | NullPointerException ex)
|
||||
{
|
||||
}
|
||||
// Rollback
|
||||
plugin.rb.undoRollback(username);
|
||||
}
|
||||
else
|
||||
{
|
||||
plugin.cpb.restore(username);
|
||||
}
|
||||
msg("Restored edits for: " + username);
|
||||
}
|
||||
}
|
||||
|
||||
for (String ip : ips)
|
||||
{
|
||||
Ban ban = plugin.bm.getByIp(ip);
|
||||
|
@ -66,6 +66,7 @@ social_links:
|
||||
Forum: 'https://totalfreedom.boards.net/'
|
||||
Website: 'https://totalfreedom.me/'
|
||||
Discord: 'https://discordapp.com/invite/XXjmAmV/'
|
||||
Twitter: 'https://twitter.com/TotalFreedomMC'
|
||||
|
||||
|
||||
# Blocking certain events
|
||||
@ -119,7 +120,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:/pardon:_'
|
||||
- 'n:b:/ban-ip:_'
|
||||
- 'n:b:/pardon-ip:_'
|
||||
- 'n:b:/toggledownfall:_'
|
||||
|
Loading…
Reference in New Issue
Block a user