Class DownstreamPacketReceiveEvent<T extends com.github.steveice10.packetlib.packet.Packet>
java.lang.Object
org.geysermc.geyser.event.GeyserEvent
org.geysermc.geyser.event.events.packet.DownstreamPacketReceiveEvent<T>
- All Implemented Interfaces:
Cancellable,EventSession
- Direct Known Subclasses:
ClientboundChatPacket,ClientboundPongResponsePacket,ClientboundStatusResponsePacket,ServerboundPingRequestPacket,ServerboundStatusRequestPacket
public abstract class DownstreamPacketReceiveEvent<T extends com.github.steveice10.packetlib.packet.Packet>
extends GeyserEvent
implements Cancellable, EventSession
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanDownstream packet@NonNull GeyserSessionReturn theGeyserSessionfor this EventinthashCode()booleanReturns true if the event has been cancelledstatic <T extends com.github.steveice10.packetlib.packet.Packet>
DownstreamPacketReceiveEvent<T>of(GeyserSession session, T packet)Create a new DownstreamPacketReceiveEvent based on the packet typevoidsetCancelled(boolean cancelled)Set if an event is cancelledvoidDownstream packettoString()
-
Constructor Details
-
DownstreamPacketReceiveEvent
-
-
Method Details
-
of
public static <T extends com.github.steveice10.packetlib.packet.Packet> DownstreamPacketReceiveEvent<T> of(GeyserSession session, T packet)Create a new DownstreamPacketReceiveEvent based on the packet type- Parameters:
session- player sessionpacket- the packet to wrap- Returns:
- an instantiated class that inherits from this one
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableReturns true if the event has been cancelled- Specified by:
isCancelledin interfaceCancellable- Returns:
- True if cancelled
-
getSession
Description copied from interface:EventSessionReturn theGeyserSessionfor this Event- Specified by:
getSessionin interfaceEventSession- Returns:
- the current session
-
getPacket
Downstream packet- Returns:
- get the current downstream packet
-
setCancelled
public void setCancelled(boolean cancelled)Description copied from interface:CancellableSet if an event is cancelled- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancelled- True if event should be cancelled.
-
setPacket
Downstream packet- Parameters:
packet- set the downstream packet
-
toString
- Overrides:
toStringin classGeyserEvent
-
equals
- Overrides:
equalsin classGeyserEvent
-
canEqual
- Overrides:
canEqualin classGeyserEvent
-
hashCode
public int hashCode()- Overrides:
hashCodein classGeyserEvent
-