Class Options

java.lang.Object
me.manossef.semihardcore.data.Options

public class Options extends Object
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

    Constructors
    Constructor
    Description
    Options(int startingLivesMin, int startingLivesMax, boolean hardcoreHearts, boolean forceHardDifficulty, int livesLimit, boolean playersCanBeGenerous, boolean lightningStrikeOnLastDeath, boolean sacrificesForRevival, boolean playersCanGiveAwayLastLife)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    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
    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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public void logOptions(Logger logger)
      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