Class PacketEventsSettings

java.lang.Object
com.github.retrooper.packetevents.settings.PacketEventsSettings

public class PacketEventsSettings extends Object
Packet Events' settings.
Since:
1.5.8
  • Constructor Details

    • PacketEventsSettings

      public PacketEventsSettings()
  • Method Details

    • timeStampMode

      @Internal public PacketEventsSettings timeStampMode(TimeStampMode timeStampMode)
      Time stamp mode. How precise should the timestamps in the events be.
      Parameters:
      timeStampMode - Time Stamp mode
      Returns:
      Settings instance
    • reEncodeByDefault

      @Internal public PacketEventsSettings reEncodeByDefault(boolean reEncodeByDefault)
      Do we re-encode all packets by default?
      Parameters:
      reEncodeByDefault - Value
      Returns:
      Settings instance
    • checkForUpdates

      @Internal public PacketEventsSettings checkForUpdates(boolean checkForUpdates)
      This decides if PacketEvents should check for updates and notify when your server starts.
      Parameters:
      checkForUpdates - Value
      Returns:
      Settings instance.
    • downsampleColors

      @Internal public PacketEventsSettings downsampleColors(boolean downsampleColors)
      This decides if PacketEvents should downsample RGB colors on pre-1.16 servers.
      Parameters:
      downsampleColors - Value
      Returns:
      Settings instance.
    • bStats

      @Deprecated public PacketEventsSettings bStats(boolean bStatsEnabled)
      Deprecated.
      This method has been deprecated. To disable bStats use the config file found in the bStats folder.
      This used to decide if PacketEvents should collect data anonymously and report to bStats.
      Parameters:
      bStatsEnabled - Value
      Returns:
      Settings instance.
    • debug

      @Internal public PacketEventsSettings debug(boolean debugEnabled)
      This decides if PacketEvents should spam debug messages
      Parameters:
      debugEnabled - Value
      Returns:
      Settings instance.
    • fullStackTrace

      @Internal public PacketEventsSettings fullStackTrace(boolean fullStackTraceEnabled)
      This decides if PacketEvents should print packets error stacktrace
      Parameters:
      fullStackTraceEnabled - Value
      Returns:
      Settings instance.
    • kickOnPacketException

      @Internal public PacketEventsSettings kickOnPacketException(boolean kickOnPacketExceptionEnabled)
      This decides if PacketEvents should kick the player in case a packet exception occurs.
      Parameters:
      kickOnPacketExceptionEnabled - Value
      Returns:
      Settings instance.
    • kickIfTerminated

      @Internal public PacketEventsSettings kickIfTerminated(boolean kickIfTerminated)
      This decides if PacketEvents should kick the player on join if PacketEvents is terminated.
      Parameters:
      kickIfTerminated - Value
      Returns:
      Settings instance.
    • customResourceProvider

      @Internal public PacketEventsSettings customResourceProvider(Function<String,InputStream> resourceProvider)
      Some projects may want to implement a CDN with resources like asset mappings By default, all resources are retrieved from the ClassLoader
      Parameters:
      resourceProvider - Function
      Returns:
      Settings instance.
    • reEncodeByDefault

      public boolean reEncodeByDefault()
      Should the packet listeners be read only?
      Returns:
      Getter for defaultReencode
    • shouldCheckForUpdates

      public boolean shouldCheckForUpdates()
      Should we check for updates?
      Returns:
      Getter for checkForUpdates
    • shouldDownsampleColors

      public boolean shouldDownsampleColors()
      Should we downsample RGB colors on pre-1.16 servers?
      Returns:
      Getter for downsampleColors
    • isbStatsEnabled

      @Deprecated public boolean isbStatsEnabled()
      Deprecated.
      This method has been deprecated, because the setter has been removed. Disabling bStats is now done through the bStats config file.
      Should we collect server data anonymously and report to bStats?
      Returns:
      Getter for bStatsEnabled
    • isDebugEnabled

      public boolean isDebugEnabled()
      Should packetevents send debug Messages to the console?
      Returns:
      Getter for debugEnabled
    • isFullStackTraceEnabled

      public boolean isFullStackTraceEnabled()
      Should packetevents send packet exception Stacktraces to the console?
      Returns:
      Getter for fullStackTrace(boolean)
    • isKickOnPacketExceptionEnabled

      public boolean isKickOnPacketExceptionEnabled()
      Should packetevents kick the player due to an packet exception?
      Returns:
      Getter for kickOnPacketException(boolean)
    • isKickIfTerminated

      public boolean isKickIfTerminated()
      Should packetevents kick the player on join if PacketEvents is terminated?
      Returns:
      Getter for kickIfTerminated
    • getResourceProvider

      public Function<String,InputStream> getResourceProvider()
      As described above, this method retrieves the function that acquires the InputStream of a desired resource by its path.
      Returns:
      Getter for resourceProvider
    • getTimeStampMode

      public TimeStampMode getTimeStampMode()
      Get the timestamp mode
      Returns:
      Time Stamp Mode