From 16adf5bd67874c0a1dd47d87c2ce44acf28fd1f4 Mon Sep 17 00:00:00 2001 From: Steven Lawson Date: Mon, 26 Sep 2011 22:29:05 -0400 Subject: [PATCH] Modified gtfo to not rely on essentials' snipe command. --- .../TotalFreedomMod/TotalFreedomMod.java | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java b/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java index e26fdb3..83d2c9a 100644 --- a/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java +++ b/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java @@ -480,16 +480,40 @@ public class TotalFreedomMod extends JavaPlugin p = matches.get(0); } - Bukkit.getServer().dispatchCommand(sender, "smite " + p.getName()); + tfBroadcastMessage(p.getName() + " has been a naughty, naughty boy.", ChatColor.RED); + //Deop p.setOp(false); - String user_ip = p.getAddress().getAddress().toString().replaceAll("/", "").trim(); + //Set gamemode to survival: + p.setGameMode(GameMode.SURVIVAL); + //Clear inventory: + p.getInventory().clear(); + + //Strike with lightning effect: + final Location target_pos = p.getLocation(); + for (int x = -1; x <= 1; x++) + { + for (int z = -1; z <= 1; z++) + { + final Location strike_pos = new Location(target_pos.getWorld(), target_pos.getBlockX() + x, target_pos.getBlockY(), target_pos.getBlockZ() + z); + target_pos.getWorld().strikeLightning(strike_pos); + } + } + + //Attempt to kill: + p.setHealth(0); + + //Ban IP Address: + String user_ip = p.getAddress().getAddress().toString().replaceAll("/", "").trim(); tfBroadcastMessage(String.format("Banning: %s, IP: %s.", p.getName(), user_ip), ChatColor.RED); Bukkit.banIP(user_ip); + + //Ban Username: Bukkit.getOfflinePlayer(p.getName()).setBanned(true); + //Kick Player: p.kickPlayer("GTFO"); } else