Class DefaultConfig

java.lang.Object
nl.mtvehicles.core.infrastructure.models.MTVConfig
nl.mtvehicles.core.infrastructure.dataconfig.DefaultConfig

public class DefaultConfig extends MTVConfig
Methods for config.yml.
Do not initialise this class directly. Use ConfigModule.defaultConfig instead.
  • Constructor Details

  • Method Details

    • getMessage

      @Deprecated public String getMessage(String key)
      Deprecated.
      This may lead to issues - use get(Option) instead.
      Get value of a config option specified by a String.
    • get

      public Object get(DefaultConfig.Option configOption)
      Get a value of an option from config.yml
      Parameters:
      configOption - Config.yml option
      Returns:
      Value of the option (as Object)
    • hasOldVersionChecking

      public boolean hasOldVersionChecking()
      Check whether the last version (before an update) was using an older method of checking the config version. This is present only for compatibility when updating from lower versions.
      Returns:
      True if the "Config-Versie" option was still present in config.yml.
    • driveUpSlabs

      public DriveUp driveUpSlabs()
      Check which driveUp option is specified in config.yml (BLOCKS/SLABS/BOTH).
    • canUseJerryCan

      public boolean canUseJerryCan(org.bukkit.entity.Player player, org.bukkit.Location loc)
      Check whether a jerrycan may be used on a specified location.
      Parameters:
      loc - Location
      Returns:
      True if gas stations are enabled, player is outside a region with flag 'mtvgasstation=deny' and inside a gas station if necessary.
    • canUseJerryCan

      public boolean canUseJerryCan(org.bukkit.entity.Player player)
      Whether a player can use a jerrycan on their location.
      Parameters:
      player - Player
      See Also:
      canUseJerryCan(Player, Location)
    • canFillJerryCans

      public boolean canFillJerryCans(org.bukkit.entity.Player p, org.bukkit.Location loc)
      Check whether a jerrycan may be filled by a specified player on a specified location.
      Returns:
      True if jerrycan may be filled.
    • jerryCanPlaySound

      public boolean jerryCanPlaySound()
      Check whether jerrycan sounds are turned on in config.yml.
    • isFillJerryCansLeverEnabled

      public boolean isFillJerryCansLeverEnabled()
      Check whether jerrycan may be filled by clicking on LEVERS.
    • isFillJerryCansTripwireHookEnabled

      public boolean isFillJerryCansTripwireHookEnabled()
      Check whether jerrycan may be filled by clicking on TRIPWIRE HOOKS.
    • isFillJerryCanPriceEnabled

      public boolean isFillJerryCanPriceEnabled()
      If prices for jerrycan filling are enabled.
    • getFillJerryCanPrice

      public double getFillJerryCanPrice()
      Get the price of fuel (per litre).
    • isWorldDisabled

      public boolean isWorldDisabled(String worldName)
      Check whether a world is disabled.
      Parameters:
      worldName - Name of the world
      Returns:
      True if disabled.
    • isBlockWhitelistEnabled

      public boolean isBlockWhitelistEnabled()
      Check whether block whitelist is enabled.
    • blockWhiteList

      public List<org.bukkit.Material> blockWhiteList()
      Get the list of all whitelisted blocks.
    • canProceedWithAction

      public boolean canProceedWithAction(RegionAction action, VehicleType vehicleType, org.bukkit.Location loc, org.bukkit.entity.Player p)
      Check whether a player can proceed with a specified action on a specified location.
      Parameters:
      action - Action (PLACE/PICKUP/ENTER)
      vehicleType - Type of the vehicle (enum)
      loc - Location
      p - Player
      Returns:
      True if nothing prevents the player from proceeding.
    • usePlayerFacingDriving

      public boolean usePlayerFacingDriving()
      Check whether vehicles are steered using where drivers are facing.
      Returns:
      True if this is enabled.