|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bukkit.help.HelpTopic
public abstract class HelpTopic
HelpTopic implementations are displayed to the user when the user uses the /help command.
Custom implementations of this class can work at two levels. A simple implementation only
needs to set the value of name
, shortText
, and fullText
int the
constructor. This base class will take care of the rest.
Complex implementations can be created by overriding the behavior of all the methods in
this class.
Field Summary | |
---|---|
protected String |
amendedPermission
|
protected String |
fullText
|
protected String |
name
|
protected String |
shortText
|
Constructor Summary | |
---|---|
HelpTopic()
|
Method Summary | |
---|---|
void |
amendCanSee(String amendedPermission)
Allows the server administrator to override the permission required to see a help topic. |
void |
amendTopic(String amendedShortText,
String amendedFullText)
Allows the server admin (or another plugin) to add or replace the contents of a help topic. |
protected String |
applyAmendment(String baseText,
String amendment)
Developers implementing their own custom HelpTopic implementations can use this utility method to ensure their implementations comply with the expected behavior of the amendTopic(String, String)
method. |
abstract boolean |
canSee(CommandSender player)
Determines if a Player is allowed to see this help topic. |
String |
getFullText(CommandSender forWho)
Returns the full description of this help topic that is displayed when the user requests this topic's details. |
String |
getName()
Returns the name of this help topic. |
String |
getShortText()
Returns a brief description that will be displayed in the topic index. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String name
protected String shortText
protected String fullText
protected String amendedPermission
Constructor Detail |
---|
public HelpTopic()
Method Detail |
---|
public abstract boolean canSee(CommandSender player)
Player
is allowed to see this help topic. HelpTopic implementations should take
server administrator wishes into account as set by the amendCanSee(String)
function.
player
- The Player in question.
public void amendCanSee(String amendedPermission)
canSee(org.bukkit.command.CommandSender)
function.
amendedPermission
- The permission node the server administrator wishes to apply to this topic.public String getName()
public String getShortText()
public String getFullText(CommandSender forWho)
forWho
- The player or console requesting the full text. Useful for further security trimming
the command's full text based on sub-permissions in custom implementations.
public void amendTopic(String amendedShortText, String amendedFullText)
amendedShortText
- The new topic short text to use, or null to leave alone.amendedFullText
- The new topic full text to use, or null to leave alone.protected String applyAmendment(String baseText, String amendment)
amendTopic(String, String)
method.
baseText
- The existing text of the help topic.amendment
- The amending text from the amendTopic() method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |