Class SubCommand
- java.lang.Object
-
- de.simonsator.partyandfriends.utilities.SubCommand
-
- All Implemented Interfaces:
java.lang.Comparable<SubCommand>
- Direct Known Subclasses:
AdminSubCommand
,FriendSubCommand
,PartySubCommand
public abstract class SubCommand extends java.lang.Object implements java.lang.Comparable<SubCommand>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SubCommand(java.lang.String[] pCommands, int pPriority, java.lang.String pHelp, java.lang.String pPrefix)
protected
SubCommand(java.lang.String[] pCommands, int pPriority, net.md_5.bungee.api.chat.TextComponent pHelp, java.lang.String pPrefix)
protected
SubCommand(java.util.List<java.lang.String> pCommands, int pPriority, java.lang.String pHelp, java.lang.String pPrefix, java.lang.String pPermission)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description int
compareTo(SubCommand o)
java.lang.String
getCommandName()
java.util.ArrayList<java.lang.String>
getCommandNames()
boolean
hasPermission(OnlinePAFPlayer pPlayer)
boolean
isApplicable(OnlinePAFPlayer pPlayer, java.lang.String pCommand)
boolean
isApplicable(java.lang.String pCommand)
abstract void
onCommand(OnlinePAFPlayer pPlayer, java.lang.String[] args)
void
printOutHelp(OnlinePAFPlayer pPlayer, java.lang.String pCommandName)
void
sendError(OnlinePAFPlayer pPlayer, java.lang.String pIdentifier)
void
sendError(OnlinePAFPlayer pPlayer, net.md_5.bungee.api.chat.TextComponent pMessage)
-
-
-
Constructor Detail
-
SubCommand
protected SubCommand(java.lang.String[] pCommands, int pPriority, net.md_5.bungee.api.chat.TextComponent pHelp, java.lang.String pPrefix)
-
SubCommand
protected SubCommand(java.lang.String[] pCommands, int pPriority, java.lang.String pHelp, java.lang.String pPrefix)
-
SubCommand
protected SubCommand(java.util.List<java.lang.String> pCommands, int pPriority, java.lang.String pHelp, java.lang.String pPrefix, java.lang.String pPermission)
- Parameters:
pCommands
- The names of this commandpPriority
- The priority of this command (the command with the lowest priority is listed first)pHelp
- The help message. It will be outprinted when the command is listed and whenprintOutHelp(OnlinePAFPlayer, String)
printOutHelp} is called.pPrefix
- The prefix of this command (e.g. [Friends] or [Party])pPermission
- The permission which is needed to execute this command. If no Permission is needed set it to null.
-
-
Method Detail
-
isApplicable
public boolean isApplicable(java.lang.String pCommand)
-
isApplicable
public boolean isApplicable(OnlinePAFPlayer pPlayer, java.lang.String pCommand)
-
sendError
public void sendError(OnlinePAFPlayer pPlayer, net.md_5.bungee.api.chat.TextComponent pMessage)
-
sendError
public void sendError(OnlinePAFPlayer pPlayer, java.lang.String pIdentifier)
-
onCommand
public abstract void onCommand(OnlinePAFPlayer pPlayer, java.lang.String[] args)
-
compareTo
public int compareTo(SubCommand o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<SubCommand>
-
getCommandName
public java.lang.String getCommandName()
-
getCommandNames
public java.util.ArrayList<java.lang.String> getCommandNames()
-
printOutHelp
public void printOutHelp(OnlinePAFPlayer pPlayer, java.lang.String pCommandName)
-
hasPermission
public boolean hasPermission(OnlinePAFPlayer pPlayer)
-
-