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

      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
    • getTimeStampMode

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

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

      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

      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

      public PacketEventsSettings bStats(boolean bStatsEnabled)
      This decides if PacketEvents should collect data anonymously and report to bStats.
      Parameters:
      bStatsEnabled - Value
      Returns:
      Settings instance.
    • debug

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

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

      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.
    • customResourceProvider

      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

      public boolean isbStatsEnabled()
      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)
    • 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