Class DefaultConfig
java.lang.Object
nl.mtvehicles.core.infrastructure.models.MTVConfig
nl.mtvehicles.core.infrastructure.dataconfig.DefaultConfig
Methods for config.yml.
Do not initialise this class directly. Use
Do not initialise this class directly. Use
ConfigModule.defaultConfig instead.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumOptions available in MTV's default configuration file (config.yml) -
Field Summary
Fields inherited from class nl.mtvehicles.core.infrastructure.models.MTVConfig
config, configType -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor - do not use this.
UseConfigModule.defaultConfiginstead. -
Method Summary
Modifier and TypeMethodDescriptionList<org.bukkit.Material> Get the list of all whitelisted blocks.booleancanFillJerryCans(org.bukkit.entity.Player p, org.bukkit.Location loc) Check whether a jerrycan may be filled by a specified player on a specified location.booleancanProceedWithAction(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.booleancanUseJerryCan(org.bukkit.entity.Player player) Whether a player can use a jerrycan on their location.booleancanUseJerryCan(org.bukkit.entity.Player player, org.bukkit.Location loc) Check whether a jerrycan may be used on a specified location.Check which driveUp option is specified in config.yml (BLOCKS/SLABS/BOTH).get(DefaultConfig.Option configOption) Get a value of an option from config.ymldoubleGet the price of fuel (per litre).getMessage(String key) Deprecated.booleanCheck whether the last version (before an update) was using an older method of checking the config version.booleanCheck whether block whitelist is enabled.booleanIf prices for jerrycan filling are enabled.booleanCheck whether jerrycan may be filled by clicking on LEVERS.booleanCheck whether jerrycan may be filled by clicking on TRIPWIRE HOOKS.booleanbooleanbooleanisWorldDisabled(String worldName) Check whether a world is disabled.booleanCheck whether jerrycan sounds are turned on in config.yml.booleanCheck whether vehicles are steered using where drivers are facing.Methods inherited from class nl.mtvehicles.core.infrastructure.models.MTVConfig
getConfig, getConfiguration, reload, save, saveDefaultConfig, setConfigFile, setFileName
-
Constructor Details
-
DefaultConfig
public DefaultConfig()Default constructor - do not use this.
UseConfigModule.defaultConfiginstead.
-
-
Method Details
-
getMessage
Deprecated.This may lead to issues - useget(Option)instead.Get value of a config option specified by a String. -
get
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
Check which driveUp option is specified in config.yml (BLOCKS/SLABS/BOTH). -
isHoneySlowdownEnabled
public boolean isHoneySlowdownEnabled() -
isIceSlippery
public boolean isIceSlippery() -
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:
-
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
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
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- Locationp- 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.
-
get(Option)instead.