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 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>
DownstreamPacketSendEvent<T>of(GeyserSession session, T packet)
Create a new DownstreamPacketSendEvent based on the packet typevoid
setCancelled(boolean cancelled)
Set if an event is cancelledvoid
Downstream packettoString()
-
Constructor Details
-
DownstreamPacketSendEvent
-
-
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 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
-