public abstract class AbstractPacket extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
cancel |
protected PacketContent |
content |
protected Object |
nmsPacket |
protected NPacket |
nPacket |
protected Player |
player |
Constructor and Description |
---|
AbstractPacket(Object nmsPacket,
NPacket nPacket,
Player player) |
Modifier and Type | Method and Description |
---|---|
PacketContent |
getContent()
Get the packet content without using NMS
And so, compatible with all version.
|
Object |
getNmsPacket()
Get the NMS packet
|
NPacket |
getPacket()
Get the Negativity Packet which correspond to the NMS one
|
String |
getPacketName()
Get the name of the packet
|
PacketType |
getPacketType()
Get the packet type.
|
Player |
getPlayer()
Get the player concerned by the packet.
|
String |
getPlayername()
Get the name of the player
|
boolean |
hasPlayer()
Check if the given player exist
|
boolean |
isCancelled()
Know if the packet is cancelled.
|
void |
setCancelled(boolean cancel)
Set if the packet is cancelled
|
void |
setNmsPacket(Object nmsPacket)
Change the given NMS packet
|
protected final Player player
protected Object nmsPacket
protected PacketContent content
protected final NPacket nPacket
protected boolean cancel
public Player getPlayer()
public boolean hasPlayer()
public String getPlayername()
public Object getNmsPacket()
public void setNmsPacket(Object nmsPacket)
nmsPacket
- the next packetpublic NPacket getPacket()
public String getPacketName()
public PacketType getPacketType()
public boolean isCancelled()
public void setCancelled(boolean cancel)
public PacketContent getContent()