类 HelpTopic
- 直接已知子类:
GenericCommandHelpTopic
,IndexHelpTopic
Custom implementations of this class can work at two levels. A simple
implementation only needs to set the value of name
,
shortText
, and fullText
in 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.
-
字段概要
-
构造器概要
-
方法概要
修饰符和类型方法说明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 theamendTopic(String, String)
method.abstract boolean
canSee
(CommandSender player) Determines if aPlayer
is allowed to see this help topic.getFullText
(CommandSender forWho) Returns the full description of this help topic that is displayed when the user requests this topic's details.getName()
Returns the name of this help topic.Returns a brief description that will be displayed in the topic index.
-
字段详细资料
-
name
-
shortText
-
fullText
-
amendedPermission
-
-
构造器详细资料
-
HelpTopic
public HelpTopic()
-
-
方法详细资料
-
canSee
Determines if aPlayer
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.- 返回:
- True of the Player can see this help topic, false otherwise.
-
amendCanSee
Allows the server administrator to override the permission required to see a help topic.HelpTopic implementations should take this into account when determining topic visibility on the
canSee(org.bukkit.command.CommandSender)
function.- 参数:
amendedPermission
- The permission node the server administrator wishes to apply to this topic.
-
getName
Returns the name of this help topic.- 返回:
- The topic name.
-
getShortText
Returns a brief description that will be displayed in the topic index.- 返回:
- A brief topic description.
-
getFullText
Returns the full description of this help topic that is displayed when the user requests this topic's details.The result will be paginated to properly fit the user's client.
- 参数:
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.- 返回:
- A full topic description.
-
amendTopic
Allows the server admin (or another plugin) to add or replace the contents of a help topic.A null in either parameter will leave that part of the topic unchanged. In either amending parameter, the string <text> is replaced with the existing contents in the help topic. Use this to append or prepend additional content into an automatically generated help topic.
- 参数:
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.
-
applyAmendment
Developers implementing their own custom HelpTopic implementations can use this utility method to ensure their implementations comply with the expected behavior of theamendTopic(String, String)
method.- 参数:
baseText
- The existing text of the help topic.amendment
- The amending text from the amendTopic() method.- 返回:
- The application of the amending text to the existing text, according to the expected rules of amendTopic().
-