Class ProtocolPacketEvent
java.lang.Object
com.github.retrooper.packetevents.event.PacketEvent
com.github.retrooper.packetevents.event.ProtocolPacketEvent
- All Implemented Interfaces:
CallableEvent
,CancellableEvent
,PlayerEvent
,UserEvent
- Direct Known Subclasses:
PacketReceiveEvent
,PacketSendEvent
public abstract class ProtocolPacketEvent
extends PacketEvent
implements PlayerEvent, CancellableEvent, UserEvent
-
Constructor Summary
ConstructorDescriptionProtocolPacketEvent
(int packetID, PacketTypeCommon packetType, ServerVersion serverVersion, Object channel, User user, Object player, Object byteBuf) ProtocolPacketEvent
(PacketSide packetSide, Object channel, User user, Object player, Object byteBuf, boolean autoProtocolTranslation) -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanUp()
clone()
Deprecated.@Nullable PacketWrapper
<?> int
Deprecated.<T> T
Associated player.WARNING: This doesn't support local addresses or unix sockets.getUser()
boolean
boolean
This method returns if the event will be cancelled.boolean
isClone()
void
markForReEncode
(boolean needsReEncode) boolean
void
setByteBuf
(Object byteBuf) void
setCancelled
(boolean val) Cancel or proceed with the event.void
setClientVersion
(@NotNull ClientVersion clientVersion) Deprecated.void
setLastUsedWrapper
(@Nullable PacketWrapper<?> lastUsedWrapper) void
setServerVersion
(@NotNull ServerVersion serverVersion) Methods inherited from class com.github.retrooper.packetevents.event.PacketEvent
callPacketEventExternal, getTimestamp
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.github.retrooper.packetevents.event.CallableEvent
call
-
Constructor Details
-
ProtocolPacketEvent
public ProtocolPacketEvent(PacketSide packetSide, Object channel, User user, Object player, Object byteBuf, boolean autoProtocolTranslation) throws PacketProcessException - Throws:
PacketProcessException
-
ProtocolPacketEvent
public ProtocolPacketEvent(int packetID, PacketTypeCommon packetType, ServerVersion serverVersion, Object channel, User user, Object player, Object byteBuf)
-
-
Method Details
-
markForReEncode
public void markForReEncode(boolean needsReEncode) -
needsReEncode
public boolean needsReEncode() -
isClone
public boolean isClone() -
getChannel
-
getAddress
-
getSocketAddress
WARNING: This doesn't support local addresses or unix sockets. -
getUser
-
getPlayer
public <T> T getPlayer()Description copied from interface:PlayerEvent
Associated player.- Specified by:
getPlayer
in interfacePlayerEvent
- Returns:
- Player.
-
getConnectionState
-
getClientVersion
Deprecated. -
setClientVersion
Deprecated. -
getServerVersion
-
setServerVersion
-
getByteBuf
-
setByteBuf
-
getPacketId
public int getPacketId() -
getPacketType
-
getPacketName
Deprecated. -
isCancelled
public boolean isCancelled()Description copied from interface:CancellableEvent
This method returns if the event will be cancelled.- Specified by:
isCancelled
in interfaceCancellableEvent
- Returns:
- Will the event be cancelled.
-
setCancelled
public void setCancelled(boolean val) Description copied from interface:CancellableEvent
Cancel or proceed with the event.- Specified by:
setCancelled
in interfaceCancellableEvent
- Parameters:
val
- Is the event cancelled
-
getLastUsedWrapper
-
setLastUsedWrapper
-
getPostTasks
-
hasPostTasks
public boolean hasPostTasks() -
clone
-
cleanUp
public void cleanUp() -
getFullBufferClone
-