Class SessionAcceptCodeOfConductEvent

java.lang.Object
org.geysermc.geyser.api.event.connection.ConnectionEvent
org.geysermc.geyser.api.event.bedrock.SessionAcceptCodeOfConductEvent
All Implemented Interfaces:
org.geysermc.event.Event

public class SessionAcceptCodeOfConductEvent extends ConnectionEvent
Fired when a player accepts a code of conduct sent by the Java server. API users can listen to this event to store the acceptance in a cache, and tell Geyser not to do so.

Java clients cache acceptance locally, but bedrock clients don't. Normally Geyser uses a simple JSON file to implement this, but an alternative solution may be preferred when using multiple Geyser instances. Such a solution can be implemented through this event and ServerCodeOfConductEvent.

Since:
2.9.0
See Also:
  • Constructor Details

    • SessionAcceptCodeOfConductEvent

      public SessionAcceptCodeOfConductEvent(@NonNull GeyserConnection connection, String codeOfConduct)
  • Method Details

    • codeOfConduct

      public String codeOfConduct()
      Returns:
      the code of conduct sent by the server
      Since:
      2.9.0
    • shouldSkipSaving

      public boolean shouldSkipSaving()
      Returns:
      true if Geyser should not save the acceptance of the code of conduct in its own cache (through a JSON file), because it was saved elsewhere
      Since:
      2.9.0
    • skipSaving

      public void skipSaving()
      Sets shouldSkipSaving() to true.
      Since:
      2.9.0