Package me.manossef.semihardcore.data
Class Options
java.lang.Object
me.manossef.semihardcore.data.Options
Stores the plugin's configuration options. The plugin creates an instance of
this class when it's enabled, and uses it throughout the running of the
server. Creating any new instances of this class has no effect on the plugin.
-
Constructor Summary
ConstructorDescriptionOptions
(int startingLivesMin, int startingLivesMax, boolean hardcoreHearts, boolean forceHardDifficulty, int livesLimit, boolean playersCanBeGenerous, boolean lightningStrikeOnLastDeath, boolean sacrificesForRevival, boolean playersCanGiveAwayLastLife) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether players are allowed to give away lives using the/givelife
command.boolean
Returns whether players are allowed to give away their last life to an alive player.boolean
Returns whether players are allowed to sacrifice themselves (give away their last life) to revive a dead player.boolean
Returns whether the plugin creates a fake lightning effect at a player's position on their final death.boolean
Returns whether the server enforces hard difficulty on all worlds.int
Returns the maximum number of lives a player can have at any time.int
Returns the maximum number of lives a player can start with.int
Returns the minimum number of lives a player can start with.boolean
Returns whether the server will show players' hearts above the hotbar as hardcore hearts.void
logOptions
(Logger logger) Logs the current state of the plugin's options to the specified logger in a human-readable way.void
saveToFile
(org.bukkit.configuration.file.FileConfiguration file) Saves the options to the config.yml file.
-
Constructor Details
-
Options
public Options(int startingLivesMin, int startingLivesMax, boolean hardcoreHearts, boolean forceHardDifficulty, int livesLimit, boolean playersCanBeGenerous, boolean lightningStrikeOnLastDeath, boolean sacrificesForRevival, boolean playersCanGiveAwayLastLife)
-
-
Method Details
-
logOptions
Logs the current state of the plugin's options to the specified logger in a human-readable way.- Parameters:
logger
- the logger to log the options to
-
saveToFile
public void saveToFile(org.bukkit.configuration.file.FileConfiguration file) Saves the options to the config.yml file.- Parameters:
file
- the config.yml file configuration
-
getMinimumStartingLives
public int getMinimumStartingLives()Returns the minimum number of lives a player can start with.- Returns:
- the minimum starting lives
-
getMaximumStartingLives
public int getMaximumStartingLives()Returns the maximum number of lives a player can start with.- Returns:
- the maximum starting lives
-
hasHardcoreHearts
public boolean hasHardcoreHearts()Returns whether the server will show players' hearts above the hotbar as hardcore hearts.- Returns:
- true if the server shows hardcore hearts, false otherwise
-
forcesHardDifficulty
public boolean forcesHardDifficulty()Returns whether the server enforces hard difficulty on all worlds.- Returns:
- true if the server enforces hard difficulty, false otherwise
-
getLivesLimit
public int getLivesLimit()Returns the maximum number of lives a player can have at any time.- Returns:
- the plugin's upper limit of lives
-
canPlayersBeGenerous
public boolean canPlayersBeGenerous()Returns whether players are allowed to give away lives using the/givelife
command.- Returns:
- true if players can give away lives, false otherwise
-
doesLightningStrikeOnLastDeath
public boolean doesLightningStrikeOnLastDeath()Returns whether the plugin creates a fake lightning effect at a player's position on their final death.- Returns:
- true if fake lightning strikes on final death, false otherwise
-
canPlayersSacrificeToReviveSomeoneDead
public boolean canPlayersSacrificeToReviveSomeoneDead()Returns whether players are allowed to sacrifice themselves (give away their last life) to revive a dead player.- Returns:
- true if players can sacrifice themselves, false otherwise
-
canPlayersGiveAwayLastLife
public boolean canPlayersGiveAwayLastLife()Returns whether players are allowed to give away their last life to an alive player.- Returns:
- true if players can give away their last life, false otherwise
-