mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
ok
This commit is contained in:
parent
b97fd70b83
commit
8bd8efc665
8
.idea/codeStyles/Project.xml
generated
8
.idea/codeStyles/Project.xml
generated
@ -1,5 +1,13 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<JavaCodeStyleSettings>
|
||||
<option name="IMPORT_LAYOUT_TABLE">
|
||||
<value>
|
||||
<package name="" withSubpackages="true" static="false" />
|
||||
<package name="" withSubpackages="true" static="true" />
|
||||
</value>
|
||||
</option>
|
||||
</JavaCodeStyleSettings>
|
||||
<codeStyleSettings language="JAVA">
|
||||
<option name="BRACE_STYLE" value="2" />
|
||||
<option name="CLASS_BRACE_STYLE" value="2" />
|
||||
|
@ -1,22 +1,22 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.masterbuilder.MasterBuilder;
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.playerverification.VPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Sets yourself a prefix", usage = "/<command> <set <tag..> | off | clear <player> | clearall>")
|
||||
@CommandParameters(description = "Sets yourself a prefix", usage = "/<command> [-s[ave]] <set <tag..> | off | clear <player> | clearall>")
|
||||
public class Command_tag extends FreedomCommand
|
||||
{
|
||||
|
||||
@ -26,8 +26,16 @@ public class Command_tag extends FreedomCommand
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
boolean save = false;
|
||||
if (args[0].equals("-s") || args[0].equals("-save"))
|
||||
{
|
||||
save = true;
|
||||
args = ArrayUtils.remove(args, 0);
|
||||
}
|
||||
|
||||
if (args.length == 1)
|
||||
{
|
||||
|
||||
if ("list".equalsIgnoreCase(args[0]))
|
||||
{
|
||||
msg("Tags for all online players:");
|
||||
@ -77,8 +85,11 @@ public class Command_tag extends FreedomCommand
|
||||
else
|
||||
{
|
||||
plugin.pl.getPlayer(playerSender).setTag(null);
|
||||
if (save)
|
||||
{
|
||||
save(playerSender, null);
|
||||
msg("Your tag has been removed.");
|
||||
}
|
||||
msg("Your tag has been removed." + (save ? " (Saved)" : ""));
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -107,8 +118,11 @@ public class Command_tag extends FreedomCommand
|
||||
}
|
||||
|
||||
plugin.pl.getPlayer(player).setTag(null);
|
||||
if (save)
|
||||
{
|
||||
save(player, null);
|
||||
msg("Removed " + player.getName() + "'s tag.");
|
||||
}
|
||||
msg("Removed " + player.getName() + "'s tag." + (save ? " (Saved)" : ""));
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -147,8 +161,11 @@ public class Command_tag extends FreedomCommand
|
||||
}
|
||||
|
||||
plugin.pl.getPlayer(playerSender).setTag(outputTag);
|
||||
save(playerSender, strippedTag);
|
||||
msg("Tag set to '" + outputTag + ChatColor.GRAY + "'.");
|
||||
if (save)
|
||||
{
|
||||
save(playerSender, null);
|
||||
}
|
||||
msg("Tag set to '" + outputTag + ChatColor.GRAY + "'." + (save ? " (Saved)" : ""));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user