Package com.comphenix.protocol
Class ProtocolConfig
java.lang.Object
com.comphenix.protocol.ProtocolConfig
Represents the configuration of ProtocolLib.
- Author:
- Kristian
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongRetrieve the amount of time to wait until checking for a new update.longRetrieve the last time we updated, in seconds since 1970.01.01 00:00.Retrieve the default injection method.getFile()Retrieve a reference to the configuration file.The version of Minecraft to ignore the built-in safety feature.Retrieve the injection method that has been set in the configuration, or use a default value.intRetrieve the number of modifications made to this configuration.Retrieve the unique name of the script engine to use for filtering.com.google.common.collect.ImmutableList<String>Retrieve an immutable list of every suppressed report type.booleanRetrieve whether or not ProtocolLib should automatically download the new version.booleanRetrieve whether or not ProtocolLib should determine if a new version has been released.booleanRetrieve whether or not the background compiler for structure modifiers is enabled or not.booleanisDebug()Determine whether or not debug mode is enabled.booleanDetermine if detailed error reporting is enabled.booleanRetrieve whether or not metrics is enabled.voidReload configuration file.voidsaveAll()Save the current configuration file.voidsetAutoDelay(long delaySeconds)Set the amount of time to wait until checking for a new update.voidsetAutoDownload(boolean value)Set whether or not ProtocolLib should automatically download the new version.voidsetAutoLastTime(long lastTimeSeconds)Set the last time we updated, in seconds since 1970.01.01 00:00.voidsetAutoNotify(boolean value)Set whether or not ProtocolLib should determine if a new version has been released.voidsetBackgroundCompilerEnabled(boolean enabled)Set whether or not the background compiler for structure modifiers is enabled or not.voidsetDebug(boolean value)Set whether or not debug mode is enabled.voidsetDetailedErrorReporting(boolean value)Set whether or not detailed error reporting is enabled.voidsetIgnoreVersionCheck(String ignoreVersion)Sets under which version of Minecraft the version safety feature will be ignored.voidSet the starting injection method to use.voidsetMetricsEnabled(boolean enabled)Set whether or not metrics is enabled.voidsetScriptEngineName(String name)Set the unique name of the script engine to use for filtering.voidsetSuppressedReports(List<String> reports)Set the list of suppressed report types,
-
Constructor Details
-
ProtocolConfig
public ProtocolConfig(org.bukkit.plugin.Plugin plugin)
-
-
Method Details
-
reloadConfig
public void reloadConfig()Reload configuration file. -
getFile
Retrieve a reference to the configuration file.- Returns:
- Configuration file on disk.
-
isDetailedErrorReporting
public boolean isDetailedErrorReporting()Determine if detailed error reporting is enabled. Default FALSE.- Returns:
- TRUE if it is enabled, FALSE otherwise.
-
setDetailedErrorReporting
public void setDetailedErrorReporting(boolean value)Set whether or not detailed error reporting is enabled.- Parameters:
value- - TRUE if it is enabled, FALSE otherwise.
-
isAutoNotify
public boolean isAutoNotify()Retrieve whether or not ProtocolLib should determine if a new version has been released.- Returns:
- TRUE if it should do this automatically, FALSE otherwise.
-
setAutoNotify
public void setAutoNotify(boolean value)Set whether or not ProtocolLib should determine if a new version has been released.- Parameters:
value- - TRUE to do this automatically, FALSE otherwise.
-
isAutoDownload
public boolean isAutoDownload()Retrieve whether or not ProtocolLib should automatically download the new version.- Returns:
- TRUE if it should, FALSE otherwise.
-
setAutoDownload
public void setAutoDownload(boolean value)Set whether or not ProtocolLib should automatically download the new version.- Parameters:
value- - TRUE if it should. FALSE otherwise.
-
isDebug
public boolean isDebug()Determine whether or not debug mode is enabled.This grants access to the filter command.
- Returns:
- TRUE if it is, FALSE otherwise.
-
setDebug
public void setDebug(boolean value)Set whether or not debug mode is enabled.- Parameters:
value- - TRUE if it is enabled, FALSE otherwise.
-
getSuppressedReports
Retrieve an immutable list of every suppressed report type.- Returns:
- Every suppressed report type.
-
setSuppressedReports
Set the list of suppressed report types,- Parameters:
reports- - suppressed report types.
-
getAutoDelay
public long getAutoDelay()Retrieve the amount of time to wait until checking for a new update.- Returns:
- The amount of time to wait.
-
setAutoDelay
public void setAutoDelay(long delaySeconds)Set the amount of time to wait until checking for a new update.This time must be greater than 59 seconds.
- Parameters:
delaySeconds- - the amount of time to wait.
-
getIgnoreVersionCheck
The version of Minecraft to ignore the built-in safety feature.- Returns:
- The version to ignore ProtocolLib's satefy.
-
setIgnoreVersionCheck
Sets under which version of Minecraft the version safety feature will be ignored.This is useful if a server operator has tested and verified that a version of ProtocolLib works, but doesn't want or can't upgrade to a newer version.
- Parameters:
ignoreVersion- - the version of Minecraft where the satefy will be disabled.
-
isMetricsEnabled
public boolean isMetricsEnabled()Retrieve whether or not metrics is enabled.- Returns:
- TRUE if metrics is enabled, FALSE otherwise.
-
setMetricsEnabled
public void setMetricsEnabled(boolean enabled)Set whether or not metrics is enabled.This setting will take effect next time ProtocolLib is started.
- Parameters:
enabled- - whether or not metrics is enabled.
-
isBackgroundCompilerEnabled
public boolean isBackgroundCompilerEnabled()Retrieve whether or not the background compiler for structure modifiers is enabled or not.- Returns:
- TRUE if it is enabled, FALSE otherwise.
-
setBackgroundCompilerEnabled
public void setBackgroundCompilerEnabled(boolean enabled)Set whether or not the background compiler for structure modifiers is enabled or not.This setting will take effect next time ProtocolLib is started.
- Parameters:
enabled- - TRUE if is enabled/running, FALSE otherwise.
-
getAutoLastTime
public long getAutoLastTime()Retrieve the last time we updated, in seconds since 1970.01.01 00:00.- Returns:
- Last update time.
-
setAutoLastTime
public void setAutoLastTime(long lastTimeSeconds)Set the last time we updated, in seconds since 1970.01.01 00:00.Note that this is not considered to modify the configuration, so the modification count will not be incremented.
- Parameters:
lastTimeSeconds- - new last update time.
-
getScriptEngineName
Retrieve the unique name of the script engine to use for filtering.- Returns:
- Script engine to use.
-
setScriptEngineName
Set the unique name of the script engine to use for filtering.This setting will take effect next time ProtocolLib is started.
- Parameters:
name- - name of the script engine to use.
-
getDefaultMethod
Retrieve the default injection method.- Returns:
- Default method.
-
getInjectionMethod
Retrieve the injection method that has been set in the configuration, or use a default value.- Returns:
- Injection method to use.
- Throws:
IllegalArgumentException- If the configuration option is malformed.
-
setInjectionMethod
Set the starting injection method to use. -
getModificationCount
public int getModificationCount()Retrieve the number of modifications made to this configuration.- Returns:
- The number of modifications.
-
saveAll
public void saveAll()Save the current configuration file.
-