Class VoxelSniperConfigLoader
java.lang.Object
com.thevoxelbox.voxelsniper.config.VoxelSniperConfigLoader
Configuration storage defining global configurations for VoxelSniper.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionVoxelSniperConfigLoader
(VoxelSniperPlugin plugin, FileConfiguration config) Create a new cached voxel configuration loader. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Return if persistent sessions are enabled.void
enableUpdateChecker
(boolean enabled) Set the update checker be enabled or disabled.Return brush properties.int
Return maximum reasonable brush size before sending a warning.protected int
Return current config version.Return default block type.int
Return default brush size.int
Return default cylinder center.Return default replace block type.int
Return default voxel height.int
Return maximum size of brushes that LiteSnipers can use.Return List of restricted Litesniper materials.int
Return update interval in hours.boolean
Return if the login message is enabled.boolean
Return if update checker is enabled.protected void
removeBrushProperty
(String brush, String propertyKey) Remove a brush property from config.protected void
Set brush properties.protected void
setBrushProperty
(String brush, String propertyKey, Object value) Set a brush property from config.protected void
setBrushSizeWarningThreshold
(int size) Set maximum reasonable brush size before sending a warning.protected void
setConfigVersion
(int version) Set current config version.protected void
setDefaultBlockMaterial
(BlockType blockType) Set default block type.protected void
setDefaultBrushSize
(int size) Set default brush size.protected void
setDefaultCylinderCenter
(int center) Set default cylinder center.protected void
setDefaultReplaceBlockMaterial
(BlockType blockType) Set default replace block type.protected void
setDefaultVoxelHeight
(int height) Set default voxel height.protected void
setLitesniperMaxBrushSize
(int size) Set maximum size of brushes that LiteSnipers can use.protected void
setLitesniperRestrictedMaterials
(List<String> restrictedMaterials) Set new list of restricted Litesniper materials.protected void
setMessageOnLoginEnabled
(boolean enabled) Set the message on login to be enabled or disabled.protected void
setPersistentSessions
(boolean enabled) Set option for sniping sessions to be persisted on logout or not.void
setUpdateCheckerInterval
(int interval) Set the update checker waiting interval.
-
Field Details
-
BRUSH_PROPERTIES
- See Also:
-
-
Constructor Details
-
VoxelSniperConfigLoader
Create a new cached voxel configuration loader.- Parameters:
plugin
- the plugin instanceconfig
- the configuration that is going to be used.
-
-
Method Details
-
getConfigVersion
protected int getConfigVersion()Return current config version.- Returns:
- current version
-
setConfigVersion
protected void setConfigVersion(int version) Set current config version.- Parameters:
version
- new version
-
isUpdateCheckerEnabled
public boolean isUpdateCheckerEnabled()Return if update checker is enabled.- Returns:
true
if to check for updates periodically,false
otherwise.- Since:
- 2.8.0
-
enableUpdateChecker
public void enableUpdateChecker(boolean enabled) Set the update checker be enabled or disabled.- Parameters:
enabled
- Update checker enabled- Since:
- 2.8.0
-
getUpdateCheckerInterval
public int getUpdateCheckerInterval()Return update interval in hours.- Returns:
- interval in hours
- Since:
- 2.8.0
-
setUpdateCheckerInterval
public void setUpdateCheckerInterval(int interval) Set the update checker waiting interval.- Parameters:
interval
- Period to wait in hours in-between checks- Since:
- 2.8.0
-
isMessageOnLoginEnabled
public boolean isMessageOnLoginEnabled()Return if the login message is enabled.- Returns:
true
if message on login is enabled,false
otherwise.
-
setMessageOnLoginEnabled
protected void setMessageOnLoginEnabled(boolean enabled) Set the message on login to be enabled or disabled.- Parameters:
enabled
- Messages on Login enabled
-
arePersistentSessionsEnabled
public boolean arePersistentSessionsEnabled()Return if persistent sessions are enabled.- Returns:
true
if persistent session are enabled,false
otherwise.
-
setPersistentSessions
protected void setPersistentSessions(boolean enabled) Set option for sniping sessions to be persisted on logout or not.- Parameters:
enabled
- Save sniping session upon logout
-
getDefaultBlockMaterial
Return default block type.- Returns:
- default type
-
setDefaultBlockMaterial
Set default block type.- Parameters:
blockType
- default type
-
getDefaultReplaceBlockMaterial
Return default replace block type.- Returns:
- default type
-
setDefaultReplaceBlockMaterial
Set default replace block type.- Parameters:
blockType
- default type
-
getDefaultBrushSize
public int getDefaultBrushSize()Return default brush size.- Returns:
- default size
-
setDefaultBrushSize
protected void setDefaultBrushSize(int size) Set default brush size.- Parameters:
size
- default size
-
getLitesniperMaxBrushSize
public int getLitesniperMaxBrushSize()Return maximum size of brushes that LiteSnipers can use.- Returns:
- maximum size
-
setLitesniperMaxBrushSize
protected void setLitesniperMaxBrushSize(int size) Set maximum size of brushes that LiteSnipers can use.- Parameters:
size
- maximum size
-
getLitesniperRestrictedMaterials
Return List of restricted Litesniper materials.- Returns:
- List of restricted Litesniper materials
-
setLitesniperRestrictedMaterials
Set new list of restricted Litesniper materials.- Parameters:
restrictedMaterials
- List of restricted Litesniper materials
-
getBrushSizeWarningThreshold
public int getBrushSizeWarningThreshold()Return maximum reasonable brush size before sending a warning.- Returns:
- maximum size
-
setBrushSizeWarningThreshold
protected void setBrushSizeWarningThreshold(int size) Set maximum reasonable brush size before sending a warning.- Parameters:
size
- maximum size
-
getDefaultVoxelHeight
public int getDefaultVoxelHeight()Return default voxel height.- Returns:
- default height
-
setDefaultVoxelHeight
protected void setDefaultVoxelHeight(int height) Set default voxel height.- Parameters:
height
- default height
-
getDefaultCylinderCenter
public int getDefaultCylinderCenter()Return default cylinder center.- Returns:
- default center
-
setDefaultCylinderCenter
protected void setDefaultCylinderCenter(int center) Set default cylinder center.- Parameters:
center
- default center
-
getBrushProperties
Return brush properties. This Map stores another Map (associating Property -> Value) per brush.- Returns:
- brush properties
-
setBrushProperties
Set brush properties.- Parameters:
brushProperties
- brush properties
-
setBrushProperty
Set a brush property from config.- Parameters:
brush
- brushpropertyKey
- propertyKeyvalue
- value
-
removeBrushProperty
Remove a brush property from config.- Parameters:
brush
- brushpropertyKey
- propertyKey
-