Class VoxelSniperConfigLoader
java.lang.Object
com.thevoxelbox.voxelsniper.config.VoxelSniperConfigLoader
Configuration storage defining global configurations for VoxelSniper.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVoxelSniperConfigLoader(VoxelSniperPlugin plugin, FileConfiguration config) Create a new cached voxel configuration loader. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn if persistent sessions are enabled.voidenableUpdateChecker(boolean enabled) Set the update checker be enabled or disabled.Return brush properties.intReturn maximum reasonable brush size before sending a warning.protected intReturn current config version.Return default block type.intReturn default brush size.intReturn default cylinder center.Return default replace block type.intReturn default voxel height.intReturn maximum size of brushes that LiteSnipers can use.Return List of restricted Litesniper materials.intReturn update interval in hours.booleanReturn if the login message is enabled.booleanReturn if update checker is enabled.protected voidremoveBrushProperty(String brush, String propertyKey) Remove a brush property from config.protected voidSet brush properties.protected voidsetBrushProperty(String brush, String propertyKey, Object value) Set a brush property from config.protected voidsetBrushSizeWarningThreshold(int size) Set maximum reasonable brush size before sending a warning.protected voidsetConfigVersion(int version) Set current config version.protected voidsetDefaultBlockMaterial(BlockType blockType) Set default block type.protected voidsetDefaultBrushSize(int size) Set default brush size.protected voidsetDefaultCylinderCenter(int center) Set default cylinder center.protected voidsetDefaultReplaceBlockMaterial(BlockType blockType) Set default replace block type.protected voidsetDefaultVoxelHeight(int height) Set default voxel height.protected voidsetLitesniperMaxBrushSize(int size) Set maximum size of brushes that LiteSnipers can use.protected voidsetLitesniperRestrictedMaterials(List<String> restrictedMaterials) Set new list of restricted Litesniper materials.protected voidsetMessageOnLoginEnabled(boolean enabled) Set the message on login to be enabled or disabled.protected voidsetPersistentSessions(boolean enabled) Set option for sniping sessions to be persisted on logout or not.voidsetUpdateCheckerInterval(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:
trueif to check for updates periodically,falseotherwise.- 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:
trueif message on login is enabled,falseotherwise.
-
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:
trueif persistent session are enabled,falseotherwise.
-
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
-