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
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
Downstream packet@NonNull GeyserSession
Return theGeyserSession
for this Eventint
hashCode()
boolean
Returns 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 typevoid
setCancelled(boolean cancelled)
Set if an event is cancelledvoid
Downstream 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:Cancellable
Returns true if the event has been cancelled- Specified by:
isCancelled
in interfaceCancellable
- Returns:
- True if cancelled
-
getSession
Description copied from interface:EventSession
Return theGeyserSession
for this Event- Specified by:
getSession
in interfaceEventSession
- Returns:
- the current session
-
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 interfaceCancellable
- Parameters:
cancelled
- True if event should be cancelled.
-
setPacket
Downstream packet- Parameters:
packet
- set the downstream packet
-
toString
- Overrides:
toString
in classGeyserEvent
-
equals
- Overrides:
equals
in classGeyserEvent
-
canEqual
- Overrides:
canEqual
in classGeyserEvent
-
hashCode
public int hashCode()- Overrides:
hashCode
in classGeyserEvent
-