mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 00:26:45 +01:00
Added removeNick, removeSuffix, and removePrefix to remove each respective feature
This commit is contained in:
parent
8d8553c568
commit
4d730dbd00
2
TODO
2
TODO
@ -1,7 +1,7 @@
|
|||||||
Vminecraft b8 Todo:
|
Vminecraft b8 Todo:
|
||||||
+ Finish work on the flat file system
|
+ Finish work on the flat file system
|
||||||
+ Antigriefs <Nos> Working on this
|
+ Antigriefs <Nos> Working on this
|
||||||
+ Time manipulation <Cere> Working on this
|
? Time manipulation <Cere> Working on this
|
||||||
* Have time changes not be instant but move the sky faster
|
* Have time changes not be instant but move the sky faster
|
||||||
to get to the time entered
|
to get to the time entered
|
||||||
* Loop through specific times of the day and then rewind
|
* Loop through specific times of the day and then rewind
|
||||||
|
@ -501,7 +501,7 @@ public class vMinecraftChat {
|
|||||||
{
|
{
|
||||||
//If the char is a ^ or <EFBFBD>
|
//If the char is a ^ or <EFBFBD>
|
||||||
if(taste || msg.charAt(x) == '^'
|
if(taste || msg.charAt(x) == '^'
|
||||||
|| msg.charAt(x) == Colors.White.charAt(0))
|
|| msg.charAt(x) == Colors.Red.charAt(0))
|
||||||
{
|
{
|
||||||
if(x != msg.length() - 1)
|
if(x != msg.length() - 1)
|
||||||
{
|
{
|
||||||
|
@ -38,8 +38,11 @@ public class vMinecraftCommands{
|
|||||||
|
|
||||||
//Administrative
|
//Administrative
|
||||||
cl.register("/prefix", "prefix");
|
cl.register("/prefix", "prefix");
|
||||||
|
cl.register("/rprefix", "removePrefix");
|
||||||
cl.register("/nick", "nickName");
|
cl.register("/nick", "nickName");
|
||||||
|
cl.register("/rnick", "removeNick");
|
||||||
cl.register("/suffix", "suffix");
|
cl.register("/suffix", "suffix");
|
||||||
|
cl.register("/rsuffix", "removeSuffix");
|
||||||
cl.register("/vminecraft", "vminecrafthelp");
|
cl.register("/vminecraft", "vminecrafthelp");
|
||||||
cl.register("/reload", "reload");
|
cl.register("/reload", "reload");
|
||||||
cl.register("/whois", "whois", "/whois [user]");
|
cl.register("/whois", "whois", "/whois [user]");
|
||||||
@ -251,6 +254,50 @@ public class vMinecraftCommands{
|
|||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=====================================================================
|
||||||
|
//Function: removeTag (/rprefix)
|
||||||
|
//Input: Player player: The player using the command
|
||||||
|
// String[] args: Ignored
|
||||||
|
//Output: int: Exit Code
|
||||||
|
//Use: Removes your prefix
|
||||||
|
//=====================================================================
|
||||||
|
public static int removeTag(Player player, String[] args){
|
||||||
|
|
||||||
|
//if the player can suffix others
|
||||||
|
if(player.canUseCommand("/prefixother")){
|
||||||
|
if(args.length < 1){
|
||||||
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
|
+ "Usage is /rprefix [Player]");
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Check if the player exists
|
||||||
|
Player other = etc.getServer().matchPlayer(args[0]);
|
||||||
|
if(other == null)
|
||||||
|
{
|
||||||
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
|
+ "The player you specified could not be found");
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
vMinecraftUsers.getProfile(other).setTag("");
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Check if the player can set their own prefix.
|
||||||
|
if(!player.canUseCommand("/prefix")){
|
||||||
|
return EXIT_FAIL;
|
||||||
|
}
|
||||||
|
if(args.length < 1){
|
||||||
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
|
+ "Usage is /rprefix");
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
vMinecraftUsers.getProfile(player).setTag("");
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
//=====================================================================
|
//=====================================================================
|
||||||
//Function: nickName (/nick)
|
//Function: nickName (/nick)
|
||||||
//Input: Player player: The player using the command
|
//Input: Player player: The player using the command
|
||||||
@ -272,7 +319,7 @@ public class vMinecraftCommands{
|
|||||||
if(vMinecraftChat.msgLength(args[1]) > 85)
|
if(vMinecraftChat.msgLength(args[1]) > 85)
|
||||||
{
|
{
|
||||||
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
+ "The suffix you entered was too long.");
|
+ "The nick you entered was too long.");
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,7 +345,7 @@ public class vMinecraftCommands{
|
|||||||
if(vMinecraftChat.msgLength(args[1]) > 85)
|
if(vMinecraftChat.msgLength(args[1]) > 85)
|
||||||
{
|
{
|
||||||
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
+ "The suffix you entered was too long.");
|
+ "The nick you entered was too long.");
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,10 +359,54 @@ public class vMinecraftCommands{
|
|||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=====================================================================
|
||||||
|
//Function: removeNick (/rnick)
|
||||||
|
//Input: Player player: The player using the command
|
||||||
|
// String[] args: Ignored
|
||||||
|
//Output: int: Exit Code
|
||||||
|
//Use: Removes your nick
|
||||||
|
//=====================================================================
|
||||||
|
public static int removeNick(Player player, String[] args){
|
||||||
|
|
||||||
|
//if the player can nick others
|
||||||
|
if(player.canUseCommand("/nickother")){
|
||||||
|
if(args.length < 1){
|
||||||
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
|
+ "Usage is /rnick [Player]");
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Check if the player exists
|
||||||
|
Player other = etc.getServer().matchPlayer(args[0]);
|
||||||
|
if(other == null)
|
||||||
|
{
|
||||||
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
|
+ "The player you specified could not be found");
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
vMinecraftUsers.getProfile(other).setNick("");
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Check if the player can set their own nick.
|
||||||
|
if(!player.canUseCommand("/nick")){
|
||||||
|
return EXIT_FAIL;
|
||||||
|
}
|
||||||
|
if(args.length < 1){
|
||||||
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
|
+ "Usage is /rnick");
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
vMinecraftUsers.getProfile(player).setNick("");
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
//=====================================================================
|
//=====================================================================
|
||||||
//Function: suffix (/suffix)
|
//Function: suffix (/suffix)
|
||||||
//Input: Player player: The player using the command
|
//Input: Player player: The player using the command
|
||||||
// String[] args: The color and the prefix
|
// String[] args: The color and the suffix
|
||||||
//Output: int: Exit Code
|
//Output: int: Exit Code
|
||||||
//Use: Changes your suffix
|
//Use: Changes your suffix
|
||||||
//=====================================================================
|
//=====================================================================
|
||||||
@ -372,6 +463,50 @@ public class vMinecraftCommands{
|
|||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=====================================================================
|
||||||
|
//Function: removeSuffix (/rsuffix)
|
||||||
|
//Input: Player player: The player using the command
|
||||||
|
// String[] args: Ignored
|
||||||
|
//Output: int: Exit Code
|
||||||
|
//Use: Removes your suffix
|
||||||
|
//=====================================================================
|
||||||
|
public static int removeSuffix(Player player, String[] args){
|
||||||
|
|
||||||
|
//if the player can suffix others
|
||||||
|
if(player.canUseCommand("/suffixother")){
|
||||||
|
if(args.length < 1){
|
||||||
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
|
+ "Usage is /rsuffix [Player]");
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Check if the player exists
|
||||||
|
Player other = etc.getServer().matchPlayer(args[0]);
|
||||||
|
if(other == null)
|
||||||
|
{
|
||||||
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
|
+ "The player you specified could not be found");
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
vMinecraftUsers.getProfile(other).setSuffix("");
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Check if the player can set their own suffix.
|
||||||
|
if(!player.canUseCommand("/suffix")){
|
||||||
|
return EXIT_FAIL;
|
||||||
|
}
|
||||||
|
if(args.length < 1){
|
||||||
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
|
+ "Usage is /rsuffix");
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
vMinecraftUsers.getProfile(player).setSuffix("");
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
//=====================================================================
|
//=====================================================================
|
||||||
//Function: colors (/colors)
|
//Function: colors (/colors)
|
||||||
//Input: Player player: The player using the command
|
//Input: Player player: The player using the command
|
||||||
@ -379,7 +514,10 @@ public class vMinecraftCommands{
|
|||||||
//Use: Displays a list of all colors and color codes
|
//Use: Displays a list of all colors and color codes
|
||||||
//=====================================================================
|
//=====================================================================
|
||||||
public static int colors(Player player, String[] args){
|
public static int colors(Player player, String[] args){
|
||||||
player.sendMessage(Colors.Rose + "You use these color codes like in quake or MW2, ^4 would make text red, ^a would make it light green.");
|
player.sendMessage(Colors.Rose + "You use these color codes like in quake or MW2.");
|
||||||
|
player.sendMessage(Colors.Rose + "^4 would make text " + Colors.Red
|
||||||
|
+ "red" + Colors.Rose + ", ^a would make it " + Colors.LightGreen
|
||||||
|
+ "light green" + Colors.Rose + ".");
|
||||||
vMinecraftChat.sendMessage(player, player,
|
vMinecraftChat.sendMessage(player, player,
|
||||||
Colors.Black + "0"
|
Colors.Black + "0"
|
||||||
+ Colors.Navy + "1"
|
+ Colors.Navy + "1"
|
||||||
@ -537,6 +675,13 @@ public class vMinecraftCommands{
|
|||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ignore.hasControlOver(player))
|
||||||
|
{
|
||||||
|
vMinecraftChat.sendMessage(player, player, Colors.Rose
|
||||||
|
+ "You can't ignore someone a higher rank than you.");
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
//Don't let the player ignore themselves
|
//Don't let the player ignore themselves
|
||||||
if(!ignore.getName().equalsIgnoreCase(player.getName()))
|
if(!ignore.getName().equalsIgnoreCase(player.getName()))
|
||||||
{
|
{
|
||||||
|
@ -164,7 +164,9 @@ class PlayerList
|
|||||||
lastMessage,
|
lastMessage,
|
||||||
nickName,
|
nickName,
|
||||||
tag,
|
tag,
|
||||||
suffix;
|
suffix,
|
||||||
|
defaultColor;
|
||||||
|
|
||||||
private ArrayList<String> ignoreList;
|
private ArrayList<String> ignoreList;
|
||||||
private commandList aliasList;
|
private commandList aliasList;
|
||||||
|
|
||||||
@ -429,6 +431,22 @@ class PlayerList
|
|||||||
//=====================================================================
|
//=====================================================================
|
||||||
public String getSuffix() { return suffix; }
|
public String getSuffix() { return suffix; }
|
||||||
|
|
||||||
|
//=====================================================================
|
||||||
|
//Function: setColor
|
||||||
|
//Input: String newTag: The color to set for the player
|
||||||
|
//Output: None
|
||||||
|
//Use: Sets a player color
|
||||||
|
//=====================================================================
|
||||||
|
public void setColor(String newColor){ defaultColor = newColor; }
|
||||||
|
|
||||||
|
//=====================================================================
|
||||||
|
//Function: getColor
|
||||||
|
//Input: None
|
||||||
|
//Output: String: The player color
|
||||||
|
//Use: Gets a player color
|
||||||
|
//=====================================================================
|
||||||
|
public String getColor() { return defaultColor; }
|
||||||
|
|
||||||
//=====================================================================
|
//=====================================================================
|
||||||
//Function: setMessage
|
//Function: setMessage
|
||||||
//Input: String newName: The name of the player they last messaged
|
//Input: String newName: The name of the player they last messaged
|
||||||
|
Loading…
Reference in New Issue
Block a user