public abstract class PacketAbstract extends Object
Modifier and Type | Field and Description |
---|---|
protected org.inventivetalent.reflection.resolver.FieldResolver |
fieldResolver |
Constructor and Description |
---|
PacketAbstract(Object packet,
org.bukkit.event.Cancellable cancellable,
ChannelWrapper channelWrapper) |
PacketAbstract(Object packet,
org.bukkit.event.Cancellable cancellable,
org.bukkit.entity.Player player) |
Modifier and Type | Method and Description |
---|---|
ChannelWrapper<?> |
getChannel() |
org.inventivetalent.reflection.resolver.FieldResolver |
getFieldResolver() |
Object |
getPacket() |
String |
getPacketName() |
Object |
getPacketValue(int index)
Get a value of the packet
|
Object |
getPacketValue(String field)
Get a value of the packet
|
Object |
getPacketValueSilent(int index)
Get a value of the packet (without throwing an exception)
|
Object |
getPacketValueSilent(String field)
Get a value of the packet (without throwing an exception)
|
org.bukkit.entity.Player |
getPlayer() |
String |
getPlayername() |
boolean |
hasChannel() |
boolean |
hasPlayer() |
boolean |
isCancelled() |
void |
setCancelled(boolean b) |
void |
setPacket(Object packet)
Change the packet that is sent
|
void |
setPacketValue(int index,
Object value)
Modify a value of the packet
|
void |
setPacketValue(String field,
Object value)
Modify a value of the packet
|
void |
setPacketValueSilent(int index,
Object value)
Modify a value of the packet (without throwing an exception)
|
void |
setPacketValueSilent(String field,
Object value)
Modify a value of the packet (without throwing an exception)
|
String |
toString() |
protected org.inventivetalent.reflection.resolver.FieldResolver fieldResolver
public PacketAbstract(Object packet, org.bukkit.event.Cancellable cancellable, org.bukkit.entity.Player player)
public PacketAbstract(Object packet, org.bukkit.event.Cancellable cancellable, ChannelWrapper channelWrapper)
public void setPacketValue(String field, Object value)
field
- Name of the field to modifyvalue
- Value to be assigned to the fieldpublic void setPacketValueSilent(String field, Object value)
field
- Name of the field to modifyvalue
- Value to be assigned to the fieldpublic void setPacketValue(int index, Object value)
index
- field-index in the packet classvalue
- value to be assigned to the fieldpublic void setPacketValueSilent(int index, Object value)
index
- field-index in the packet classvalue
- value to be assigned to the fieldpublic Object getPacketValue(String field)
field
- Name of the fieldpublic Object getPacketValueSilent(String field)
field
- Name of the fieldpublic Object getPacketValue(int index)
index
- field-index in the packet classpublic Object getPacketValueSilent(int index)
index
- field-index in the packet classpublic org.inventivetalent.reflection.resolver.FieldResolver getFieldResolver()
public void setCancelled(boolean b)
b
- if set to true
the packet will be cancelledpublic boolean isCancelled()
true
if the packet has been cancelledpublic org.bukkit.entity.Player getPlayer()
hasPlayer()
,
getChannel()
public boolean hasPlayer()
true
if the packet has a playerpublic ChannelWrapper<?> getChannel()
ChannelWrapper
)hasChannel()
,
getPlayer()
public boolean hasChannel()
true
if the packet has a channelpublic String getPlayername()
hasPlayer()
,
getPlayer()
public void setPacket(Object packet)
packet
- new packetpublic Object getPacket()
public String getPacketName()
Copyright © 2021. All rights reserved.