Package de.erethon.dungeonsxl.api
Interface Requirement
public interface Requirement
Something a player needs to fulfill in order to be allowed to start the game (= trigger a ready sign).
- Author:
- Daniel Saukel
-
Method Summary
Modifier and TypeMethodDescriptionboolean
check(org.bukkit.entity.Player player)
Returns if the given player fulfills the requirements.void
demand(org.bukkit.entity.Player player)
This is fired after thecheck(Player)
has been accepted.net.md_5.bungee.api.chat.BaseComponent[]
getCheckMessage(org.bukkit.entity.Player player)
Returns the message that informs the player if they fulfill the requirement.void
setup(org.bukkit.configuration.ConfigurationSection config)
Sets up the requirement from the given requirementsGameRule
section.
-
Method Details
-
setup
void setup(org.bukkit.configuration.ConfigurationSection config)Sets up the requirement from the given requirementsGameRule
section.- Parameters:
config
- the requirements config section
-
check
boolean check(org.bukkit.entity.Player player)Returns if the given player fulfills the requirements. If true, this lets him start the game (= trigger a ready sign).- Parameters:
player
- the player- Returns:
- if the given player fulfills the requirements
-
getCheckMessage
net.md_5.bungee.api.chat.BaseComponent[] getCheckMessage(org.bukkit.entity.Player player)Returns the message that informs the player if they fulfill the requirement.- Parameters:
player
- the player who will receive the message- Returns:
- the error message that is sent to the player when they do not fulfill the requirement
-
demand
void demand(org.bukkit.entity.Player player)This is fired after thecheck(Player)
has been accepted. It demands the requirement from the given player. This may be empty for a "key" or may take something away for a "fee" requirement.- Parameters:
player
- the player
-