Class ProtocolConfig

java.lang.Object
com.comphenix.protocol.ProtocolConfig

public class ProtocolConfig extends Object
Represents the configuration of ProtocolLib.
Author:
Kristian
  • Constructor Details

    • ProtocolConfig

      public ProtocolConfig(org.bukkit.plugin.Plugin plugin)
  • Method Details

    • reloadConfig

      public void reloadConfig()
      Reload configuration file.
    • getFile

      public 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

      public com.google.common.collect.ImmutableList<String> getSuppressedReports()
      Retrieve an immutable list of every suppressed report type.
      Returns:
      Every suppressed report type.
    • setSuppressedReports

      public void setSuppressedReports(List<String> reports)
      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

      public String getIgnoreVersionCheck()
      The version of Minecraft to ignore the built-in safety feature.
      Returns:
      The version to ignore ProtocolLib's satefy.
    • setIgnoreVersionCheck

      public void setIgnoreVersionCheck(String ignoreVersion)
      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

      public String getScriptEngineName()
      Retrieve the unique name of the script engine to use for filtering.
      Returns:
      Script engine to use.
    • setScriptEngineName

      public void setScriptEngineName(String name)
      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

      public PlayerInjectHooks getDefaultMethod()
      Retrieve the default injection method.
      Returns:
      Default method.
    • getInjectionMethod

      public PlayerInjectHooks getInjectionMethod() throws IllegalArgumentException
      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

      public void setInjectionMethod(PlayerInjectHooks hook)
      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.