mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-11 13:33:54 +00:00
Fixing marco's mistakes (#8)
This commit is contained in:
@ -1,14 +1,10 @@
|
||||
|
||||
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import java.util.Iterator;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -18,91 +14,120 @@ import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
@CommandParameters(description = "Blocks all block placing for player with brute force.", usage = "/<command> [[-s] <player> [reason] | list | purge | all]", aliases = "editmute")
|
||||
public class Command_blockedit extends FreedomCommand
|
||||
{
|
||||
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, String[] args, final boolean senderIsConsole) {
|
||||
if (args.length == 0) {
|
||||
|
||||
@Override
|
||||
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, String[] args, final boolean senderIsConsole)
|
||||
{
|
||||
if (args.length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (args[0].equals("list")) {
|
||||
this.msg("Block edits blocked for players:");
|
||||
|
||||
if (args[0].equals("list"))
|
||||
{
|
||||
msg("Block edits blocked for players:");
|
||||
int count = 0;
|
||||
for (final Player mp : this.server.getOnlinePlayers()) {
|
||||
final FPlayer info = ((TotalFreedomMod)this.plugin).pl.getPlayer(mp);
|
||||
if (info.isEditBlock()) {
|
||||
this.msg("- " + mp.getName());
|
||||
for (Player mp : server.getOnlinePlayers())
|
||||
{
|
||||
final FPlayer info = plugin.pl.getPlayer(mp);
|
||||
if (info.isEditBlocked())
|
||||
{
|
||||
msg("- " + mp.getName());
|
||||
++count;
|
||||
}
|
||||
}
|
||||
if (count == 0) {
|
||||
this.msg("- none");
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
msg("- none");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (args[0].equals("purge")) {
|
||||
|
||||
if (args[0].equals("purge"))
|
||||
{
|
||||
FUtil.adminAction(sender.getName(), "Unblocking block edits for all players.", true);
|
||||
int count = 0;
|
||||
for (final Player mp : this.server.getOnlinePlayers()) {
|
||||
final FPlayer info = ((TotalFreedomMod)this.plugin).pl.getPlayer(mp);
|
||||
if (info.isEditBlock()) {
|
||||
for (final Player mp : this.server.getOnlinePlayers())
|
||||
{
|
||||
final FPlayer info = plugin.pl.getPlayer(mp);
|
||||
if (info.isEditBlocked())
|
||||
{
|
||||
info.setEditBlocked(false);
|
||||
++count;
|
||||
}
|
||||
}
|
||||
this.msg("Unblocked all block edit for " + count + " players.");
|
||||
msg("Unblocked all block edit for " + count + " players.");
|
||||
return true;
|
||||
}
|
||||
if (args[0].equals("all")) {
|
||||
|
||||
if (args[0].equals("all"))
|
||||
{
|
||||
FUtil.adminAction(sender.getName(), "Blocking block edits for all non-admins.", true);
|
||||
int counter = 0;
|
||||
for (final Player player : this.server.getOnlinePlayers()) {
|
||||
if (!((TotalFreedomMod)this.plugin).al.isAdmin((CommandSender)player)) {
|
||||
final FPlayer playerdata = ((TotalFreedomMod)this.plugin).pl.getPlayer(player);
|
||||
for (final Player player : this.server.getOnlinePlayers())
|
||||
{
|
||||
if (!plugin.al.isAdmin((CommandSender) player))
|
||||
{
|
||||
final FPlayer playerdata = plugin.pl.getPlayer(player);
|
||||
playerdata.setEditBlocked(true);
|
||||
++counter;
|
||||
}
|
||||
}
|
||||
this.msg("Blocked block edits for " + counter + " players.");
|
||||
|
||||
msg("Blocked block edits for " + counter + " players.");
|
||||
return true;
|
||||
}
|
||||
|
||||
final boolean smite = args[0].equals("-s");
|
||||
if (smite) {
|
||||
args = (String[])ArrayUtils.subarray((Object[])args, 1, args.length);
|
||||
if (args.length < 1) {
|
||||
if (smite)
|
||||
{
|
||||
args = (String[]) ArrayUtils.subarray((Object[]) args, 1, args.length);
|
||||
if (args.length < 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
final Player player2 = this.getPlayer(args[0]);
|
||||
if (player2 == null) {
|
||||
|
||||
final Player player2 = getPlayer(args[0]);
|
||||
if (player2 == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
String reason = null;
|
||||
if (args.length > 1) {
|
||||
reason = StringUtils.join((Object[])args, " ", 1, args.length);
|
||||
if (args.length > 1)
|
||||
{
|
||||
reason = StringUtils.join((Object[]) args, " ", 1, args.length);
|
||||
}
|
||||
final FPlayer playerdata2 = ((TotalFreedomMod)this.plugin).pl.getPlayer(player2);
|
||||
if (playerdata2.isEditBlock()) {
|
||||
|
||||
final FPlayer playerdata2 = plugin.pl.getPlayer(player2);
|
||||
if (playerdata2.isEditBlocked())
|
||||
{
|
||||
FUtil.adminAction(sender.getName(), "Unblocking block edits for " + player2.getName(), true);
|
||||
playerdata2.setEditBlocked(false);
|
||||
this.msg("Unblocking block edits for " + player2.getName());
|
||||
this.msg((CommandSender)player2, "Your block edits have been unblocked.", ChatColor.RED);
|
||||
msg("Unblocking block edits for " + player2.getName());
|
||||
msg(player2, "Your block edits have been unblocked.", ChatColor.RED);
|
||||
}
|
||||
else {
|
||||
if (((TotalFreedomMod)this.plugin).al.isAdmin((CommandSender)player2)) {
|
||||
this.msg(player2.getName() + " is an admin, and cannot have their block edits blocked.");
|
||||
else
|
||||
{
|
||||
if (plugin.al.isAdmin((CommandSender) player2))
|
||||
{
|
||||
msg(player2.getName() + " is an admin, and cannot have their block edits blocked.");
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.adminAction(sender.getName(), "Blocking block edits for " + player2.getName(), true);
|
||||
playerdata2.setEditBlocked(true);
|
||||
if (smite) {
|
||||
Command_smite.smite(player2, sender);
|
||||
|
||||
if (smite)
|
||||
{
|
||||
Command_smite.smite(sender, player2, reason);
|
||||
}
|
||||
if (reason != null) {
|
||||
this.msg((CommandSender)player2, "Your block edits have been blocked. Reason: " + reason, ChatColor.RED);
|
||||
}
|
||||
else {
|
||||
this.msg((CommandSender)player2, "Your block edits have been blocked.", ChatColor.RED);
|
||||
}
|
||||
this.msg("Blocked all block edits for " + player2.getName());
|
||||
|
||||
msg(player2, "Your block edits have been blocked.", ChatColor.RED);
|
||||
msg("Blocked all block edits for " + player2.getName());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -1,14 +1,10 @@
|
||||
|
||||
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import java.util.Iterator;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -18,91 +14,120 @@ import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
@CommandParameters(description = "Toggle PVP mode for players.", usage = "/<command> [[-s] <player> [reason] | list | purge | all]", aliases = "pvpblock,pvpmode,pvpman,pvman")
|
||||
public class Command_blockpvp extends FreedomCommand
|
||||
{
|
||||
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, String[] args, final boolean senderIsConsole) {
|
||||
if (args.length == 0) {
|
||||
|
||||
@Override
|
||||
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, String[] args, final boolean senderIsConsole)
|
||||
{
|
||||
if (args.length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (args[0].equals("list")) {
|
||||
|
||||
if (args[0].equals("list"))
|
||||
{
|
||||
this.msg("PVP is blocked for players:");
|
||||
int count = 0;
|
||||
for (final Player mp : this.server.getOnlinePlayers()) {
|
||||
final FPlayer info = ((TotalFreedomMod)this.plugin).pl.getPlayer(mp);
|
||||
if (info.isPVPBlock()) {
|
||||
this.msg("- " + mp.getName());
|
||||
for (Player mp : server.getOnlinePlayers())
|
||||
{
|
||||
final FPlayer info = plugin.pl.getPlayer(mp);
|
||||
if (info.isPvpBlocked())
|
||||
{
|
||||
msg(" - " + mp.getName());
|
||||
++count;
|
||||
}
|
||||
}
|
||||
if (count == 0) {
|
||||
this.msg("- none");
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
this.msg(" - none");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (args[0].equals("purge")) {
|
||||
|
||||
if (args[0].equals("purge"))
|
||||
{
|
||||
FUtil.adminAction(sender.getName(), "Enabling PVP for all players.", true);
|
||||
int count = 0;
|
||||
for (final Player mp : this.server.getOnlinePlayers()) {
|
||||
final FPlayer info = ((TotalFreedomMod)this.plugin).pl.getPlayer(mp);
|
||||
if (info.isPVPBlock()) {
|
||||
info.setPVPBlock(false);
|
||||
for (Player mp : this.server.getOnlinePlayers())
|
||||
{
|
||||
final FPlayer info = plugin.pl.getPlayer(mp);
|
||||
if (info.isPvpBlocked())
|
||||
{
|
||||
info.setPvpBlocked(false);
|
||||
++count;
|
||||
}
|
||||
}
|
||||
this.msg("Enabled PVP for " + count + " players.");
|
||||
|
||||
msg("Enabled PVP for " + count + " players.");
|
||||
return true;
|
||||
}
|
||||
if (args[0].equals("all")) {
|
||||
|
||||
if (args[0].equals("all"))
|
||||
{
|
||||
FUtil.adminAction(sender.getName(), "Disabling PVP for all non-admins", true);
|
||||
int counter = 0;
|
||||
for (final Player player : this.server.getOnlinePlayers()) {
|
||||
if (!((TotalFreedomMod)this.plugin).al.isAdmin((CommandSender)player)) {
|
||||
final FPlayer playerdata = ((TotalFreedomMod)this.plugin).pl.getPlayer(player);
|
||||
playerdata.setPVPBlock(true);
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (!plugin.al.isAdmin((CommandSender) player))
|
||||
{
|
||||
final FPlayer playerdata = plugin.pl.getPlayer(player);
|
||||
playerdata.setPvpBlocked(true);
|
||||
++counter;
|
||||
}
|
||||
}
|
||||
this.msg("Disabling PVP for " + counter + " players.");
|
||||
|
||||
msg("Disabling PVP for " + counter + " players.");
|
||||
return true;
|
||||
}
|
||||
|
||||
final boolean smite = args[0].equals("-s");
|
||||
if (smite) {
|
||||
args = (String[])ArrayUtils.subarray((Object[])args, 1, args.length);
|
||||
if (args.length < 1) {
|
||||
if (smite)
|
||||
{
|
||||
args = (String[]) ArrayUtils.subarray(args, 1, args.length);
|
||||
if (args.length < 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
final Player player2 = this.getPlayer(args[0]);
|
||||
if (player2 == null) {
|
||||
|
||||
final Player player2 = getPlayer(args[0]);
|
||||
if (player2 == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
String reason = null;
|
||||
if (args.length > 1) {
|
||||
reason = StringUtils.join((Object[])args, " ", 1, args.length);
|
||||
if (args.length > 1)
|
||||
{
|
||||
reason = StringUtils.join(args, " ", 1, args.length);
|
||||
}
|
||||
final FPlayer playerdata2 = ((TotalFreedomMod)this.plugin).pl.getPlayer(player2);
|
||||
if (playerdata2.isPVPBlock()) {
|
||||
|
||||
final FPlayer playerdata2 = plugin.pl.getPlayer(player2);
|
||||
if (playerdata2.isPvpBlocked())
|
||||
{
|
||||
FUtil.adminAction(sender.getName(), "Enabling PVP for " + player2.getName(), true);
|
||||
playerdata2.setPVPBlock(false);
|
||||
this.msg("Enabling PVP for " + player2.getName());
|
||||
this.msg((CommandSender)player2, "Your PVP have been enabled.", ChatColor.GREEN);
|
||||
playerdata2.setPvpBlocked(false);
|
||||
msg("Enabling PVP for " + player2.getName());
|
||||
msg((CommandSender) player2, "Your PVP have been enabled.", ChatColor.GREEN);
|
||||
}
|
||||
else {
|
||||
if (((TotalFreedomMod)this.plugin).al.isAdmin((CommandSender)player2)) {
|
||||
else
|
||||
{
|
||||
if (plugin.al.isAdmin((CommandSender) player2))
|
||||
{
|
||||
this.msg(player2.getName() + " is an admin, and his PVP cannot be disabled.");
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.adminAction(sender.getName(), "Disabling PVP for " + player2.getName(), true);
|
||||
playerdata2.setPVPBlock(true);
|
||||
if (smite) {
|
||||
Command_smite.smite(player2, sender);
|
||||
playerdata2.setPvpBlocked(true);
|
||||
if (smite)
|
||||
{
|
||||
Command_smite.smite(sender, player2, reason);
|
||||
}
|
||||
if (reason != null) {
|
||||
this.msg((CommandSender)player2, "Your PVP has been disabled. Reason: " + reason, ChatColor.RED);
|
||||
}
|
||||
else {
|
||||
this.msg((CommandSender)player2, "Your PVP has been disabled.", ChatColor.RED);
|
||||
}
|
||||
this.msg("Disabled PVP for " + player2.getName());
|
||||
|
||||
msg(player2, "Your PVP has been disabled.", ChatColor.RED);
|
||||
msg("Disabled PVP for " + player2.getName());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -1,10 +1,6 @@
|
||||
|
||||
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.Iterator;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.Achievement;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.Material;
|
||||
@ -12,37 +8,39 @@ import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import java.util.Random;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "For the people that are still alive.", usage = "/<command>")
|
||||
public class Command_cake extends FreedomCommand
|
||||
{
|
||||
|
||||
public static final String CAKE_LYRICS = "But there's no sense crying over every mistake. You just keep on trying till you run out of cake.";
|
||||
private final Random random;
|
||||
|
||||
public Command_cake() {
|
||||
this.random = new Random();
|
||||
}
|
||||
|
||||
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, final String[] args, final boolean senderIsConsole) {
|
||||
|
||||
@Override
|
||||
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, final String[] args, final boolean senderIsConsole)
|
||||
{
|
||||
final StringBuilder output = new StringBuilder();
|
||||
final String[] split;
|
||||
final String[] words = split = "But there's no sense crying over every mistake. You just keep on trying till you run out of cake.".split(" ");
|
||||
for (final String word : split) {
|
||||
output.append(FUtil.rainbowChatColor()).append(word).append(" ");
|
||||
|
||||
for (final String word : CAKE_LYRICS.split(" "))
|
||||
{
|
||||
output.append(FUtil.randomChatColor()).append(word).append(" ");
|
||||
}
|
||||
|
||||
final ItemStack heldItem = new ItemStack(Material.CAKE);
|
||||
final ItemMeta heldItemMeta = heldItem.getItemMeta();
|
||||
heldItemMeta.setDisplayName(ChatColor.WHITE + "The " + ChatColor.DARK_GRAY + "Lie");
|
||||
heldItem.setItemMeta(heldItemMeta);
|
||||
for (final Player player : this.server.getOnlinePlayers()) {
|
||||
|
||||
for (final Player player : this.server.getOnlinePlayers())
|
||||
{
|
||||
final int firstEmpty = player.getInventory().firstEmpty();
|
||||
if (firstEmpty >= 0) {
|
||||
if (firstEmpty >= 0)
|
||||
{
|
||||
player.getInventory().setItem(firstEmpty, heldItem);
|
||||
}
|
||||
}
|
||||
|
||||
FUtil.bcastMsg(output.toString());
|
||||
return true;
|
||||
}
|
||||
|
@ -16,9 +16,8 @@ public class Command_chestspy extends FreedomCommand
|
||||
{
|
||||
|
||||
FPlayer playerdata = plugin.pl.getPlayer(playerSender);
|
||||
playerdata.setChestMonitor(!playerdata.ChestMonitorEnabled());
|
||||
msg("ChestSpy " + (playerdata.ChestMonitorEnabled()? "enabled." : "disabled."));
|
||||
|
||||
playerdata.setChestMonitorEnabled(!playerdata.isChestMonitorEnabled());
|
||||
msg("ChestSpy " + (playerdata.isChestMonitorEnabled() ? "enabled." : "disabled."));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -16,9 +16,8 @@ public class Command_dropspy extends FreedomCommand
|
||||
{
|
||||
|
||||
FPlayer playerdata = plugin.pl.getPlayer(playerSender);
|
||||
playerdata.setDropMonitor(!playerdata.DropMonitorEnabled());
|
||||
msg("DropSpy " + (playerdata.DropMonitorEnabled() ? "enabled." : "disabled."));
|
||||
|
||||
playerdata.setDropMonitorEnabled(!playerdata.isDropMonitorEnabled());
|
||||
msg("DropSpy " + (playerdata.isDropMonitorEnabled() ? "enabled." : "disabled."));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ public class Command_gadmin extends FreedomCommand
|
||||
}
|
||||
case SMITE:
|
||||
{
|
||||
Command_smite.smite(target, sender);
|
||||
Command_smite.smite(sender, target);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -40,12 +40,11 @@ public class Command_invsee extends FreedomCommand
|
||||
{
|
||||
msg("You can't spy on admins!");
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
playerSender.closeInventory();
|
||||
FPlayer fPlayer = plugin.pl.getPlayer(playerSender);
|
||||
fPlayer.setInvsee(true);
|
||||
fPlayer.setInvSee(true);
|
||||
Inventory playerInv = player.getInventory();
|
||||
playerSender.openInventory(playerInv);
|
||||
return true;
|
||||
|
@ -1,7 +1,9 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -15,15 +17,9 @@ import org.bukkit.entity.Player;
|
||||
public class Command_nickclean extends FreedomCommand
|
||||
{
|
||||
|
||||
private static final ChatColor[] BLOCKED = new ChatColor[]
|
||||
{
|
||||
ChatColor.MAGIC,
|
||||
ChatColor.STRIKETHROUGH,
|
||||
ChatColor.ITALIC,
|
||||
ChatColor.UNDERLINE,
|
||||
ChatColor.BLACK
|
||||
};
|
||||
private static final Pattern REGEX = Pattern.compile(ChatColor.COLOR_CHAR + "[" + StringUtils.join(BLOCKED, "") + "]", Pattern.CASE_INSENSITIVE);
|
||||
private static final String[] BLOCK = ConfigEntry.BLOCKED_CHATCODES.getString().split(",");
|
||||
|
||||
private static final Pattern REGEX = Pattern.compile(FUtil.colorize(ChatColor.COLOR_CHAR + "[" + StringUtils.join(BLOCK, "") + "]"), Pattern.CASE_INSENSITIVE);
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
|
@ -16,9 +16,8 @@ public class Command_potionspy extends FreedomCommand
|
||||
{
|
||||
|
||||
FPlayer playerdata = plugin.pl.getPlayer(playerSender);
|
||||
playerdata.setPotionMonitor(!playerdata.PotionMonitorEnabled());
|
||||
msg("PotionSpy " + (playerdata.PotionMonitorEnabled() ? "enabled." : "disabled."));
|
||||
|
||||
playerdata.setPotionMonitorEnabled(!playerdata.isPotionMonitorEnabled());
|
||||
msg("PotionSpy " + (playerdata.isPotionMonitorEnabled() ? "enabled." : "disabled."));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -38,23 +38,24 @@ public class Command_smite extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
smite(player, reason);
|
||||
smite(sender, player, reason);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void smite(Player player)
|
||||
public static void smite(CommandSender sender, Player player)
|
||||
{
|
||||
smite(player, null);
|
||||
smite(sender, player, null);
|
||||
}
|
||||
|
||||
public static void smite(Player player, String reason)
|
||||
public static void smite(CommandSender sender, Player player, String reason)
|
||||
{
|
||||
FUtil.bcastMsg(player.getName() + " has been a naughty, naughty boy.", ChatColor.RED);
|
||||
|
||||
if (reason != null)
|
||||
{
|
||||
FUtil.bcastMsg(" Reason: " + reason, ChatColor.YELLOW);
|
||||
FUtil.bcastMsg(" Reason: " + ChatColor.YELLOW + reason, ChatColor.RED);
|
||||
}
|
||||
FUtil.bcastMsg(" Smited by: " + ChatColor.YELLOW + sender.getName(), ChatColor.RED);
|
||||
|
||||
// Deop
|
||||
player.setOp(false);
|
||||
|
@ -130,18 +130,10 @@ public class Command_stfu extends FreedomCommand
|
||||
|
||||
if (smite)
|
||||
{
|
||||
Command_smite.smite(player);
|
||||
}
|
||||
|
||||
if (reason != null)
|
||||
{
|
||||
msg(player, "You have been muted. Reason: " + reason, ChatColor.RED);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg(player, "You have been muted.", ChatColor.RED);
|
||||
Command_smite.smite(sender, player, reason);
|
||||
}
|
||||
|
||||
msg(player, "You have been muted.", ChatColor.RED);
|
||||
msg("Muted " + player.getName());
|
||||
|
||||
}
|
||||
|
@ -6,13 +6,13 @@ import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE, blockHostConsole = true)
|
||||
@CommandParameters(description = "Removes essentials warps", usage = "/<command>")
|
||||
public class Command_wipewarps extends FreedomCommand
|
||||
{
|
||||
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
@ -21,6 +21,7 @@ public class Command_wipewarps extends FreedomCommand
|
||||
msg("Essentials is not enabled on this server");
|
||||
return true;
|
||||
}
|
||||
|
||||
Plugin essentials = server.getPluginManager().getPlugin("Essentials");
|
||||
FUtil.adminAction(sender.getName(), "Wiping Essentials Warps", true);
|
||||
server.getPluginManager().disablePlugin(essentials);
|
||||
@ -28,6 +29,5 @@ public class Command_wipewarps extends FreedomCommand
|
||||
server.getPluginManager().enablePlugin(essentials);
|
||||
msg("All warps deleted.");
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user