Class VoxelSniperConfigLoader

java.lang.Object
com.thevoxelbox.voxelsniper.config.VoxelSniperConfigLoader

public class VoxelSniperConfigLoader extends Object
Configuration storage defining global configurations for VoxelSniper.
  • Field Details

  • Constructor Details

    • VoxelSniperConfigLoader

      public VoxelSniperConfigLoader(VoxelSniperPlugin plugin, FileConfiguration config)
      Create a new cached voxel configuration loader.
      Parameters:
      plugin - the plugin instance
      config - 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

      public BlockType getDefaultBlockMaterial()
      Return default block type.
      Returns:
      default type
    • setDefaultBlockMaterial

      protected void setDefaultBlockMaterial(BlockType blockType)
      Set default block type.
      Parameters:
      blockType - default type
    • getDefaultReplaceBlockMaterial

      public BlockType getDefaultReplaceBlockMaterial()
      Return default replace block type.
      Returns:
      default type
    • setDefaultReplaceBlockMaterial

      protected void setDefaultReplaceBlockMaterial(BlockType blockType)
      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

      public List<String> getLitesniperRestrictedMaterials()
      Return List of restricted Litesniper materials.
      Returns:
      List of restricted Litesniper materials
    • setLitesniperRestrictedMaterials

      protected void setLitesniperRestrictedMaterials(List<String> restrictedMaterials)
      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

      public Map<String,Map<String,Object>> getBrushProperties()
      Return brush properties. This Map stores another Map (associating Property -> Value) per brush.
      Returns:
      brush properties
    • setBrushProperties

      protected void setBrushProperties(Map<String,Map<String,Object>> brushProperties)
      Set brush properties.
      Parameters:
      brushProperties - brush properties
    • setBrushProperty

      protected void setBrushProperty(String brush, String propertyKey, Object value)
      Set a brush property from config.
      Parameters:
      brush - brush
      propertyKey - propertyKey
      value - value
    • removeBrushProperty

      protected void removeBrushProperty(String brush, String propertyKey)
      Remove a brush property from config.
      Parameters:
      brush - brush
      propertyKey - propertyKey