Class DownstreamPacketSendEvent<T extends com.github.steveice10.packetlib.packet.Packet>

java.lang.Object
org.geysermc.geyser.event.GeyserEvent
org.geysermc.geyser.event.events.packet.DownstreamPacketSendEvent<T>
All Implemented Interfaces:
Cancellable, EventSession
Direct Known Subclasses:
ServerboundBlockEntityTagQuery, ServerboundChatPacket, ServerboundContainerButtonClickPacket, ServerboundContainerClosePacket, ServerboundCustomPayloadPacket, ServerboundSeenAdvancementsPacket, ServerboundSetCreativeModeSlotPacket

public abstract class DownstreamPacketSendEvent<T extends com.github.steveice10.packetlib.packet.Packet> extends GeyserEvent implements Cancellable, EventSession
  • Constructor Details

    • DownstreamPacketSendEvent

      public DownstreamPacketSendEvent(@NonNull @NonNull GeyserSession session, @NonNull T packet)
  • Method Details

    • of

      public static <T extends com.github.steveice10.packetlib.packet.Packet> DownstreamPacketSendEvent<T> of(GeyserSession session, T packet)
      Create a new DownstreamPacketSendEvent based on the packet type
      Parameters:
      session - player session
      packet - the packet to wrap
      Returns:
      an instantiated class that inherits from this one
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: Cancellable
      Returns true if the event has been cancelled
      Specified by:
      isCancelled in interface Cancellable
      Returns:
      True if cancelled
    • getSession

      @NonNull public @NonNull GeyserSession getSession()
      Description copied from interface: EventSession
      Return the GeyserSession for this Event
      Specified by:
      getSession in interface EventSession
      Returns:
      the current session
    • getPacket

      @NonNull public T getPacket()
      Downstream packet
      Returns:
      get the current downstream packet
    • setCancelled

      public void setCancelled(boolean cancelled)
      Description copied from interface: Cancellable
      Set if an event is cancelled
      Specified by:
      setCancelled in interface Cancellable
      Parameters:
      cancelled - True if event should be cancelled.
    • setPacket

      public void setPacket(@NonNull T packet)
      Downstream packet
      Parameters:
      packet - set the downstream packet
    • toString

      public String toString()
      Overrides:
      toString in class GeyserEvent
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class GeyserEvent
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class GeyserEvent
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class GeyserEvent