Package com.comphenix.protocol
Class ProtocolConfig
java.lang.Object
com.comphenix.protocol.ProtocolConfig
Represents the configuration of ProtocolLib.
-
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.getFile()Retrieve a reference to the configuration file.The version of Minecraft to ignore the built-in safety feature.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.booleanPrint warnings to players with protocol.infobooleanisDebug()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.voidsetAutoLastTime(long lastTimeSeconds) Set the last time we updated, in seconds since 1970.01.01 00:00.voidsetDebug(boolean value) Set whether or not debug mode is enabled.voidsetScriptEngineName(String name) Set the unique name of the script engine to use for filtering.
-
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.
-
isChatWarnings
public boolean isChatWarnings()Print warnings to players with protocol.info- Returns:
- true if enabled, false if not
-
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.
-
isAutoDownload
public boolean isAutoDownload()Retrieve whether or not ProtocolLib should automatically download the new version.- Returns:
- 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.
-
getAutoDelay
public long getAutoDelay()Retrieve the amount of time to wait until checking for a new update.- Returns:
- 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.
-
isMetricsEnabled
public boolean isMetricsEnabled()Retrieve whether or not metrics is enabled.- Returns:
- TRUE if metrics is enabled, 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.
-
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.
-