mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-06 22:13:05 +00:00
Patches
1. Remove marco from dev 2. Add namehistory 3. Fix grammar issues 4. Actually use CoreProtect bridge to rollback players 5. Improve automatic wiper
This commit is contained in:
@ -6,6 +6,7 @@ import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.pravian.aero.util.Ips;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import static org.bukkit.Bukkit.getServer;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
@ -21,7 +22,6 @@ public class Command_gtfo extends FreedomCommand
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
|
||||
if (args.length == 0)
|
||||
{
|
||||
return false;
|
||||
@ -43,17 +43,26 @@ public class Command_gtfo extends FreedomCommand
|
||||
|
||||
FUtil.bcastMsg(player.getName() + " has been a VERY naughty, naughty boy.", ChatColor.RED);
|
||||
|
||||
// Undo WorldEdits
|
||||
try
|
||||
//checks if there is CoreProtect loaded and installed , if not it skips the rollback and uses coreprotect directly
|
||||
if (!getServer().getPluginManager().isPluginEnabled("CoreProtect"))
|
||||
{
|
||||
plugin.web.undo(player, 15);
|
||||
}
|
||||
catch (NoClassDefFoundError ex)
|
||||
{
|
||||
}
|
||||
// Undo WorldEdits
|
||||
try
|
||||
{
|
||||
plugin.web.undo(player, 15);
|
||||
}
|
||||
catch (NoClassDefFoundError ex)
|
||||
{
|
||||
}
|
||||
|
||||
// Rollback
|
||||
plugin.rb.rollback(player.getName());
|
||||
// Rollback
|
||||
plugin.rb.rollback(player.getName());
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
plugin.cpb.rollback(player.getName());
|
||||
}
|
||||
|
||||
// Deop
|
||||
player.setOp(false);
|
||||
@ -71,7 +80,7 @@ public class Command_gtfo extends FreedomCommand
|
||||
for (int z = -1; z <= 1; z++)
|
||||
{
|
||||
final Location strike_pos = new Location(targetPos.getWorld(), targetPos.getBlockX() + x, targetPos.getBlockY(), targetPos.getBlockZ() + z);
|
||||
targetPos.getWorld().strikeLightning(strike_pos);
|
||||
targetPos.getWorld().strikeLightningEffect(strike_pos);
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,16 +95,19 @@ public class Command_gtfo extends FreedomCommand
|
||||
.append(ip);
|
||||
if (reason != null)
|
||||
{
|
||||
bcast.append(" - Reason: ").append(ChatColor.YELLOW).append(reason);
|
||||
bcast.append(" - Reason: ").append(ChatColor.YELLOW).append(FUtil.colorize(reason));
|
||||
}
|
||||
FUtil.bcastMsg(bcast.toString());
|
||||
|
||||
// Ban player
|
||||
plugin.bm.addBan(Ban.forPlayerFuzzy(player, sender, null, reason));
|
||||
|
||||
// Kill player
|
||||
player.setHealth(0.0);
|
||||
|
||||
// Kick player
|
||||
player.kickPlayer(ChatColor.RED + "GTFO");
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user