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
10
.idea/codeStyles/Project.xml
generated
10
.idea/codeStyles/Project.xml
generated
@ -1,5 +1,13 @@
|
|||||||
<component name="ProjectCodeStyleConfiguration">
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
<code_scheme name="Project" version="173">
|
<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">
|
<codeStyleSettings language="JAVA">
|
||||||
<option name="BRACE_STYLE" value="2" />
|
<option name="BRACE_STYLE" value="2" />
|
||||||
<option name="CLASS_BRACE_STYLE" value="2" />
|
<option name="CLASS_BRACE_STYLE" value="2" />
|
||||||
@ -15,4 +23,4 @@
|
|||||||
<option name="FOR_BRACE_FORCE" value="3" />
|
<option name="FOR_BRACE_FORCE" value="3" />
|
||||||
</codeStyleSettings>
|
</codeStyleSettings>
|
||||||
</code_scheme>
|
</code_scheme>
|
||||||
</component>
|
</component>
|
@ -1,33 +1,41 @@
|
|||||||
package me.totalfreedom.totalfreedommod.command;
|
package me.totalfreedom.totalfreedommod.command;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||||
import me.totalfreedom.totalfreedommod.masterbuilder.MasterBuilder;
|
import me.totalfreedom.totalfreedommod.masterbuilder.MasterBuilder;
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.playerverification.VPlayer;
|
import me.totalfreedom.totalfreedommod.playerverification.VPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH)
|
@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
|
public class Command_tag extends FreedomCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
public static final List<String> FORBIDDEN_WORDS = Arrays.asList(
|
public static final List<String> FORBIDDEN_WORDS = Arrays.asList(
|
||||||
"admin", "owner", "moderator", "developer", "console", "dev", "staff", "mod", "sra", "tca", "sta", "sa");
|
"admin", "owner", "moderator", "developer", "console", "dev", "staff", "mod", "sra", "tca", "sta", "sa");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
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 (args.length == 1)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ("list".equalsIgnoreCase(args[0]))
|
if ("list".equalsIgnoreCase(args[0]))
|
||||||
{
|
{
|
||||||
msg("Tags for all online players:");
|
msg("Tags for all online players:");
|
||||||
@ -77,8 +85,11 @@ public class Command_tag extends FreedomCommand
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
plugin.pl.getPlayer(playerSender).setTag(null);
|
plugin.pl.getPlayer(playerSender).setTag(null);
|
||||||
save(playerSender, null);
|
if (save)
|
||||||
msg("Your tag has been removed.");
|
{
|
||||||
|
save(playerSender, null);
|
||||||
|
}
|
||||||
|
msg("Your tag has been removed." + (save ? " (Saved)" : ""));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -107,8 +118,11 @@ public class Command_tag extends FreedomCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugin.pl.getPlayer(player).setTag(null);
|
plugin.pl.getPlayer(player).setTag(null);
|
||||||
save(player, null);
|
if (save)
|
||||||
msg("Removed " + player.getName() + "'s tag.");
|
{
|
||||||
|
save(player, null);
|
||||||
|
}
|
||||||
|
msg("Removed " + player.getName() + "'s tag." + (save ? " (Saved)" : ""));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -117,13 +131,13 @@ public class Command_tag extends FreedomCommand
|
|||||||
final String inputTag = StringUtils.join(args, " ", 1, args.length);
|
final String inputTag = StringUtils.join(args, " ", 1, args.length);
|
||||||
final String strippedTag = StringUtils.replaceEachRepeatedly(StringUtils.strip(inputTag),
|
final String strippedTag = StringUtils.replaceEachRepeatedly(StringUtils.strip(inputTag),
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
"" + ChatColor.COLOR_CHAR, "&k"
|
"" + ChatColor.COLOR_CHAR, "&k"
|
||||||
},
|
},
|
||||||
new String[]
|
new String[]
|
||||||
{
|
{
|
||||||
"", ""
|
"", ""
|
||||||
});
|
});
|
||||||
final String outputTag = FUtil.colorize(strippedTag);
|
final String outputTag = FUtil.colorize(strippedTag);
|
||||||
|
|
||||||
if (!plugin.al.isAdmin(sender))
|
if (!plugin.al.isAdmin(sender))
|
||||||
@ -147,8 +161,11 @@ public class Command_tag extends FreedomCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugin.pl.getPlayer(playerSender).setTag(outputTag);
|
plugin.pl.getPlayer(playerSender).setTag(outputTag);
|
||||||
save(playerSender, strippedTag);
|
if (save)
|
||||||
msg("Tag set to '" + outputTag + ChatColor.GRAY + "'.");
|
{
|
||||||
|
save(playerSender, null);
|
||||||
|
}
|
||||||
|
msg("Tag set to '" + outputTag + ChatColor.GRAY + "'." + (save ? " (Saved)" : ""));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user