diff --git a/Javadoc/allclasses-frame.html b/Javadoc/allclasses-frame.html new file mode 100644 index 00000000..0dd5370c --- /dev/null +++ b/Javadoc/allclasses-frame.html @@ -0,0 +1,54 @@ + + + +
+ +public class Application
+extends java.lang.Object
+Constructor and Description | +
---|
Application() |
+
Modifier and Type | +Field and Description | +
---|---|
static int |
+ABILITIES |
+
static int |
+ARM_ANIMATION |
+
static int |
+BLOCK_DIG |
+
static int |
+BLOCK_ITEM_SWITCH |
+
static int |
+BUTTON_CLICK |
+
static int |
+CHAT |
+
static int |
+CLIENT_COMMAND |
+
static int |
+CLOSE_WINDOW |
+
static int |
+CUSTOM_PAYLOAD |
+
static int |
+ENTITY_ACTION |
+
static int |
+FLYING |
+
static int |
+GET_INFO |
+
static int |
+HANDSHAKE |
+
static int |
+KEEP_ALIVE |
+
static int |
+KEY_RESPONSE |
+
static int |
+KICK_DISCONNECT |
+
static int |
+LOCALE_AND_VIEW_DISTANCE |
+
static int |
+LOGIN |
+
static int |
+PLACE |
+
static int |
+PLAYER_LOOK |
+
static int |
+PLAYER_LOOK_MOVE |
+
static int |
+PLAYER_POSITION |
+
static int |
+RESPAWN |
+
static int |
+SET_CREATIVE_SLOT |
+
static int |
+TAB_COMPLETE |
+
static int |
+TRANSACTION |
+
static int |
+UPDATE_SIGN |
+
static int |
+USE_ENTITY |
+
static int |
+WINDOW_CLICK |
+
Modifier and Type | +Method and Description | +
---|---|
static Packets.Client |
+getRegistry()
+A registry that parses between names and packet IDs.
+ |
+
getDeclaredName, hasMember, registerAll, registerMember, valueOf
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final int KEEP_ALIVE+
public static final int LOGIN+
public static final int HANDSHAKE+
public static final int CHAT+
public static final int USE_ENTITY+
public static final int RESPAWN+
public static final int FLYING+
public static final int PLAYER_POSITION+
public static final int PLAYER_LOOK+
public static final int PLAYER_LOOK_MOVE+
public static final int BLOCK_DIG+
public static final int PLACE+
public static final int BLOCK_ITEM_SWITCH+
public static final int ARM_ANIMATION+
public static final int ENTITY_ACTION+
public static final int CLOSE_WINDOW+
public static final int WINDOW_CLICK+
public static final int TRANSACTION+
public static final int SET_CREATIVE_SLOT+
public static final int BUTTON_CLICK+
public static final int UPDATE_SIGN+
public static final int ABILITIES+
public static final int TAB_COMPLETE+
public static final int LOCALE_AND_VIEW_DISTANCE+
public static final int CLIENT_COMMAND+
public static final int CUSTOM_PAYLOAD+
public static final int KEY_RESPONSE+
public static final int GET_INFO+
public static final int KICK_DISCONNECT+
public static Packets.Client getRegistry()+
Modifier and Type | +Field and Description | +
---|---|
static int |
+ABILITIES |
+
static int |
+ADD_EXP_ORB |
+
static int |
+ARM_ANIMATION |
+
static int |
+ATTACH_ENTITY |
+
static int |
+BED |
+
static int |
+BLOCK_BREAK_ANIMATION |
+
static int |
+BLOCK_CHANGE |
+
static int |
+CHAT |
+
static int |
+CLOSE_WINDOW |
+
static int |
+COLLECT |
+
static int |
+CRAFT_PROGRESS_BAR |
+
static int |
+CUSTOM_PAYLOAD |
+
static int |
+DESTROY_ENTITY |
+
static int |
+ENTITY |
+
static int |
+ENTITY_EQUIPMENT |
+
static int |
+ENTITY_HEAD_ROTATION |
+
static int |
+ENTITY_LOCATION_ACTION |
+
static int |
+ENTITY_LOOK |
+
static int |
+ENTITY_METADATA |
+
static int |
+ENTITY_PAINTING |
+
static int |
+ENTITY_STATUS |
+
static int |
+ENTITY_TELEPORT |
+
static int |
+ENTITY_VELOCITY |
+
static int |
+EXPLOSION |
+
static int |
+FLYING |
+
static int |
+ITEM_DATA |
+
static int |
+KEEP_ALIVE |
+
static int |
+KEY_REQUEST |
+
static int |
+KEY_RESPONSE |
+
static int |
+KICK_DISCONNECT |
+
static int |
+LOGIN |
+
static int |
+MAP_CHUNK |
+
static int |
+MAP_CHUNK_BULK |
+
static int |
+MOB_EFFECT |
+
static int |
+MOB_SPAWN |
+
static int |
+MULTI_BLOCK_CHANGE |
+
static int |
+NAMED_ENTITY_SPAWN |
+
static int |
+NAMED_SOUND_EFFECT |
+
static int |
+OPEN_WINDOW |
+
static int |
+PICKUP_SPAWN |
+
static int |
+PLAY_NOTE_BLOCK |
+
static int |
+PLAYER_INFO |
+
static int |
+PLAYER_LOOK |
+
static int |
+PLAYER_LOOK_MOVE |
+
static int |
+PLAYER_POSITION |
+
static int |
+REL_ENTITY_MOVE |
+
static int |
+REL_ENTITY_MOVE_LOOK |
+
static int |
+REMOVE_MOB_EFFECT |
+
static int |
+RESPAWN |
+
static int |
+SET_CREATIVE_SLOT |
+
static int |
+SET_EXPERIENCE |
+
static int |
+SET_SLOT |
+
static int |
+SPAWN_POSITION |
+
static int |
+STATISTIC |
+
static int |
+TAB_COMPLETE |
+
static int |
+TILE_ENTITY_DATA |
+
static int |
+TRANSACTION |
+
static int |
+UPDATE_HEALTH |
+
static int |
+UPDATE_SIGN |
+
static int |
+UPDATE_TIME |
+
static int |
+VEHICLE_SPAWN |
+
static int |
+WEATHER |
+
static int |
+WINDOW_ITEMS |
+
static int |
+WORLD_EVENT |
+
Modifier and Type | +Method and Description | +
---|---|
static Packets.Server |
+getRegistry()
+A registry that parses between names and packet IDs.
+ |
+
getDeclaredName, hasMember, registerAll, registerMember, valueOf
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final int KEEP_ALIVE+
public static final int LOGIN+
public static final int CHAT+
public static final int UPDATE_TIME+
public static final int ENTITY_EQUIPMENT+
public static final int SPAWN_POSITION+
public static final int UPDATE_HEALTH+
public static final int RESPAWN+
public static final int FLYING+
public static final int PLAYER_POSITION+
public static final int PLAYER_LOOK+
public static final int PLAYER_LOOK_MOVE+
public static final int ENTITY_LOCATION_ACTION+
public static final int ARM_ANIMATION+
public static final int NAMED_ENTITY_SPAWN+
public static final int PICKUP_SPAWN+
public static final int COLLECT+
public static final int VEHICLE_SPAWN+
public static final int MOB_SPAWN+
public static final int ENTITY_PAINTING+
public static final int ADD_EXP_ORB+
public static final int ENTITY_VELOCITY+
public static final int DESTROY_ENTITY+
public static final int ENTITY+
public static final int REL_ENTITY_MOVE+
public static final int ENTITY_LOOK+
public static final int REL_ENTITY_MOVE_LOOK+
public static final int ENTITY_TELEPORT+
public static final int ENTITY_HEAD_ROTATION+
public static final int ENTITY_STATUS+
public static final int ATTACH_ENTITY+
public static final int ENTITY_METADATA+
public static final int MOB_EFFECT+
public static final int REMOVE_MOB_EFFECT+
public static final int SET_EXPERIENCE+
public static final int MAP_CHUNK+
public static final int MULTI_BLOCK_CHANGE+
public static final int BLOCK_CHANGE+
public static final int PLAY_NOTE_BLOCK+
public static final int BLOCK_BREAK_ANIMATION+
public static final int MAP_CHUNK_BULK+
public static final int EXPLOSION+
public static final int WORLD_EVENT+
public static final int NAMED_SOUND_EFFECT+
public static final int BED+
public static final int WEATHER+
public static final int OPEN_WINDOW+
public static final int CLOSE_WINDOW+
public static final int SET_SLOT+
public static final int WINDOW_ITEMS+
public static final int CRAFT_PROGRESS_BAR+
public static final int TRANSACTION+
public static final int SET_CREATIVE_SLOT+
public static final int UPDATE_SIGN+
public static final int ITEM_DATA+
public static final int TILE_ENTITY_DATA+
public static final int STATISTIC+
public static final int PLAYER_INFO+
public static final int ABILITIES+
public static final int TAB_COMPLETE+
public static final int CUSTOM_PAYLOAD+
public static final int KEY_RESPONSE+
public static final int KEY_REQUEST+
public static final int KICK_DISCONNECT+
public static Packets.Server getRegistry()+
public final class Packets
+extends java.lang.Object
+Modifier and Type | +Class and Description | +
---|---|
static class |
+Packets.Client
+List of packets sent by the client.
+ |
+
static class |
+Packets.Server
+List of packets sent only by the server.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static Packets.Client |
+getClientRegistry()
+A registry that parses between names and packet IDs.
+ |
+
static java.lang.String |
+getDeclaredName(int packetID)
+Retrieves the name of a packet.
+ |
+
static Packets.Server |
+getServerRegistry()
+A registry that parses between names and packet IDs.
+ |
+
static int |
+valueOf(java.lang.String name)
+Find a packet by name.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static Packets.Server getServerRegistry()+
public static Packets.Client getClientRegistry()+
public static int valueOf(java.lang.String name)+
name
- - name of packet to find.public static java.lang.String getDeclaredName(int packetID)+
packetID
- - packet to retrieve name.public class ProtocolLibrary
+extends org.bukkit.plugin.java.JavaPlugin
+Constructor and Description | +
---|
ProtocolLibrary() |
+
Modifier and Type | +Method and Description | +
---|---|
static ProtocolManager |
+getProtocolManager()
+Retrieves the packet protocol manager.
+ |
+
Statistics |
+getStatistics()
+Retrieve the metrics instance used to measure users of this library.
+ |
+
void |
+onDisable() |
+
void |
+onEnable() |
+
void |
+onLoad() |
+
getClassLoader, getCommand, getConfig, getDatabase, getDatabaseClasses, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPluginLoader, getResource, getServer, initialize, installDDL, isEnabled, isInitialized, isNaggable, onCommand, reloadConfig, removeDDL, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toString
equals, getName, hashCode
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public void onLoad()+
onLoad
in interface org.bukkit.plugin.Plugin
onLoad
in class org.bukkit.plugin.java.JavaPlugin
public void onEnable()+
onEnable
in interface org.bukkit.plugin.Plugin
onEnable
in class org.bukkit.plugin.java.JavaPlugin
public void onDisable()+
onDisable
in interface org.bukkit.plugin.Plugin
onDisable
in class org.bukkit.plugin.java.JavaPlugin
public static ProtocolManager getProtocolManager()+
public Statistics getStatistics()+
+ Note that this method may return NULL when the server is reloading or shutting down.
public interface ProtocolManager
+Modifier and Type | +Method and Description | +
---|---|
void |
+addPacketListener(PacketListener listener)
+Adds a packet listener.
+ |
+
PacketContainer |
+createPacket(int id)
+Constructs a new encapsulated Minecraft packet with the given ID.
+ |
+
PacketContainer |
+createPacket(int id,
+ boolean forceDefaults)
+Constructs a new encapsulated Minecraft packet with the given ID.
+ |
+
PacketConstructor |
+createPacketConstructor(int id,
+ java.lang.Object... arguments)
+Construct a packet using the special builtin Minecraft constructors.
+ |
+
com.google.common.collect.ImmutableSet<PacketListener> |
+getPacketListeners()
+Retrieves a list of every registered packet listener.
+ |
+
java.util.Set<java.lang.Integer> |
+getReceivingFilters()
+Retrieves a immutable set containing the ID of the recieved client packets that will be observed by listeners.
+ |
+
java.util.Set<java.lang.Integer> |
+getSendingFilters()
+Retrieves a immutable set containing the ID of the sent server packets that will be observed by listeners.
+ |
+
boolean |
+isClosed()
+Determines whether or not this protocol mananger has been disabled.
+ |
+
void |
+recieveClientPacket(org.bukkit.entity.Player sender,
+ PacketContainer packet)
+Simulate recieving a certain packet from a given player.
+ |
+
void |
+recieveClientPacket(org.bukkit.entity.Player sender,
+ PacketContainer packet,
+ boolean filters)
+Simulate recieving a certain packet from a given player.
+ |
+
void |
+removePacketListener(PacketListener listener)
+Removes a given packet listener.
+ |
+
void |
+removePacketListeners(org.bukkit.plugin.Plugin plugin)
+Removes every listener associated with the given plugin.
+ |
+
void |
+sendServerPacket(org.bukkit.entity.Player reciever,
+ PacketContainer packet)
+Send a packet to the given player.
+ |
+
void |
+sendServerPacket(org.bukkit.entity.Player reciever,
+ PacketContainer packet,
+ boolean filters)
+Send a packet to the given player.
+ |
+
void |
+updateEntity(org.bukkit.entity.Entity entity,
+ java.util.List<org.bukkit.entity.Player> observers)
+Completely refresh all clients about an entity.
+ |
+
com.google.common.collect.ImmutableSet<PacketListener> getPacketListeners()+
void addPacketListener(PacketListener listener)+
+ Adding an already registered listener has no effect. If you need to change the packets + the current listener is observing, you must first remove the packet listener before you + can register it again.
listener
- - new packet listener.void removePacketListener(PacketListener listener)+
+ Attempting to remove a listener that doesn't exist has no effect.
listener
- - the packet listener to remove.void removePacketListeners(org.bukkit.plugin.Plugin plugin)+
plugin
- - the plugin to unload.void sendServerPacket(org.bukkit.entity.Player reciever, + PacketContainer packet) + throws java.lang.reflect.InvocationTargetException+
reciever
- - the reciever.packet
- - packet to send.java.lang.reflect.InvocationTargetException
- - if an error occured when sending the packet.void sendServerPacket(org.bukkit.entity.Player reciever, + PacketContainer packet, + boolean filters) + throws java.lang.reflect.InvocationTargetException+
reciever
- - the reciever.packet
- - packet to send.filters
- - whether or not to invoke any packet filters.java.lang.reflect.InvocationTargetException
- - if an error occured when sending the packet.void recieveClientPacket(org.bukkit.entity.Player sender, + PacketContainer packet) + throws java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
sender
- - the sender.packet
- - the packet that was sent.java.lang.reflect.InvocationTargetException
- If the reflection machinery failed.java.lang.IllegalAccessException
- If the underlying method caused an error.void recieveClientPacket(org.bukkit.entity.Player sender, + PacketContainer packet, + boolean filters) + throws java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
sender
- - the sender.packet
- - the packet that was sent.filters
- - whether or not to invoke any packet filters.java.lang.reflect.InvocationTargetException
- If the reflection machinery failed.java.lang.IllegalAccessException
- If the underlying method caused an error.PacketContainer createPacket(int id)+
id
- - packet ID.PacketContainer createPacket(int id, + boolean forceDefaults)+
+ If set to true, the forceDefaults option will force the system to automatically + give non-primitive fields in the packet sensible default values. For instance, certain + packets - like Packet60Explosion - require a List or Set to be non-null. If the + forceDefaults option is true, the List or Set will be automatically created.
id
- - packet ID.forceDefaults
- - TRUE to use sensible defaults in most fields, FALSE otherwise.PacketConstructor createPacketConstructor(int id, + java.lang.Object... arguments)+
id
- - the packet ID.arguments
- - arguments that will be passed to the constructor.void updateEntity(org.bukkit.entity.Entity entity, + java.util.List<org.bukkit.entity.Player> observers) + throws FieldAccessException+
entity
- - entity to refresh.observers
- - the clients to update.FieldAccessException
java.util.Set<java.lang.Integer> getSendingFilters()+
java.util.Set<java.lang.Integer> getReceivingFilters()+
boolean isClosed()+
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
Modifier and Type | +Method and Description | +
---|---|
static Packets.Client |
+Packets.getClientRegistry()
+A registry that parses between names and packet IDs.
+ |
+
static Packets.Client |
+Packets.Client.getRegistry()
+A registry that parses between names and packet IDs.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
Modifier and Type | +Method and Description | +
---|---|
static Packets.Server |
+Packets.Server.getRegistry()
+A registry that parses between names and packet IDs.
+ |
+
static Packets.Server |
+Packets.getServerRegistry()
+A registry that parses between names and packet IDs.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
com.comphenix.protocol.injector | ++ |
Modifier and Type | +Method and Description | +
---|---|
static ProtocolManager |
+ProtocolLibrary.getProtocolManager()
+Retrieves the packet protocol manager.
+ |
+
Modifier and Type | +Class and Description | +
---|---|
class |
+PacketFilterManager |
+
T
- - type of the elements in the list.public class SortedCopyOnWriteArray<T extends java.lang.Comparable<T>>
+extends java.lang.Object
+implements java.lang.Iterable<T>, java.util.Collection<T>
+Constructor and Description | +
---|
SortedCopyOnWriteArray()
+Construct an empty sorted array.
+ |
+
SortedCopyOnWriteArray(java.util.Collection<T> wrapped)
+Create a sorted array from the given list.
+ |
+
SortedCopyOnWriteArray(java.util.Collection<T> wrapped,
+ boolean sort)
+Create a sorted array from the given list.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+add(T value)
+Inserts the given element in the proper location.
+ |
+
boolean |
+addAll(java.util.Collection<? extends T> values) |
+
void |
+clear() |
+
boolean |
+contains(java.lang.Object value) |
+
boolean |
+containsAll(java.util.Collection<?> values) |
+
T |
+get(int index)
+Retrieves an element by index.
+ |
+
boolean |
+isEmpty() |
+
java.util.Iterator<T> |
+iterator()
+Retrieves an iterator over the elements in the given list.
+ |
+
void |
+remove(int index)
+Removes from the list by making a copy of every element except the one with the given index.
+ |
+
boolean |
+remove(java.lang.Object value)
+Removes from the list by making a new list with every element except the one given.
+ |
+
boolean |
+removeAll(java.util.Collection<?> values) |
+
boolean |
+retainAll(java.util.Collection<?> values) |
+
int |
+size()
+Retrieve the size of the list.
+ |
+
java.lang.Object[] |
+toArray() |
+
<T> T[] |
+toArray(T[] a) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode
public SortedCopyOnWriteArray()+
public SortedCopyOnWriteArray(java.util.Collection<T> wrapped)+
wrapped
- - the collection whose elements are to be placed into the list.public SortedCopyOnWriteArray(java.util.Collection<T> wrapped, + boolean sort)+
wrapped
- - the collection whose elements are to be placed into the list.sort
- - TRUE to automatically sort the collection, FALSE if it is already sorted.public boolean add(T value)+
public boolean addAll(java.util.Collection<? extends T> values)+ +
public boolean remove(java.lang.Object value)+
+ Objects will be compared using the given objects equals() method.
public boolean removeAll(java.util.Collection<?> values)+ +
public boolean retainAll(java.util.Collection<?> values)+ +
public void remove(int index)+
index
- - index of the element to remove.public T get(int index)+
index
- - index of element to retrieve.public int size()+
public java.util.Iterator<T> iterator()+
public void clear()+ +
public boolean contains(java.lang.Object value)+ +
public boolean containsAll(java.util.Collection<?> values)+ +
public boolean isEmpty()+ +
public java.lang.Object[] toArray()+ +
Package | +Description | +
---|---|
com.comphenix.protocol.injector | ++ |
Modifier and Type | +Field and Description | +
---|---|
protected java.util.concurrent.ConcurrentMap<java.lang.Integer,SortedCopyOnWriteArray<com.comphenix.protocol.injector.ConcurrentListenerMultimap.PrioritizedListener>> |
+ConcurrentListenerMultimap.listeners |
+
Class | +Description | +
---|---|
SortedCopyOnWriteArray<T extends java.lang.Comparable<T>> | +
+ An implicitly sorted array list that preserves insertion order and maintains duplicates.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.injector | ++ |
Class and Description | +
---|
SortedCopyOnWriteArray
+ An implicitly sorted array list that preserves insertion order and maintains duplicates.
+ |
+
public enum ConnectionSide +extends java.lang.Enum<ConnectionSide>+
Enum Constant and Description | +
---|
BOTH
+Listen for both client and server side packets.
+ |
+
CLIENT_SIDE
+Listen for client side packets that will invoke onPacketReceiving().
+ |
+
SERVER_SIDE
+Listen for server side packets that will invoke onPacketSending().
+ |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+isForClient() |
+
boolean |
+isForServer() |
+
static ConnectionSide |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static ConnectionSide[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final ConnectionSide SERVER_SIDE+
public static final ConnectionSide CLIENT_SIDE+
public static final ConnectionSide BOTH+
public static ConnectionSide[] values()+
+for (ConnectionSide c : ConnectionSide.values()) + System.out.println(c); +
public static ConnectionSide valueOf(java.lang.String name)+
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant
+with the specified namejava.lang.NullPointerException
- if the argument is nullpublic boolean isForClient()+
public boolean isForServer()+
public enum ListenerPriority +extends java.lang.Enum<ListenerPriority>+
Enum Constant and Description | +
---|
HIGH
+Event call is of high importance.
+ |
+
HIGHEST
+Event call is critical and must have the final say in what happens to the
+ event.
+ |
+
LOW
+Event call is of low importance.
+ |
+
LOWEST
+Event call is of very low importance and should be ran first, to allow
+ other plugins to further customise the outcome.
+ |
+
MONITOR
+Event is listened to purely for monitoring the outcome of an event.
+ |
+
NORMAL
+Event call is neither important or unimportant, and may be ran normally.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
int |
+getSlot()
+A low slot represents a low priority.
+ |
+
static ListenerPriority |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static ListenerPriority[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final ListenerPriority LOWEST+
public static final ListenerPriority LOW+
public static final ListenerPriority NORMAL+
public static final ListenerPriority HIGH+
public static final ListenerPriority HIGHEST+
public static final ListenerPriority MONITOR+
public static ListenerPriority[] values()+
+for (ListenerPriority c : ListenerPriority.values()) + System.out.println(c); +
public static ListenerPriority valueOf(java.lang.String name)+
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant
+with the specified namejava.lang.NullPointerException
- if the argument is nullpublic int getSlot()+
public class ListeningWhitelist
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
static ListeningWhitelist |
+EMPTY_WHITELIST
+A whitelist with no packets - indicates that the listener shouldn't observe any packets.
+ |
+
Constructor and Description | +
---|
ListeningWhitelist(ListenerPriority priority,
+ java.lang.Integer... whitelist)
+Creates a packet whitelist of a given priority for a list of packets.
+ |
+
ListeningWhitelist(ListenerPriority priority,
+ java.util.Set<java.lang.Integer> whitelist)
+Creates a packet whitelist for a given priority with a set of packet IDs.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+equals(java.lang.Object obj) |
+
ListenerPriority |
+getPriority()
+Retrieve the priority in the execution order of the packet listener.
+ |
+
java.util.Set<java.lang.Integer> |
+getWhitelist()
+Retrieves the list of packets that will be observed by the listeners.
+ |
+
int |
+hashCode() |
+
boolean |
+isEnabled()
+Whether or not this whitelist has any enabled packets.
+ |
+
java.lang.String |
+toString() |
+
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public static ListeningWhitelist EMPTY_WHITELIST+
public ListeningWhitelist(ListenerPriority priority, + java.util.Set<java.lang.Integer> whitelist)+
priority
- - the listener priority.whitelist
- - set of IDs to observe/enable.public ListeningWhitelist(ListenerPriority priority, + java.lang.Integer... whitelist)+
priority
- - the listener priority.whitelist
- - list of packet IDs to observe/enable.public boolean isEnabled()+
public ListenerPriority getPriority()+
public java.util.Set<java.lang.Integer> getWhitelist()+
public int hashCode()+
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)+
equals
in class java.lang.Object
public java.lang.String toString()+
toString
in class java.lang.Object
public abstract class PacketAdapter +extends java.lang.Object +implements PacketListener+
Modifier and Type | +Field and Description | +
---|---|
protected ConnectionSide |
+connectionSide |
+
protected org.bukkit.plugin.Plugin |
+plugin |
+
protected ListeningWhitelist |
+receivingWhitelist |
+
protected ListeningWhitelist |
+sendingWhitelist |
+
Constructor and Description | +
---|
PacketAdapter(org.bukkit.plugin.Plugin plugin,
+ ConnectionSide connectionSide,
+ java.lang.Integer... packets)
+Initialize a packet listener with default priority.
+ |
+
PacketAdapter(org.bukkit.plugin.Plugin plugin,
+ ConnectionSide connectionSide,
+ ListenerPriority listenerPriority,
+ java.lang.Integer... packets)
+Initialize a packet listener for a single connection side.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
org.bukkit.plugin.Plugin |
+getPlugin()
+Retrieve the plugin that created list packet listener.
+ |
+
static java.lang.String |
+getPluginName(PacketListener listener)
+Retrieves the name of the plugin that has been associated with the listener.
+ |
+
ListeningWhitelist |
+getReceivingWhitelist()
+Retrieve which packets sent by the client this listener will observe.
+ |
+
ListeningWhitelist |
+getSendingWhitelist()
+Retrieve which packets sent by the server this listener will observe.
+ |
+
void |
+onPacketReceiving(PacketEvent event)
+Invoked right before a recieved packet from a client is being processed.
+ |
+
void |
+onPacketSending(PacketEvent event)
+Invoked right before a packet is transmitted from the server to the client.
+ |
+
java.lang.String |
+toString() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
protected org.bukkit.plugin.Plugin plugin+
protected ConnectionSide connectionSide+
protected ListeningWhitelist receivingWhitelist+
protected ListeningWhitelist sendingWhitelist+
public PacketAdapter(org.bukkit.plugin.Plugin plugin, + ConnectionSide connectionSide, + java.lang.Integer... packets)+
plugin
- - the plugin that spawned this listener.connectionSide
- - the packet type the listener is looking for.packets
- - the packet IDs the listener is looking for.public PacketAdapter(org.bukkit.plugin.Plugin plugin, + ConnectionSide connectionSide, + ListenerPriority listenerPriority, + java.lang.Integer... packets)+
plugin
- - the plugin that spawned this listener.connectionSide
- - the packet type the listener is looking for.listenerPriority
- - the event priority.packets
- - the packet IDs the listener is looking for.public void onPacketReceiving(PacketEvent event)+
PacketListener
onPacketReceiving
in interface PacketListener
event
- - the packet that has been recieved.public void onPacketSending(PacketEvent event)+
PacketListener
+ Note that the packet may be replaced, if needed.
onPacketSending
in interface PacketListener
event
- - the packet that should be sent.public ListeningWhitelist getReceivingWhitelist()+
PacketListener
getReceivingWhitelist
in interface PacketListener
public ListeningWhitelist getSendingWhitelist()+
PacketListener
getSendingWhitelist
in interface PacketListener
public org.bukkit.plugin.Plugin getPlugin()+
PacketListener
getPlugin
in interface PacketListener
public static java.lang.String getPluginName(PacketListener listener)+
public java.lang.String toString()+
toString
in class java.lang.Object
public class PacketContainer
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
protected net.minecraft.server.Packet |
+handle |
+
protected int |
+id |
+
protected StructureModifier<java.lang.Object> |
+structureModifier |
+
Constructor and Description | +
---|
PacketContainer(int id)
+Creates a packet container for a new packet.
+ |
+
PacketContainer(int id,
+ net.minecraft.server.Packet handle)
+Creates a packet container for an existing packet.
+ |
+
PacketContainer(int id,
+ net.minecraft.server.Packet handle,
+ StructureModifier<java.lang.Object> structure)
+Creates a packet container for an existing packet.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
StructureModifier<org.bukkit.entity.Entity> |
+getEntityModifier(org.bukkit.World world)
+Retrieves a read/write structure for entity objects.
+ |
+
net.minecraft.server.Packet |
+getHandle()
+Retrieves the underlying Minecraft packet.
+ |
+
int |
+getID()
+Retrieves the ID of this packet.
+ |
+
StructureModifier<org.bukkit.inventory.ItemStack[]> |
+getItemArrayModifier()
+Retrieves a read/write structure for arrays of ItemStacks.
+ |
+
StructureModifier<org.bukkit.inventory.ItemStack> |
+getItemModifier()
+Retrieves a read/write structure for ItemStack.
+ |
+
StructureModifier<java.lang.Object> |
+getModifier()
+Retrieves the generic structure modifier for this packet.
+ |
+
<T> StructureModifier<T> |
+getSpecificModifier(java.lang.Class<T> primitiveType)
+Retrieves a read/write structure for every field with the given type.
+ |
+
StructureModifier<org.bukkit.WorldType> |
+getWorldTypeModifier()
+Retrieves a read/write structure for the world type enum.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected net.minecraft.server.Packet handle+
protected int id+
protected StructureModifier<java.lang.Object> structureModifier+
public PacketContainer(int id)+
id
- - ID of the packet to create.public PacketContainer(int id, + net.minecraft.server.Packet handle)+
id
- - ID of the given packet.handle
- - contained packet.public PacketContainer(int id, + net.minecraft.server.Packet handle, + StructureModifier<java.lang.Object> structure)+
id
- - ID of the given packet.handle
- - contained packet.structure
- - structure modifier.public net.minecraft.server.Packet getHandle()+
public StructureModifier<java.lang.Object> getModifier()+
public <T> StructureModifier<T> getSpecificModifier(java.lang.Class<T> primitiveType)+
primitiveType
- - the type to find.public StructureModifier<org.bukkit.inventory.ItemStack> getItemModifier()+
+ This modifier will automatically marshall between the Bukkit ItemStack and the + internal Minecraft ItemStack.
public StructureModifier<org.bukkit.inventory.ItemStack[]> getItemArrayModifier()+
+ This modifier will automatically marshall between the Bukkit ItemStack and the + internal Minecraft ItemStack.
public StructureModifier<org.bukkit.WorldType> getWorldTypeModifier()+
+ This modifier will automatically marshall between the Bukkit world type and the + internal Minecraft world type.
public StructureModifier<org.bukkit.entity.Entity> getEntityModifier(org.bukkit.World world)+
+ Note that entities are transmitted by integer ID, and the type may not be enough + to distinguish between entities and other values. Thus, this structure modifier + MAY return null or invalid entities for certain fields. Using the correct index + is essential.
public int getID()+
public class PacketEvent
+extends java.util.EventObject
+implements org.bukkit.event.Cancellable
+Constructor and Description | +
---|
PacketEvent(java.lang.Object source)
+Use the static constructors to create instances of this event.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static PacketEvent |
+fromClient(java.lang.Object source,
+ PacketContainer packet,
+ org.bukkit.entity.Player client)
+Creates an event representing a client packet transmission.
+ |
+
static PacketEvent |
+fromServer(java.lang.Object source,
+ PacketContainer packet,
+ org.bukkit.entity.Player recipient)
+Creates an event representing a server packet transmission.
+ |
+
PacketContainer |
+getPacket()
+Retrieves the packet that will be sent to the player.
+ |
+
int |
+getPacketID()
+Retrieves the packet ID.
+ |
+
org.bukkit.entity.Player |
+getPlayer()
+Retrieves the player that has sent the packet or is recieving it.
+ |
+
boolean |
+isCancelled()
+Retrieves whether or not the packet should be cancelled.
+ |
+
boolean |
+isServerPacket()
+Whether or not this packet was created by the server.
+ |
+
void |
+setCancelled(boolean cancel)
+Sets whether or not the packet should be cancelled.
+ |
+
void |
+setPacket(PacketContainer packet)
+Replace the packet that will be sent to the player.
+ |
+
getSource, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public PacketEvent(java.lang.Object source)+
source
- - the event source.public static PacketEvent fromClient(java.lang.Object source, + PacketContainer packet, + org.bukkit.entity.Player client)+
source
- - the event source.packet
- - the packet.client
- - the client that sent the packet.public static PacketEvent fromServer(java.lang.Object source, + PacketContainer packet, + org.bukkit.entity.Player recipient)+
source
- - the event source.packet
- - the packet.recipient
- - the client that will receieve the packet.public PacketContainer getPacket()+
public void setPacket(PacketContainer packet)+
packet
- - the packet that will be sent instead.public int getPacketID()+
public boolean isCancelled()+
isCancelled
in interface org.bukkit.event.Cancellable
public void setCancelled(boolean cancel)+
setCancelled
in interface org.bukkit.event.Cancellable
cancel
- - TRUE if it should be cancelled, FALSE otherwise.public org.bukkit.entity.Player getPlayer()+
public boolean isServerPacket()+
public interface PacketListener
+
+ Use PacketAdapter
for a simple wrapper around this interface.
Modifier and Type | +Method and Description | +
---|---|
org.bukkit.plugin.Plugin |
+getPlugin()
+Retrieve the plugin that created list packet listener.
+ |
+
ListeningWhitelist |
+getReceivingWhitelist()
+Retrieve which packets sent by the client this listener will observe.
+ |
+
ListeningWhitelist |
+getSendingWhitelist()
+Retrieve which packets sent by the server this listener will observe.
+ |
+
void |
+onPacketReceiving(PacketEvent event)
+Invoked right before a recieved packet from a client is being processed.
+ |
+
void |
+onPacketSending(PacketEvent event)
+Invoked right before a packet is transmitted from the server to the client.
+ |
+
void onPacketSending(PacketEvent event)+
+ Note that the packet may be replaced, if needed.
event
- - the packet that should be sent.void onPacketReceiving(PacketEvent event)+
event
- - the packet that has been recieved.ListeningWhitelist getSendingWhitelist()+
ListeningWhitelist getReceivingWhitelist()+
org.bukkit.plugin.Plugin getPlugin()+
Package | +Description | +
---|---|
com.comphenix.protocol.events | ++ |
Modifier and Type | +Field and Description | +
---|---|
protected ConnectionSide |
+PacketAdapter.connectionSide |
+
Modifier and Type | +Method and Description | +
---|---|
static ConnectionSide |
+ConnectionSide.valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static ConnectionSide[] |
+ConnectionSide.values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
Constructor and Description | +
---|
PacketAdapter(org.bukkit.plugin.Plugin plugin,
+ ConnectionSide connectionSide,
+ java.lang.Integer... packets)
+Initialize a packet listener with default priority.
+ |
+
PacketAdapter(org.bukkit.plugin.Plugin plugin,
+ ConnectionSide connectionSide,
+ ListenerPriority listenerPriority,
+ java.lang.Integer... packets)
+Initialize a packet listener for a single connection side.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.events | ++ |
Modifier and Type | +Method and Description | +
---|---|
ListenerPriority |
+ListeningWhitelist.getPriority()
+Retrieve the priority in the execution order of the packet listener.
+ |
+
static ListenerPriority |
+ListenerPriority.valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static ListenerPriority[] |
+ListenerPriority.values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
Constructor and Description | +
---|
ListeningWhitelist(ListenerPriority priority,
+ java.lang.Integer... whitelist)
+Creates a packet whitelist of a given priority for a list of packets.
+ |
+
ListeningWhitelist(ListenerPriority priority,
+ java.util.Set<java.lang.Integer> whitelist)
+Creates a packet whitelist for a given priority with a set of packet IDs.
+ |
+
PacketAdapter(org.bukkit.plugin.Plugin plugin,
+ ConnectionSide connectionSide,
+ ListenerPriority listenerPriority,
+ java.lang.Integer... packets)
+Initialize a packet listener for a single connection side.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.events | ++ |
com.comphenix.protocol.injector | ++ |
Modifier and Type | +Field and Description | +
---|---|
static ListeningWhitelist |
+ListeningWhitelist.EMPTY_WHITELIST
+A whitelist with no packets - indicates that the listener shouldn't observe any packets.
+ |
+
protected ListeningWhitelist |
+PacketAdapter.receivingWhitelist |
+
protected ListeningWhitelist |
+PacketAdapter.sendingWhitelist |
+
Modifier and Type | +Method and Description | +
---|---|
ListeningWhitelist |
+PacketListener.getReceivingWhitelist()
+Retrieve which packets sent by the client this listener will observe.
+ |
+
ListeningWhitelist |
+PacketAdapter.getReceivingWhitelist() |
+
ListeningWhitelist |
+PacketListener.getSendingWhitelist()
+Retrieve which packets sent by the server this listener will observe.
+ |
+
ListeningWhitelist |
+PacketAdapter.getSendingWhitelist() |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+ConcurrentListenerMultimap.addListener(PacketListener listener,
+ ListeningWhitelist whitelist)
+Adds a listener to its requested list of packet recievers.
+ |
+
java.util.List<java.lang.Integer> |
+ConcurrentListenerMultimap.removeListener(PacketListener listener,
+ ListeningWhitelist whitelist)
+Removes the given listener from the packet event list.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
com.comphenix.protocol.events | ++ |
com.comphenix.protocol.injector | ++ |
Modifier and Type | +Method and Description | +
---|---|
PacketContainer |
+ProtocolManager.createPacket(int id)
+Constructs a new encapsulated Minecraft packet with the given ID.
+ |
+
PacketContainer |
+ProtocolManager.createPacket(int id,
+ boolean forceDefaults)
+Constructs a new encapsulated Minecraft packet with the given ID.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+ProtocolManager.recieveClientPacket(org.bukkit.entity.Player sender,
+ PacketContainer packet)
+Simulate recieving a certain packet from a given player.
+ |
+
void |
+ProtocolManager.recieveClientPacket(org.bukkit.entity.Player sender,
+ PacketContainer packet,
+ boolean filters)
+Simulate recieving a certain packet from a given player.
+ |
+
void |
+ProtocolManager.sendServerPacket(org.bukkit.entity.Player reciever,
+ PacketContainer packet)
+Send a packet to the given player.
+ |
+
void |
+ProtocolManager.sendServerPacket(org.bukkit.entity.Player reciever,
+ PacketContainer packet,
+ boolean filters)
+Send a packet to the given player.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
PacketContainer |
+PacketEvent.getPacket()
+Retrieves the packet that will be sent to the player.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static PacketEvent |
+PacketEvent.fromClient(java.lang.Object source,
+ PacketContainer packet,
+ org.bukkit.entity.Player client)
+Creates an event representing a client packet transmission.
+ |
+
static PacketEvent |
+PacketEvent.fromServer(java.lang.Object source,
+ PacketContainer packet,
+ org.bukkit.entity.Player recipient)
+Creates an event representing a server packet transmission.
+ |
+
void |
+PacketEvent.setPacket(PacketContainer packet)
+Replace the packet that will be sent to the player.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
PacketContainer |
+PacketFilterManager.createPacket(int id) |
+
PacketContainer |
+PacketFilterManager.createPacket(int id,
+ boolean forceDefaults) |
+
PacketContainer |
+PacketConstructor.createPacket(java.lang.Object... values)
+Construct a packet using the special builtin Minecraft constructors.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+PacketFilterManager.recieveClientPacket(org.bukkit.entity.Player sender,
+ PacketContainer packet) |
+
void |
+PacketFilterManager.recieveClientPacket(org.bukkit.entity.Player sender,
+ PacketContainer packet,
+ boolean filters) |
+
void |
+PacketFilterManager.sendServerPacket(org.bukkit.entity.Player reciever,
+ PacketContainer packet) |
+
void |
+PacketFilterManager.sendServerPacket(org.bukkit.entity.Player reciever,
+ PacketContainer packet,
+ boolean filters) |
+
Package | +Description | +
---|---|
com.comphenix.protocol.events | ++ |
com.comphenix.protocol.injector | ++ |
Modifier and Type | +Method and Description | +
---|---|
static PacketEvent |
+PacketEvent.fromClient(java.lang.Object source,
+ PacketContainer packet,
+ org.bukkit.entity.Player client)
+Creates an event representing a client packet transmission.
+ |
+
static PacketEvent |
+PacketEvent.fromServer(java.lang.Object source,
+ PacketContainer packet,
+ org.bukkit.entity.Player recipient)
+Creates an event representing a server packet transmission.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+PacketListener.onPacketReceiving(PacketEvent event)
+Invoked right before a recieved packet from a client is being processed.
+ |
+
void |
+PacketAdapter.onPacketReceiving(PacketEvent event) |
+
void |
+PacketListener.onPacketSending(PacketEvent event)
+Invoked right before a packet is transmitted from the server to the client.
+ |
+
void |
+PacketAdapter.onPacketSending(PacketEvent event) |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+ConcurrentListenerMultimap.invokePacketRecieving(java.util.logging.Logger logger,
+ PacketEvent event)
+Invokes the given packet event for every registered listener.
+ |
+
void |
+PacketFilterManager.invokePacketRecieving(PacketEvent event)
+Invokes the given packet event for every registered listener.
+ |
+
void |
+ConcurrentListenerMultimap.invokePacketSending(java.util.logging.Logger logger,
+ PacketEvent event)
+Invokes the given packet event for every registered listener.
+ |
+
void |
+PacketFilterManager.invokePacketSending(PacketEvent event)
+Invokes the given packet event for every registered listener.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
com.comphenix.protocol.events | ++ |
com.comphenix.protocol.injector | ++ |
Modifier and Type | +Method and Description | +
---|---|
com.google.common.collect.ImmutableSet<PacketListener> |
+ProtocolManager.getPacketListeners()
+Retrieves a list of every registered packet listener.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+ProtocolManager.addPacketListener(PacketListener listener)
+Adds a packet listener.
+ |
+
void |
+ProtocolManager.removePacketListener(PacketListener listener)
+Removes a given packet listener.
+ |
+
Modifier and Type | +Class and Description | +
---|---|
class |
+PacketAdapter
+Represents a packet listener with useful constructors.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static java.lang.String |
+PacketAdapter.getPluginName(PacketListener listener)
+Retrieves the name of the plugin that has been associated with the listener.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
com.google.common.collect.ImmutableSet<PacketListener> |
+PacketFilterManager.getPacketListeners() |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+ConcurrentListenerMultimap.addListener(PacketListener listener,
+ ListeningWhitelist whitelist)
+Adds a listener to its requested list of packet recievers.
+ |
+
void |
+PacketFilterManager.addPacketListener(PacketListener listener) |
+
java.util.List<java.lang.Integer> |
+ConcurrentListenerMultimap.removeListener(PacketListener listener,
+ ListeningWhitelist whitelist)
+Removes the given listener from the packet event list.
+ |
+
void |
+PacketFilterManager.removePacketListener(PacketListener listener) |
+
Interface | +Description | +
---|---|
PacketListener | +
+ Represents a listener that recieves notifications when packets are sent or recieved.
+ |
+
Class | +Description | +
---|---|
ListeningWhitelist | +
+ Determines which packets will be observed by a listener, and with what priority.
+ |
+
PacketAdapter | +
+ Represents a packet listener with useful constructors.
+ |
+
PacketContainer | +
+ Represents a Minecraft packet indirectly.
+ |
+
PacketEvent | ++ |
Enum | +Description | +
---|---|
ConnectionSide | +
+ Used to set a packet filter.
+ |
+
ListenerPriority | +
+ Represents a packet event priority, similar to the Bukkit EventPriority.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
com.comphenix.protocol.events | ++ |
com.comphenix.protocol.injector | ++ |
Class and Description | +
---|
PacketContainer
+ Represents a Minecraft packet indirectly.
+ |
+
PacketListener
+ Represents a listener that recieves notifications when packets are sent or recieved.
+ |
+
Class and Description | +
---|
ConnectionSide
+ Used to set a packet filter.
+ |
+
ListenerPriority
+ Represents a packet event priority, similar to the Bukkit EventPriority.
+ |
+
ListeningWhitelist
+ Determines which packets will be observed by a listener, and with what priority.
+ |
+
PacketContainer
+ Represents a Minecraft packet indirectly.
+ |
+
PacketEvent | +
PacketListener
+ Represents a listener that recieves notifications when packets are sent or recieved.
+ |
+
Class and Description | +
---|
ListeningWhitelist
+ Determines which packets will be observed by a listener, and with what priority.
+ |
+
PacketContainer
+ Represents a Minecraft packet indirectly.
+ |
+
PacketEvent | +
PacketListener
+ Represents a listener that recieves notifications when packets are sent or recieved.
+ |
+
public class ConcurrentListenerMultimap
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
protected java.util.concurrent.ConcurrentMap<java.lang.Integer,SortedCopyOnWriteArray<com.comphenix.protocol.injector.ConcurrentListenerMultimap.PrioritizedListener>> |
+listeners |
+
Constructor and Description | +
---|
ConcurrentListenerMultimap() |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+addListener(PacketListener listener,
+ ListeningWhitelist whitelist)
+Adds a listener to its requested list of packet recievers.
+ |
+
void |
+invokePacketRecieving(java.util.logging.Logger logger,
+ PacketEvent event)
+Invokes the given packet event for every registered listener.
+ |
+
void |
+invokePacketSending(java.util.logging.Logger logger,
+ PacketEvent event)
+Invokes the given packet event for every registered listener.
+ |
+
java.util.List<java.lang.Integer> |
+removeListener(PacketListener listener,
+ ListeningWhitelist whitelist)
+Removes the given listener from the packet event list.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected java.util.concurrent.ConcurrentMap<java.lang.Integer,SortedCopyOnWriteArray<com.comphenix.protocol.injector.ConcurrentListenerMultimap.PrioritizedListener>> listeners+
public ConcurrentListenerMultimap()+
public void addListener(PacketListener listener, + ListeningWhitelist whitelist)+
listener
- - listener with a list of packets to recieve notifcations for.whitelist
- - the packet whitelist to use.public java.util.List<java.lang.Integer> removeListener(PacketListener listener, + ListeningWhitelist whitelist)+
listener
- - listener to remove.whitelist
- - the packet whitelist that was used.public void invokePacketRecieving(java.util.logging.Logger logger, + PacketEvent event)+
logger
- - the logger that will be used to inform about listener exceptions.event
- - the packet event to invoke.public void invokePacketSending(java.util.logging.Logger logger, + PacketEvent event)+
logger
- - the logger that will be used to inform about listener exceptions.event
- - the packet event to invoke.public static interface NetworkFieldInjector.FakePacket
+public class NetworkFieldInjector
+extends java.lang.Object
+Modifier and Type | +Class and Description | +
---|---|
static interface |
+NetworkFieldInjector.FakePacket
+Marker interface that indicates a packet is fake and should not be processed.
+ |
+
Modifier and Type | +Field and Description | +
---|---|
protected java.io.DataInputStream |
+cachedInput |
+
protected boolean |
+hasInitialized |
+
protected static java.lang.reflect.Field |
+inputField |
+
protected PacketFilterManager |
+manager |
+
protected java.lang.Object |
+netHandler |
+
protected static java.lang.reflect.Field |
+netHandlerField |
+
protected java.lang.Object |
+networkManager |
+
protected static java.lang.reflect.Field |
+networkManagerField |
+
protected VolatileField |
+networkManagerRef |
+
protected static StructureModifier<java.lang.Object> |
+networkModifier |
+
protected org.bukkit.entity.Player |
+player |
+
protected static java.lang.reflect.Method |
+processMethod |
+
protected static java.lang.reflect.Method |
+queueMethod |
+
protected java.util.Set<java.lang.Integer> |
+sendingFilters |
+
protected static java.lang.reflect.Field |
+serverHandlerField |
+
Constructor and Description | +
---|
NetworkFieldInjector(org.bukkit.entity.Player player,
+ PacketFilterManager manager,
+ java.util.Set<java.lang.Integer> sendingFilters) |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+cleanupAll()
+Remove all hooks and modifications.
+ |
+
java.io.DataInputStream |
+getInputStream(boolean cache)
+Retrieve the current player's input stream.
+ |
+
protected void |
+initialize() |
+
void |
+injectManager()
+Inject a hook to catch packets sent to the current player.
+ |
+
void |
+processPacket(net.minecraft.server.Packet packet)
+Processes the given packet as if it was transmitted by the current player.
+ |
+
void |
+sendServerPacket(net.minecraft.server.Packet packet,
+ boolean filtered)
+Send a packet to the client.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected static java.lang.reflect.Field serverHandlerField+
protected static java.lang.reflect.Field networkManagerField+
protected static java.lang.reflect.Field inputField+
protected static java.lang.reflect.Field netHandlerField+
protected static StructureModifier<java.lang.Object> networkModifier+
protected static java.lang.reflect.Method queueMethod+
protected static java.lang.reflect.Method processMethod+
protected org.bukkit.entity.Player player+
protected boolean hasInitialized+
protected VolatileField networkManagerRef+
protected java.lang.Object networkManager+
protected java.lang.Object netHandler+
protected PacketFilterManager manager+
protected java.util.Set<java.lang.Integer> sendingFilters+
protected java.io.DataInputStream cachedInput+
public NetworkFieldInjector(org.bukkit.entity.Player player, + PacketFilterManager manager, + java.util.Set<java.lang.Integer> sendingFilters) + throws java.lang.IllegalAccessException+
java.lang.IllegalAccessException
protected void initialize() + throws java.lang.IllegalAccessException+
java.lang.IllegalAccessException
public void sendServerPacket(net.minecraft.server.Packet packet, + boolean filtered) + throws java.lang.reflect.InvocationTargetException+
packet
- - server packet to send.filtered
- - whether or not the packet will be filtered by our listeners.java.lang.reflect.InvocationTargetException
public void injectManager()+
public void cleanupAll()+
public void processPacket(net.minecraft.server.Packet packet) + throws java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
packet
- - packet to process.java.lang.IllegalAccessException
- If the reflection machinery failed.java.lang.reflect.InvocationTargetException
- If the underlying method caused an error.public java.io.DataInputStream getInputStream(boolean cache)+
cache
- - whether or not to cache the result of this method.public class NetworkObjectInjector
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
protected java.io.DataInputStream |
+cachedInput |
+
protected boolean |
+hasInitialized |
+
protected static java.lang.reflect.Field |
+inputField |
+
protected PacketFilterManager |
+manager |
+
protected java.lang.Object |
+netHandler |
+
protected static java.lang.reflect.Field |
+netHandlerField |
+
protected java.lang.Object |
+networkManager |
+
protected static java.lang.reflect.Field |
+networkManagerField |
+
protected VolatileField |
+networkManagerRef |
+
protected static StructureModifier<java.lang.Object> |
+networkModifier |
+
protected org.bukkit.entity.Player |
+player |
+
protected static java.lang.reflect.Method |
+processMethod |
+
protected static java.lang.reflect.Method |
+queueMethod |
+
protected java.util.Set<java.lang.Integer> |
+sendingFilters |
+
protected static java.lang.reflect.Field |
+serverHandlerField |
+
Constructor and Description | +
---|
NetworkObjectInjector(org.bukkit.entity.Player player,
+ PacketFilterManager manager,
+ java.util.Set<java.lang.Integer> sendingFilters) |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+cleanupAll()
+Remove all hooks and modifications.
+ |
+
java.io.DataInputStream |
+getInputStream(boolean cache)
+Retrieve the current player's input stream.
+ |
+
protected void |
+initialize() |
+
void |
+injectManager()
+Inject a hook to catch packets sent to the current player.
+ |
+
void |
+processPacket(net.minecraft.server.Packet packet)
+Processes the given packet as if it was transmitted by the current player.
+ |
+
void |
+sendServerPacket(net.minecraft.server.Packet packet,
+ boolean filtered)
+Send a packet to the client.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected static java.lang.reflect.Field serverHandlerField+
protected static java.lang.reflect.Field networkManagerField+
protected static java.lang.reflect.Field inputField+
protected static java.lang.reflect.Field netHandlerField+
protected static StructureModifier<java.lang.Object> networkModifier+
protected static java.lang.reflect.Method queueMethod+
protected static java.lang.reflect.Method processMethod+
protected org.bukkit.entity.Player player+
protected boolean hasInitialized+
protected VolatileField networkManagerRef+
protected java.lang.Object networkManager+
protected java.lang.Object netHandler+
protected PacketFilterManager manager+
protected java.util.Set<java.lang.Integer> sendingFilters+
protected java.io.DataInputStream cachedInput+
public NetworkObjectInjector(org.bukkit.entity.Player player, + PacketFilterManager manager, + java.util.Set<java.lang.Integer> sendingFilters) + throws java.lang.IllegalAccessException+
java.lang.IllegalAccessException
public void sendServerPacket(net.minecraft.server.Packet packet, + boolean filtered) + throws java.lang.reflect.InvocationTargetException+
packet
- - server packet to send.filtered
- - whether or not the packet will be filtered by our listeners.java.lang.reflect.InvocationTargetException
public void injectManager()+
public void cleanupAll()+
protected void initialize() + throws java.lang.IllegalAccessException+
java.lang.IllegalAccessException
public void processPacket(net.minecraft.server.Packet packet) + throws java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
packet
- - packet to process.java.lang.IllegalAccessException
- If the reflection machinery failed.java.lang.reflect.InvocationTargetException
- If the underlying method caused an error.public java.io.DataInputStream getInputStream(boolean cache)+
cache
- - whether or not to cache the result of this method.public static class PacketConstructor.BukkitUnwrapper +extends java.lang.Object +implements PacketConstructor.Unwrapper+
Constructor and Description | +
---|
PacketConstructor.BukkitUnwrapper() |
+
Modifier and Type | +Method and Description | +
---|---|
java.lang.Object |
+unwrapItem(java.lang.Object wrappedObject) |
+
java.lang.Class<?> |
+unwrapType(java.lang.Class<?> type) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public PacketConstructor.BukkitUnwrapper()+
public java.lang.Object unwrapItem(java.lang.Object wrappedObject)+
unwrapItem
in interface PacketConstructor.Unwrapper
public java.lang.Class<?> unwrapType(java.lang.Class<?> type)+
unwrapType
in interface PacketConstructor.Unwrapper
public static interface PacketConstructor.Unwrapper
+Modifier and Type | +Method and Description | +
---|---|
java.lang.Object |
+unwrapItem(java.lang.Object wrappedObject) |
+
java.lang.Class<?> |
+unwrapType(java.lang.Class<?> type) |
+
public class PacketConstructor
+extends java.lang.Object
+Modifier and Type | +Class and Description | +
---|---|
static class |
+PacketConstructor.BukkitUnwrapper |
+
static interface |
+PacketConstructor.Unwrapper |
+
Modifier and Type | +Field and Description | +
---|---|
static PacketConstructor |
+DEFAULT
+A packet constructor that automatically converts Bukkit types to their NMS conterpart.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
PacketContainer |
+createPacket(java.lang.Object... values)
+Construct a packet using the special builtin Minecraft constructors.
+ |
+
int |
+getPacketID()
+Retrieve the id of the packets this constructor creates.
+ |
+
com.google.common.collect.ImmutableList<PacketConstructor.Unwrapper> |
+getUnwrappers() |
+
PacketConstructor |
+withPacket(int id,
+ java.lang.Class<?>[] types)
+Create a packet constructor that creates packets using the given types.
+ |
+
PacketConstructor |
+withUnwrappers(java.util.List<PacketConstructor.Unwrapper> unwrappers)
+Return a copy of the current constructor with a different list of unwrappers.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static PacketConstructor DEFAULT+
+ Remember to call withPacket().
public com.google.common.collect.ImmutableList<PacketConstructor.Unwrapper> getUnwrappers()+
public int getPacketID()+
public PacketConstructor withUnwrappers(java.util.List<PacketConstructor.Unwrapper> unwrappers)+
unwrappers
- - list of unwrappers that convert Bukkit wrappers into the equivalent NMS classes.public PacketConstructor withPacket(int id, + java.lang.Class<?>[] types)+
id
- - packet ID.types
- - types to create.java.lang.IllegalArgumentException
- If no packet constructor could be created with these types.public PacketContainer createPacket(java.lang.Object... values) + throws FieldAccessException+
values
- - values containing Bukkit wrapped items to pass to Minecraft.FieldAccessException
- Failure due to a security limitation.java.lang.IllegalArgumentException
- Arguments doesn't match the constructor.java.lang.RuntimeException
- Minecraft threw an exception.public static enum PacketFilterManager.PlayerInjectHooks +extends java.lang.Enum<PacketFilterManager.PlayerInjectHooks>+
Enum Constant and Description | +
---|
NETWORK_HANDLER_FIELDS
+Override the packet queue lists in NetworkHandler.
+ |
+
NETWORK_MANAGER_OBJECT
+Override the network handler object itself.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static PacketFilterManager.PlayerInjectHooks |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static PacketFilterManager.PlayerInjectHooks[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final PacketFilterManager.PlayerInjectHooks NETWORK_HANDLER_FIELDS+
public static final PacketFilterManager.PlayerInjectHooks NETWORK_MANAGER_OBJECT+
public static PacketFilterManager.PlayerInjectHooks[] values()+
+for (PacketFilterManager.PlayerInjectHooks c : PacketFilterManager.PlayerInjectHooks.values()) + System.out.println(c); +
public static PacketFilterManager.PlayerInjectHooks valueOf(java.lang.String name)+
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant
+with the specified namejava.lang.NullPointerException
- if the argument is nullpublic final class PacketFilterManager +extends java.lang.Object +implements ProtocolManager+
Modifier and Type | +Class and Description | +
---|---|
static class |
+PacketFilterManager.PlayerInjectHooks
+Sets the inject hook type.
+ |
+
Constructor and Description | +
---|
PacketFilterManager(java.lang.ClassLoader classLoader,
+ java.util.logging.Logger logger)
+Only create instances of this class if protocol lib is disabled.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+addPacketListener(PacketListener listener)
+Adds a packet listener.
+ |
+
void |
+close() |
+
PacketContainer |
+createPacket(int id)
+Constructs a new encapsulated Minecraft packet with the given ID.
+ |
+
PacketContainer |
+createPacket(int id,
+ boolean forceDefaults)
+Constructs a new encapsulated Minecraft packet with the given ID.
+ |
+
PacketConstructor |
+createPacketConstructor(int id,
+ java.lang.Object... arguments)
+Construct a packet using the special builtin Minecraft constructors.
+ |
+
protected void |
+finalize() |
+
java.lang.ClassLoader |
+getClassLoader()
+Retrieves the current plugin class loader.
+ |
+
java.util.logging.Logger |
+getLogger() |
+
com.google.common.collect.ImmutableSet<PacketListener> |
+getPacketListeners()
+Retrieves a list of every registered packet listener.
+ |
+
PacketFilterManager.PlayerInjectHooks |
+getPlayerHook()
+Retrieves how the server packets are read.
+ |
+
protected com.comphenix.protocol.injector.PlayerInjector |
+getPlayerHookInstance(org.bukkit.entity.Player player)
+Used to construct a player hook.
+ |
+
java.util.Set<java.lang.Integer> |
+getReceivingFilters()
+Retrieves a immutable set containing the ID of the recieved client packets that will be observed by listeners.
+ |
+
java.util.Set<java.lang.Integer> |
+getSendingFilters()
+Retrieves a immutable set containing the ID of the sent server packets that will be observed by listeners.
+ |
+
void |
+initializePlayers(org.bukkit.entity.Player[] players)
+Initialize the packet injection for every player.
+ |
+
protected void |
+injectPlayer(org.bukkit.entity.Player player)
+Initialize a player hook, allowing us to read server packets.
+ |
+
void |
+invokePacketRecieving(PacketEvent event)
+Invokes the given packet event for every registered listener.
+ |
+
void |
+invokePacketSending(PacketEvent event)
+Invokes the given packet event for every registered listener.
+ |
+
boolean |
+isClosed()
+Determines whether or not this protocol mananger has been disabled.
+ |
+
void |
+recieveClientPacket(org.bukkit.entity.Player sender,
+ PacketContainer packet)
+Simulate recieving a certain packet from a given player.
+ |
+
void |
+recieveClientPacket(org.bukkit.entity.Player sender,
+ PacketContainer packet,
+ boolean filters)
+Simulate recieving a certain packet from a given player.
+ |
+
void |
+registerEvents(org.bukkit.plugin.PluginManager manager,
+ org.bukkit.plugin.Plugin plugin)
+Register this protocol manager on Bukkit.
+ |
+
void |
+removePacketListener(PacketListener listener)
+Removes a given packet listener.
+ |
+
void |
+removePacketListeners(org.bukkit.plugin.Plugin plugin)
+Removes every listener associated with the given plugin.
+ |
+
void |
+sendServerPacket(org.bukkit.entity.Player reciever,
+ PacketContainer packet)
+Send a packet to the given player.
+ |
+
void |
+sendServerPacket(org.bukkit.entity.Player reciever,
+ PacketContainer packet,
+ boolean filters)
+Send a packet to the given player.
+ |
+
void |
+setPlayerHook(PacketFilterManager.PlayerInjectHooks playerHook)
+Sets how the server packets are read.
+ |
+
void |
+updateEntity(org.bukkit.entity.Entity entity,
+ java.util.List<org.bukkit.entity.Player> observers)
+Completely refresh all clients about an entity.
+ |
+
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public PacketFilterManager(java.lang.ClassLoader classLoader, + java.util.logging.Logger logger)+
public PacketFilterManager.PlayerInjectHooks getPlayerHook()+
public void setPlayerHook(PacketFilterManager.PlayerInjectHooks playerHook)+
playerHook
- - the new injection method for reading server packets.public java.util.logging.Logger getLogger()+
public com.google.common.collect.ImmutableSet<PacketListener> getPacketListeners()+
ProtocolManager
getPacketListeners
in interface ProtocolManager
public void addPacketListener(PacketListener listener)+
ProtocolManager
+ Adding an already registered listener has no effect. If you need to change the packets + the current listener is observing, you must first remove the packet listener before you + can register it again.
addPacketListener
in interface ProtocolManager
listener
- - new packet listener.public void removePacketListener(PacketListener listener)+
ProtocolManager
+ Attempting to remove a listener that doesn't exist has no effect.
removePacketListener
in interface ProtocolManager
listener
- - the packet listener to remove.public void removePacketListeners(org.bukkit.plugin.Plugin plugin)+
ProtocolManager
removePacketListeners
in interface ProtocolManager
plugin
- - the plugin to unload.public void invokePacketRecieving(PacketEvent event)+
event
- - the packet event to invoke.public void invokePacketSending(PacketEvent event)+
event
- - the packet event to invoke.public void sendServerPacket(org.bukkit.entity.Player reciever, + PacketContainer packet) + throws java.lang.reflect.InvocationTargetException+
ProtocolManager
sendServerPacket
in interface ProtocolManager
reciever
- - the reciever.packet
- - packet to send.java.lang.reflect.InvocationTargetException
- - if an error occured when sending the packet.public void sendServerPacket(org.bukkit.entity.Player reciever, + PacketContainer packet, + boolean filters) + throws java.lang.reflect.InvocationTargetException+
ProtocolManager
sendServerPacket
in interface ProtocolManager
reciever
- - the reciever.packet
- - packet to send.filters
- - whether or not to invoke any packet filters.java.lang.reflect.InvocationTargetException
- - if an error occured when sending the packet.public void recieveClientPacket(org.bukkit.entity.Player sender, + PacketContainer packet) + throws java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
ProtocolManager
recieveClientPacket
in interface ProtocolManager
sender
- - the sender.packet
- - the packet that was sent.java.lang.IllegalAccessException
- If the underlying method caused an error.java.lang.reflect.InvocationTargetException
- If the reflection machinery failed.public void recieveClientPacket(org.bukkit.entity.Player sender, + PacketContainer packet, + boolean filters) + throws java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
ProtocolManager
recieveClientPacket
in interface ProtocolManager
sender
- - the sender.packet
- - the packet that was sent.filters
- - whether or not to invoke any packet filters.java.lang.IllegalAccessException
- If the underlying method caused an error.java.lang.reflect.InvocationTargetException
- If the reflection machinery failed.public PacketContainer createPacket(int id)+
ProtocolManager
createPacket
in interface ProtocolManager
id
- - packet ID.public PacketContainer createPacket(int id, + boolean forceDefaults)+
ProtocolManager
+ If set to true, the forceDefaults option will force the system to automatically + give non-primitive fields in the packet sensible default values. For instance, certain + packets - like Packet60Explosion - require a List or Set to be non-null. If the + forceDefaults option is true, the List or Set will be automatically created.
createPacket
in interface ProtocolManager
id
- - packet ID.forceDefaults
- - TRUE to use sensible defaults in most fields, FALSE otherwise.public PacketConstructor createPacketConstructor(int id, + java.lang.Object... arguments)+
ProtocolManager
createPacketConstructor
in interface ProtocolManager
id
- - the packet ID.arguments
- - arguments that will be passed to the constructor.public java.util.Set<java.lang.Integer> getSendingFilters()+
ProtocolManager
getSendingFilters
in interface ProtocolManager
public java.util.Set<java.lang.Integer> getReceivingFilters()+
ProtocolManager
getReceivingFilters
in interface ProtocolManager
public void updateEntity(org.bukkit.entity.Entity entity, + java.util.List<org.bukkit.entity.Player> observers) + throws FieldAccessException+
ProtocolManager
updateEntity
in interface ProtocolManager
entity
- - entity to refresh.observers
- - the clients to update.FieldAccessException
public void initializePlayers(org.bukkit.entity.Player[] players)+
players
- - list of players to inject.protected com.comphenix.protocol.injector.PlayerInjector getPlayerHookInstance(org.bukkit.entity.Player player) + throws java.lang.IllegalAccessException+
player
- - the player to hook.java.lang.IllegalAccessException
- Unable to do our reflection magic.protected void injectPlayer(org.bukkit.entity.Player player)+
player
- - player to hook.public void registerEvents(org.bukkit.plugin.PluginManager manager, + org.bukkit.plugin.Plugin plugin)+
manager
- - Bukkit plugin manager that provides player join/leave events.plugin
- - the parent plugin.public java.lang.ClassLoader getClassLoader()+
public boolean isClosed()+
ProtocolManager
isClosed
in interface ProtocolManager
public void close()+
protected void finalize() + throws java.lang.Throwable+
finalize
in class java.lang.Object
java.lang.Throwable
public class SortedCopyOnWriteArrayTest
+extends java.lang.Object
+Constructor and Description | +
---|
SortedCopyOnWriteArrayTest() |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+testInsertion() |
+
void |
+testOrder() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public class StructureCache
+extends java.lang.Object
+Constructor and Description | +
---|
StructureCache() |
+
Modifier and Type | +Method and Description | +
---|---|
static StructureModifier<java.lang.Object> |
+getStructure(int id)
+Retrieve a cached structure modifier for the given packet id.
+ |
+
static net.minecraft.server.Packet |
+newPacket(int id)
+Creates an empty Minecraft packet of the given ID.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static net.minecraft.server.Packet newPacket(int id)+
id
- - packet ID.public static StructureModifier<java.lang.Object> getStructure(int id)+
id
- - packet ID.Package | +Description | +
---|---|
com.comphenix.protocol.injector | ++ |
Modifier and Type | +Class and Description | +
---|---|
static class |
+PacketConstructor.BukkitUnwrapper |
+
Modifier and Type | +Method and Description | +
---|---|
com.google.common.collect.ImmutableList<PacketConstructor.Unwrapper> |
+PacketConstructor.getUnwrappers() |
+
Modifier and Type | +Method and Description | +
---|---|
PacketConstructor |
+PacketConstructor.withUnwrappers(java.util.List<PacketConstructor.Unwrapper> unwrappers)
+Return a copy of the current constructor with a different list of unwrappers.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
com.comphenix.protocol.injector | ++ |
Modifier and Type | +Method and Description | +
---|---|
PacketConstructor |
+ProtocolManager.createPacketConstructor(int id,
+ java.lang.Object... arguments)
+Construct a packet using the special builtin Minecraft constructors.
+ |
+
Modifier and Type | +Field and Description | +
---|---|
static PacketConstructor |
+PacketConstructor.DEFAULT
+A packet constructor that automatically converts Bukkit types to their NMS conterpart.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
PacketConstructor |
+PacketFilterManager.createPacketConstructor(int id,
+ java.lang.Object... arguments) |
+
PacketConstructor |
+PacketConstructor.withPacket(int id,
+ java.lang.Class<?>[] types)
+Create a packet constructor that creates packets using the given types.
+ |
+
PacketConstructor |
+PacketConstructor.withUnwrappers(java.util.List<PacketConstructor.Unwrapper> unwrappers)
+Return a copy of the current constructor with a different list of unwrappers.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.injector | ++ |
Modifier and Type | +Method and Description | +
---|---|
PacketFilterManager.PlayerInjectHooks |
+PacketFilterManager.getPlayerHook()
+Retrieves how the server packets are read.
+ |
+
static PacketFilterManager.PlayerInjectHooks |
+PacketFilterManager.PlayerInjectHooks.valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static PacketFilterManager.PlayerInjectHooks[] |
+PacketFilterManager.PlayerInjectHooks.values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+PacketFilterManager.setPlayerHook(PacketFilterManager.PlayerInjectHooks playerHook)
+Sets how the server packets are read.
+ |
+
Interface | +Description | +
---|---|
PacketConstructor.Unwrapper | ++ |
Class | +Description | +
---|---|
ConcurrentListenerMultimap | +
+ A thread-safe implementation of a listener multimap.
+ |
+
PacketConstructor | +
+ A packet constructor that uses an internal Minecraft.
+ |
+
PacketConstructor.BukkitUnwrapper | ++ |
PacketFilterManager | ++ |
SortedCopyOnWriteArrayTest | ++ |
StructureCache | +
+ Caches structure modifiers.
+ |
+
Enum | +Description | +
---|---|
PacketFilterManager.PlayerInjectHooks | +
+ Sets the inject hook type.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
com.comphenix.protocol.injector | ++ |
Class and Description | +
---|
PacketConstructor
+ A packet constructor that uses an internal Minecraft.
+ |
+
Class and Description | +
---|
PacketConstructor
+ A packet constructor that uses an internal Minecraft.
+ |
+
PacketConstructor.Unwrapper | +
PacketFilterManager.PlayerInjectHooks
+ Sets the inject hook type.
+ |
+
public class Statistics
+extends java.lang.Object
+Constructor and Description | +
---|
Statistics(org.bukkit.plugin.Plugin plugin) |
+
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
Modifier and Type | +Method and Description | +
---|---|
Statistics |
+ProtocolLibrary.getStatistics()
+Retrieve the metrics instance used to measure users of this library.
+ |
+
Class | +Description | +
---|---|
Statistics | ++ |
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
Class and Description | +
---|
Statistics | +
Interface | +Description | +
---|---|
ProtocolManager | +
+ Represents an API for accessing the Minecraft protocol.
+ |
+
Class | +Description | +
---|---|
Application | ++ |
Packets | +
+ List of known packet IDs since 1.3.2.
+ |
+
Packets.Client | +
+ List of packets sent by the client.
+ |
+
Packets.Server | +
+ List of packets sent only by the server.
+ |
+
ProtocolLibrary | ++ |
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
com.comphenix.protocol.injector | ++ |
Class and Description | +
---|
Packets.Client
+ List of packets sent by the client.
+ |
+
Packets.Server
+ List of packets sent only by the server.
+ |
+
ProtocolManager
+ Represents an API for accessing the Minecraft protocol.
+ |
+
Class and Description | +
---|
ProtocolManager
+ Represents an API for accessing the Minecraft protocol.
+ |
+
TType
- The specific type.public interface EquivalentConverter<TType>
+Modifier and Type | +Method and Description | +
---|---|
java.lang.Object |
+getGeneric(TType specific) |
+
TType |
+getSpecific(java.lang.Object generic) |
+
java.lang.Class<TType> |
+getSpecificType() |
+
public class FieldAccessException
+extends java.lang.Exception
+Constructor and Description | +
---|
FieldAccessException() |
+
FieldAccessException(java.lang.String message) |
+
FieldAccessException(java.lang.String message,
+ java.lang.Throwable cause) |
+
FieldAccessException(java.lang.Throwable cause) |
+
Modifier and Type | +Method and Description | +
---|---|
static FieldAccessException |
+fromFormat(java.lang.String message,
+ java.lang.Object... params) |
+
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public FieldAccessException()+
public FieldAccessException(java.lang.String message, + java.lang.Throwable cause)+
public FieldAccessException(java.lang.String message)+
public FieldAccessException(java.lang.Throwable cause)+
public static FieldAccessException fromFormat(java.lang.String message, + java.lang.Object... params)+
public class FieldUtils
+extends java.lang.Object
++ The ability is provided to break the scoping restrictions coded by the + programmer. This can allow fields to be changed that shouldn't be. This + facility should be used with care.
Constructor and Description | +
---|
FieldUtils()
+FieldUtils instances should NOT be constructed in standard programming.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static java.lang.reflect.Field |
+getField(java.lang.Class cls,
+ java.lang.String fieldName)
+Gets an accessible
+Field by name respecting scope. |
+
static java.lang.reflect.Field |
+getField(java.lang.Class cls,
+ java.lang.String fieldName,
+ boolean forceAccess)
+Gets an accessible
+Field by name breaking scope if
+ requested. |
+
static java.lang.Object |
+readField(java.lang.reflect.Field field,
+ java.lang.Object target)
+Read an accessible Field.
+ |
+
static java.lang.Object |
+readField(java.lang.reflect.Field field,
+ java.lang.Object target,
+ boolean forceAccess)
+Read a Field.
+ |
+
static java.lang.Object |
+readField(java.lang.Object target,
+ java.lang.String fieldName)
+Read the named public field.
+ |
+
static java.lang.Object |
+readField(java.lang.Object target,
+ java.lang.String fieldName,
+ boolean forceAccess)
+Read the named field.
+ |
+
static java.lang.Object |
+readStaticField(java.lang.Class cls,
+ java.lang.String fieldName)
+Read the named public static field.
+ |
+
static java.lang.Object |
+readStaticField(java.lang.Class cls,
+ java.lang.String fieldName,
+ boolean forceAccess)
+Read the named static field.
+ |
+
static java.lang.Object |
+readStaticField(java.lang.reflect.Field field)
+Read an accessible static Field.
+ |
+
static java.lang.Object |
+readStaticField(java.lang.reflect.Field field,
+ boolean forceAccess)
+Read a static Field.
+ |
+
static void |
+writeField(java.lang.reflect.Field field,
+ java.lang.Object target,
+ java.lang.Object value)
+Write an accessible field.
+ |
+
static void |
+writeField(java.lang.reflect.Field field,
+ java.lang.Object target,
+ java.lang.Object value,
+ boolean forceAccess)
+Write a field.
+ |
+
static void |
+writeField(java.lang.Object target,
+ java.lang.String fieldName,
+ java.lang.Object value)
+Write a public field.
+ |
+
static void |
+writeField(java.lang.Object target,
+ java.lang.String fieldName,
+ java.lang.Object value,
+ boolean forceAccess)
+Write a field.
+ |
+
static void |
+writeStaticField(java.lang.Class cls,
+ java.lang.String fieldName,
+ java.lang.Object value)
+Write a named public static Field.
+ |
+
static void |
+writeStaticField(java.lang.Class cls,
+ java.lang.String fieldName,
+ java.lang.Object value,
+ boolean forceAccess)
+Write a named static Field.
+ |
+
static void |
+writeStaticField(java.lang.reflect.Field field,
+ java.lang.Object value)
+Write a public static Field.
+ |
+
static void |
+writeStaticField(java.lang.reflect.Field field,
+ java.lang.Object value,
+ boolean forceAccess)
+Write a static Field.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public FieldUtils()+
+ This constructor is public to permit tools that require a JavaBean + instance to operate.
public static java.lang.reflect.Field getField(java.lang.Class cls, + java.lang.String fieldName)+
Field
by name respecting scope.
+ Superclasses/interfaces will be considered.cls
- the class to reflect, must not be nullfieldName
- the field name to obtainjava.lang.IllegalArgumentException
- if the class or field name is nullpublic static java.lang.reflect.Field getField(java.lang.Class cls, + java.lang.String fieldName, + boolean forceAccess)+
Field
by name breaking scope if
+ requested. Superclasses/interfaces will be considered.cls
- the class to reflect, must not be nullfieldName
- the field name to obtainforceAccess
- whether to break scope restrictions using the
+ setAccessible
method. False
will
+ only match public fields.java.lang.IllegalArgumentException
- if the class or field name is nullpublic static java.lang.Object readStaticField(java.lang.reflect.Field field) + throws java.lang.IllegalAccessException+
field
- to readjava.lang.IllegalArgumentException
- if the field is null or not staticjava.lang.IllegalAccessException
- if the field is not accessiblepublic static java.lang.Object readStaticField(java.lang.reflect.Field field, + boolean forceAccess) + throws java.lang.IllegalAccessException+
field
- to readforceAccess
- whether to break scope restrictions using the
+ setAccessible
method.java.lang.IllegalArgumentException
- if the field is null or not staticjava.lang.IllegalAccessException
- if the field is not made accessiblepublic static java.lang.Object readStaticField(java.lang.Class cls, + java.lang.String fieldName) + throws java.lang.IllegalAccessException+
cls
- the class to reflect, must not be nullfieldName
- the field name to obtainjava.lang.IllegalArgumentException
- if the class or field name is nulljava.lang.IllegalAccessException
- if the field is not accessiblepublic static java.lang.Object readStaticField(java.lang.Class cls, + java.lang.String fieldName, + boolean forceAccess) + throws java.lang.IllegalAccessException+
cls
- the class to reflect, must not be nullfieldName
- the field name to obtainforceAccess
- whether to break scope restrictions using the
+ setAccessible
method. False
will
+ only match public fields.java.lang.IllegalArgumentException
- if the class or field name is nulljava.lang.IllegalAccessException
- if the field is not made accessiblepublic static java.lang.Object readField(java.lang.reflect.Field field, + java.lang.Object target) + throws java.lang.IllegalAccessException+
field
- the field to usetarget
- the object to call on, may be null for static fieldsjava.lang.IllegalArgumentException
- if the field is nulljava.lang.IllegalAccessException
- if the field is not accessiblepublic static java.lang.Object readField(java.lang.reflect.Field field, + java.lang.Object target, + boolean forceAccess) + throws java.lang.IllegalAccessException+
field
- the field to usetarget
- the object to call on, may be null for static fieldsforceAccess
- whether to break scope restrictions using the
+ setAccessible
method.java.lang.IllegalArgumentException
- if the field is nulljava.lang.IllegalAccessException
- if the field is not made accessiblepublic static java.lang.Object readField(java.lang.Object target, + java.lang.String fieldName) + throws java.lang.IllegalAccessException+
target
- the object to reflect, must not be nullfieldName
- the field name to obtainjava.lang.IllegalArgumentException
- if the class or field name is nulljava.lang.IllegalAccessException
- if the named field is not publicpublic static java.lang.Object readField(java.lang.Object target, + java.lang.String fieldName, + boolean forceAccess) + throws java.lang.IllegalAccessException+
target
- the object to reflect, must not be nullfieldName
- the field name to obtainforceAccess
- whether to break scope restrictions using the
+ setAccessible
method. False
will
+ only match public fields.java.lang.IllegalArgumentException
- if the class or field name is nulljava.lang.IllegalAccessException
- if the named field is not made accessiblepublic static void writeStaticField(java.lang.reflect.Field field, + java.lang.Object value) + throws java.lang.IllegalAccessException+
field
- to writevalue
- to setjava.lang.IllegalArgumentException
- if the field is null or not staticjava.lang.IllegalAccessException
- if the field is not public or is finalpublic static void writeStaticField(java.lang.reflect.Field field, + java.lang.Object value, + boolean forceAccess) + throws java.lang.IllegalAccessException+
field
- to writevalue
- to setforceAccess
- whether to break scope restrictions using the
+ setAccessible
method. False
will
+ only match public fields.java.lang.IllegalArgumentException
- if the field is null or not staticjava.lang.IllegalAccessException
- if the field is not made accessible or is
+ finalpublic static void writeStaticField(java.lang.Class cls, + java.lang.String fieldName, + java.lang.Object value) + throws java.lang.IllegalAccessException+
cls
- Class on which the Field is to be foundfieldName
- to writevalue
- to setjava.lang.IllegalArgumentException
- if the field cannot be located or is not
+ staticjava.lang.IllegalAccessException
- if the field is not public or is finalpublic static void writeStaticField(java.lang.Class cls, + java.lang.String fieldName, + java.lang.Object value, + boolean forceAccess) + throws java.lang.IllegalAccessException+
cls
- Class on which the Field is to be foundfieldName
- to writevalue
- to setforceAccess
- whether to break scope restrictions using the
+ setAccessible
method. False
will
+ only match public fields.java.lang.IllegalArgumentException
- if the field cannot be located or is not
+ staticjava.lang.IllegalAccessException
- if the field is not made accessible or is
+ finalpublic static void writeField(java.lang.reflect.Field field, + java.lang.Object target, + java.lang.Object value) + throws java.lang.IllegalAccessException+
field
- to writetarget
- the object to call on, may be null for static fieldsvalue
- to setjava.lang.IllegalArgumentException
- if the field is nulljava.lang.IllegalAccessException
- if the field is not accessible or is finalpublic static void writeField(java.lang.reflect.Field field, + java.lang.Object target, + java.lang.Object value, + boolean forceAccess) + throws java.lang.IllegalAccessException+
field
- to writetarget
- the object to call on, may be null for static fieldsvalue
- to setforceAccess
- whether to break scope restrictions using the
+ setAccessible
method. False
will
+ only match public fields.java.lang.IllegalArgumentException
- if the field is nulljava.lang.IllegalAccessException
- if the field is not made accessible or is
+ finalpublic static void writeField(java.lang.Object target, + java.lang.String fieldName, + java.lang.Object value) + throws java.lang.IllegalAccessException+
target
- the object to reflect, must not be nullfieldName
- the field name to obtainvalue
- to setjava.lang.IllegalArgumentException
- if target
or
+ fieldName
is nulljava.lang.IllegalAccessException
- if the field is not accessiblepublic static void writeField(java.lang.Object target, + java.lang.String fieldName, + java.lang.Object value, + boolean forceAccess) + throws java.lang.IllegalAccessException+
target
- the object to reflect, must not be nullfieldName
- the field name to obtainvalue
- to setforceAccess
- whether to break scope restrictions using the
+ setAccessible
method. False
will
+ only match public fields.java.lang.IllegalArgumentException
- if target
or
+ fieldName
is nulljava.lang.IllegalAccessException
- if the field is not made accessiblepublic class FuzzyReflection
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
static java.lang.String |
+MINECRAFT_OBJECT
+Matches a Minecraft object.
+ |
+
Constructor and Description | +
---|
FuzzyReflection(java.lang.Class<?> source,
+ boolean forceAccess) |
+
Modifier and Type | +Method and Description | +
---|---|
static FuzzyReflection |
+fromClass(java.lang.Class<?> source)
+Retrieves a fuzzy reflection instance from a given class.
+ |
+
static FuzzyReflection |
+fromClass(java.lang.Class<?> source,
+ boolean forceAccess)
+Retrieves a fuzzy reflection instance from a given class.
+ |
+
static FuzzyReflection |
+fromObject(java.lang.Object reference)
+Retrieves a fuzzy reflection instance from an object.
+ |
+
static FuzzyReflection |
+fromObject(java.lang.Object reference,
+ boolean forceAccess)
+Retrieves a fuzzy reflection instance from an object.
+ |
+
java.lang.reflect.Field |
+getFieldByName(java.lang.String nameRegex)
+Retrieves a field by name.
+ |
+
java.lang.reflect.Field |
+getFieldByType(java.lang.String typeRegex)
+Retrieves a field by type.
+ |
+
java.lang.reflect.Field |
+getFieldByType(java.lang.String typeRegex,
+ java.util.Set<java.lang.Class> ignored)
+Retrieves a field by type.
+ |
+
java.util.Set<java.lang.reflect.Field> |
+getFields()
+Retrieves all private and public fields in declared order (after JDK 1.5).
+ |
+
java.lang.reflect.Method |
+getMethodByName(java.lang.String nameRegex)
+Retrieves a method by looking at its name.
+ |
+
java.lang.reflect.Method |
+getMethodByParameters(java.lang.String name,
+ java.lang.Class<?>... args)
+Retrieves a method by looking at the parameter types only.
+ |
+
java.lang.reflect.Method |
+getMethodByParameters(java.lang.String name,
+ java.lang.Class<?> returnType,
+ java.lang.Class<?>[] args)
+Retrieves a method by looking at the parameter types and return type only.
+ |
+
java.util.Set<java.lang.reflect.Method> |
+getMethods()
+Retrieves all private and public methods in declared order (after JDK 1.5).
+ |
+
java.lang.Class<?> |
+getSource()
+Retrieves the underlying class.
+ |
+
boolean |
+isForceAccess()
+Retrieves whether or not not to override any scope restrictions.
+ |
+
void |
+setForceAccess(boolean forceAccess)
+Sets whether or not not to override any scope restrictions.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static java.lang.String MINECRAFT_OBJECT+
public FuzzyReflection(java.lang.Class<?> source, + boolean forceAccess)+
public static FuzzyReflection fromClass(java.lang.Class<?> source)+
source
- - the class we'll use.public static FuzzyReflection fromClass(java.lang.Class<?> source, + boolean forceAccess)+
source
- - the class we'll use.forceAccess
- - whether or not to override scope restrictions.public static FuzzyReflection fromObject(java.lang.Object reference)+
reference
- - the object we'll use.public static FuzzyReflection fromObject(java.lang.Object reference, + boolean forceAccess)+
reference
- - the object we'll use.forceAccess
- - whether or not to override scope restrictions.public java.lang.Class<?> getSource()+
public java.lang.reflect.Method getMethodByName(java.lang.String nameRegex)+
nameRegex
- - regular expression that will match method names.public java.lang.reflect.Method getMethodByParameters(java.lang.String name, + java.lang.Class<?>... args)+
name
- - potential name of the method. Only used by the error mechanism.args
- - parameter types of the method to find.public java.lang.reflect.Method getMethodByParameters(java.lang.String name, + java.lang.Class<?> returnType, + java.lang.Class<?>[] args)+
name
- - potential name of the method. Only used by the error mechanism.returnType
- - return type of the method to find.args
- - parameter types of the method to find.public java.lang.reflect.Field getFieldByName(java.lang.String nameRegex)+
nameRegex
- - regular expression that will match a field name.public java.lang.reflect.Field getFieldByType(java.lang.String typeRegex)+
+ Note that the type is matched using the full canonical representation, i.e.: +
typeRegex
- - regular expression that will match the field type.public java.lang.reflect.Field getFieldByType(java.lang.String typeRegex, + java.util.Set<java.lang.Class> ignored)+
+ Note that the type is matched using the full canonical representation, i.e.: +
typeRegex
- - regular expression that will match the field type.ignored
- - types to ignore.public java.util.Set<java.lang.reflect.Field> getFields()+
public java.util.Set<java.lang.reflect.Method> getMethods()+
public boolean isForceAccess()+
public void setForceAccess(boolean forceAccess)+
forceAccess
- - TRUE if we override scope, FALSE otherwise.public class IntEnum
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
protected com.google.common.collect.BiMap<java.lang.Integer,java.lang.String> |
+members |
+
Constructor and Description | +
---|
IntEnum()
+Registers every declared integer field.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
java.lang.String |
+getDeclaredName(java.lang.Integer id)
+Retrieve the name of the member with the given id.
+ |
+
boolean |
+hasMember(int id)
+Determines whether or not the given member exists.
+ |
+
protected void |
+registerAll()
+Registers every public int field as a member.
+ |
+
protected void |
+registerMember(int id,
+ java.lang.String name)
+Registers a member.
+ |
+
java.lang.Integer |
+valueOf(java.lang.String name)
+Retrieve the ID of the member with the given name.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected com.google.common.collect.BiMap<java.lang.Integer,java.lang.String> members+
public IntEnum()+
protected void registerAll()+
protected void registerMember(int id, + java.lang.String name)+
id
- - id of member.name
- - name of member.public boolean hasMember(int id)+
id
- - the ID of the member to find.public java.lang.Integer valueOf(java.lang.String name)+
name
- - name of member to retrieve.public java.lang.String getDeclaredName(java.lang.Integer id)+
id
- - id of the member to retrieve.public class MethodUtils
+extends java.lang.Object
+Utility reflection methods focussed on methods in general rather than properties in particular.
+ +There is an issue when invoking public methods contained in a default access superclass.
+ Reflection locates these methods fine and correctly assigns them as public.
+ However, an IllegalAccessException
is thrown if the method is invoked.
MethodUtils
contains a workaround for this situation.
+ It will attempt to call setAccessible
on this method.
+ If this call succeeds, then the method can be invoked as normal.
+ This call will only succeed when the application has sufficient security privilages.
+ If this call fails then a warning will be logged and the method may fail.
Constructor and Description | +
---|
MethodUtils() |
+
Modifier and Type | +Method and Description | +
---|---|
static int |
+clearCache()
+Clear the method cache.
+ |
+
static java.lang.reflect.Method |
+getAccessibleMethod(java.lang.Class clazz,
+ java.lang.reflect.Method method)
+Return an accessible method (that is, one that can be invoked via
+ reflection) that implements the specified Method.
+ |
+
static java.lang.reflect.Method |
+getAccessibleMethod(java.lang.Class clazz,
+ java.lang.String methodName,
+ java.lang.Class[] parameterTypes)
+Return an accessible method (that is, one that can be invoked via
+ reflection) with given name and parameters.
+ |
+
static java.lang.reflect.Method |
+getAccessibleMethod(java.lang.reflect.Method method)
+Return an accessible method (that is, one that can be invoked via
+ reflection) that implements the specified Method.
+ |
+
static java.lang.reflect.Method |
+getMatchingAccessibleMethod(java.lang.Class clazz,
+ java.lang.String methodName,
+ java.lang.Class[] parameterTypes)
+Find an accessible method that matches the given name and has compatible parameters.
+ |
+
static java.lang.Class |
+getPrimitiveType(java.lang.Class wrapperType)
+Gets the class for the primitive type corresponding to the primitive wrapper class given.
+ |
+
static java.lang.Class |
+getPrimitiveWrapper(java.lang.Class primitiveType)
+Gets the wrapper object class for the given primitive type class.
+ |
+
static java.lang.Object |
+invokeExactMethod(java.lang.Object object,
+ java.lang.String methodName,
+ java.lang.Object arg)
+Invoke a method whose parameter type matches exactly the object
+ type.
+ |
+
static java.lang.Object |
+invokeExactMethod(java.lang.Object object,
+ java.lang.String methodName,
+ java.lang.Object[] args)
+Invoke a method whose parameter types match exactly the object
+ types.
+ |
+
static java.lang.Object |
+invokeExactMethod(java.lang.Object object,
+ java.lang.String methodName,
+ java.lang.Object[] args,
+ java.lang.Class[] parameterTypes)
+Invoke a method whose parameter types match exactly the parameter
+ types given.
+ |
+
static java.lang.Object |
+invokeExactStaticMethod(java.lang.Class objectClass,
+ java.lang.String methodName,
+ java.lang.Object arg)
+Invoke a static method whose parameter type matches exactly the object
+ type.
+ |
+
static java.lang.Object |
+invokeExactStaticMethod(java.lang.Class objectClass,
+ java.lang.String methodName,
+ java.lang.Object[] args)
+Invoke a static method whose parameter types match exactly the object
+ types.
+ |
+
static java.lang.Object |
+invokeExactStaticMethod(java.lang.Class objectClass,
+ java.lang.String methodName,
+ java.lang.Object[] args,
+ java.lang.Class[] parameterTypes)
+Invoke a static method whose parameter types match exactly the parameter
+ types given.
+ |
+
static java.lang.Object |
+invokeMethod(java.lang.Object object,
+ java.lang.String methodName,
+ java.lang.Object arg)
+Invoke a named method whose parameter type matches the object type.
+ |
+
static java.lang.Object |
+invokeMethod(java.lang.Object object,
+ java.lang.String methodName,
+ java.lang.Object[] args)
+Invoke a named method whose parameter type matches the object type.
+ |
+
static java.lang.Object |
+invokeMethod(java.lang.Object object,
+ java.lang.String methodName,
+ java.lang.Object[] args,
+ java.lang.Class[] parameterTypes)
+Invoke a named method whose parameter type matches the object type.
+ |
+
static java.lang.Object |
+invokeStaticMethod(java.lang.Class objectClass,
+ java.lang.String methodName,
+ java.lang.Object arg)
+Invoke a named static method whose parameter type matches the object type.
+ |
+
static java.lang.Object |
+invokeStaticMethod(java.lang.Class objectClass,
+ java.lang.String methodName,
+ java.lang.Object[] args)
+Invoke a named static method whose parameter type matches the object type.
+ |
+
static java.lang.Object |
+invokeStaticMethod(java.lang.Class objectClass,
+ java.lang.String methodName,
+ java.lang.Object[] args,
+ java.lang.Class[] parameterTypes)
+Invoke a named static method whose parameter type matches the object type.
+ |
+
static boolean |
+isAssignmentCompatible(java.lang.Class parameterType,
+ java.lang.Class parameterization)
+Determine whether a type can be used as a parameter in a method invocation.
+ |
+
static void |
+setCacheMethods(boolean cacheMethods)
+Set whether methods should be cached for greater performance or not,
+ default is
+true . |
+
static java.lang.Class |
+toNonPrimitiveClass(java.lang.Class clazz)
+Find a non primitive representation for given primitive class.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static void setCacheMethods(boolean cacheMethods)+
true
.cacheMethods
- true
if methods should be
+ cached for greater performance, otherwise false
public static int clearCache()+
public static java.lang.Object invokeMethod(java.lang.Object object, + java.lang.String methodName, + java.lang.Object arg) + throws java.lang.NoSuchMethodException, + java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
Invoke a named method whose parameter type matches the object type.
+ +The behaviour of this method is less deterministic
+ than invokeExactMethod()
.
+ It loops through all methods with names that match
+ and then executes the first it finds with compatable parameters.
This method supports calls to methods taking primitive parameters
+ via passing in wrapping classes. So, for example, a Boolean
class
+ would match a boolean
primitive.
This is a convenient wrapper for
+ invokeMethod(Object object,String methodName,Object [] args)
.
+
object
- invoke method on this objectmethodName
- get method with this namearg
- use this argumentjava.lang.NoSuchMethodException
- if there is no such accessible methodjava.lang.reflect.InvocationTargetException
- wraps an exception thrown by the
+ method invokedjava.lang.IllegalAccessException
- if the requested method is not accessible
+ via reflectionpublic static java.lang.Object invokeMethod(java.lang.Object object, + java.lang.String methodName, + java.lang.Object[] args) + throws java.lang.NoSuchMethodException, + java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
Invoke a named method whose parameter type matches the object type.
+ +The behaviour of this method is less deterministic
+ than invokeExactMethod(Object object,String methodName,Object [] args)
.
+ It loops through all methods with names that match
+ and then executes the first it finds with compatable parameters.
This method supports calls to methods taking primitive parameters
+ via passing in wrapping classes. So, for example, a Boolean
class
+ would match a boolean
primitive.
This is a convenient wrapper for
+ invokeMethod(Object object,String methodName,Object [] args,Class[] parameterTypes)
.
+
object
- invoke method on this objectmethodName
- get method with this nameargs
- use these arguments - treat null as empty arrayjava.lang.NoSuchMethodException
- if there is no such accessible methodjava.lang.reflect.InvocationTargetException
- wraps an exception thrown by the
+ method invokedjava.lang.IllegalAccessException
- if the requested method is not accessible
+ via reflectionpublic static java.lang.Object invokeMethod(java.lang.Object object, + java.lang.String methodName, + java.lang.Object[] args, + java.lang.Class[] parameterTypes) + throws java.lang.NoSuchMethodException, + java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
Invoke a named method whose parameter type matches the object type.
+ +The behaviour of this method is less deterministic
+ than invokeExactMethod(Object object,String methodName,Object [] args,Class[] parameterTypes)
.
+ It loops through all methods with names that match
+ and then executes the first it finds with compatable parameters.
This method supports calls to methods taking primitive parameters
+ via passing in wrapping classes. So, for example, a Boolean
class
+ would match a boolean
primitive.
object
- invoke method on this objectmethodName
- get method with this nameargs
- use these arguments - treat null as empty arrayparameterTypes
- match these parameters - treat null as empty arrayjava.lang.NoSuchMethodException
- if there is no such accessible methodjava.lang.reflect.InvocationTargetException
- wraps an exception thrown by the
+ method invokedjava.lang.IllegalAccessException
- if the requested method is not accessible
+ via reflectionpublic static java.lang.Object invokeExactMethod(java.lang.Object object, + java.lang.String methodName, + java.lang.Object arg) + throws java.lang.NoSuchMethodException, + java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
Invoke a method whose parameter type matches exactly the object + type.
+ + This is a convenient wrapper for
+ invokeExactMethod(Object object,String methodName,Object [] args)
.
+
object
- invoke method on this objectmethodName
- get method with this namearg
- use this argumentjava.lang.NoSuchMethodException
- if there is no such accessible methodjava.lang.reflect.InvocationTargetException
- wraps an exception thrown by the
+ method invokedjava.lang.IllegalAccessException
- if the requested method is not accessible
+ via reflectionpublic static java.lang.Object invokeExactMethod(java.lang.Object object, + java.lang.String methodName, + java.lang.Object[] args) + throws java.lang.NoSuchMethodException, + java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
Invoke a method whose parameter types match exactly the object + types.
+ + This uses reflection to invoke the method obtained from a call to
+ getAccessibleMethod()
.
object
- invoke method on this objectmethodName
- get method with this nameargs
- use these arguments - treat null as empty arrayjava.lang.NoSuchMethodException
- if there is no such accessible methodjava.lang.reflect.InvocationTargetException
- wraps an exception thrown by the
+ method invokedjava.lang.IllegalAccessException
- if the requested method is not accessible
+ via reflectionpublic static java.lang.Object invokeExactMethod(java.lang.Object object, + java.lang.String methodName, + java.lang.Object[] args, + java.lang.Class[] parameterTypes) + throws java.lang.NoSuchMethodException, + java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
Invoke a method whose parameter types match exactly the parameter + types given.
+ +This uses reflection to invoke the method obtained from a call to
+ getAccessibleMethod()
.
object
- invoke method on this objectmethodName
- get method with this nameargs
- use these arguments - treat null as empty arrayparameterTypes
- match these parameters - treat null as empty arrayjava.lang.NoSuchMethodException
- if there is no such accessible methodjava.lang.reflect.InvocationTargetException
- wraps an exception thrown by the
+ method invokedjava.lang.IllegalAccessException
- if the requested method is not accessible
+ via reflectionpublic static java.lang.Object invokeExactStaticMethod(java.lang.Class objectClass, + java.lang.String methodName, + java.lang.Object[] args, + java.lang.Class[] parameterTypes) + throws java.lang.NoSuchMethodException, + java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
Invoke a static method whose parameter types match exactly the parameter + types given.
+ +This uses reflection to invoke the method obtained from a call to
+ getAccessibleMethod(Class, String, Class[])
.
objectClass
- invoke static method on this classmethodName
- get method with this nameargs
- use these arguments - treat null as empty arrayparameterTypes
- match these parameters - treat null as empty arrayjava.lang.NoSuchMethodException
- if there is no such accessible methodjava.lang.reflect.InvocationTargetException
- wraps an exception thrown by the
+ method invokedjava.lang.IllegalAccessException
- if the requested method is not accessible
+ via reflectionpublic static java.lang.Object invokeStaticMethod(java.lang.Class objectClass, + java.lang.String methodName, + java.lang.Object arg) + throws java.lang.NoSuchMethodException, + java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
Invoke a named static method whose parameter type matches the object type.
+ +The behaviour of this method is less deterministic
+ than invokeExactMethod(Object, String, Object[], Class[])
.
+ It loops through all methods with names that match
+ and then executes the first it finds with compatable parameters.
This method supports calls to methods taking primitive parameters
+ via passing in wrapping classes. So, for example, a Boolean
class
+ would match a boolean
primitive.
This is a convenient wrapper for
+ invokeStaticMethod(Class objectClass,String methodName,Object [] args)
.
+
objectClass
- invoke static method on this classmethodName
- get method with this namearg
- use this argumentjava.lang.NoSuchMethodException
- if there is no such accessible methodjava.lang.reflect.InvocationTargetException
- wraps an exception thrown by the
+ method invokedjava.lang.IllegalAccessException
- if the requested method is not accessible
+ via reflectionpublic static java.lang.Object invokeStaticMethod(java.lang.Class objectClass, + java.lang.String methodName, + java.lang.Object[] args) + throws java.lang.NoSuchMethodException, + java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
Invoke a named static method whose parameter type matches the object type.
+ +The behaviour of this method is less deterministic
+ than invokeExactMethod(Object object,String methodName,Object [] args)
.
+ It loops through all methods with names that match
+ and then executes the first it finds with compatable parameters.
This method supports calls to methods taking primitive parameters
+ via passing in wrapping classes. So, for example, a Boolean
class
+ would match a boolean
primitive.
This is a convenient wrapper for
+ invokeStaticMethod(Class objectClass,String methodName,Object [] args,Class[] parameterTypes)
.
+
objectClass
- invoke static method on this classmethodName
- get method with this nameargs
- use these arguments - treat null as empty arrayjava.lang.NoSuchMethodException
- if there is no such accessible methodjava.lang.reflect.InvocationTargetException
- wraps an exception thrown by the
+ method invokedjava.lang.IllegalAccessException
- if the requested method is not accessible
+ via reflectionpublic static java.lang.Object invokeStaticMethod(java.lang.Class objectClass, + java.lang.String methodName, + java.lang.Object[] args, + java.lang.Class[] parameterTypes) + throws java.lang.NoSuchMethodException, + java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
Invoke a named static method whose parameter type matches the object type.
+ +The behaviour of this method is less deterministic
+ than invokeExactStaticMethod(Class objectClass,String methodName,Object [] args,Class[] parameterTypes)
.
+ It loops through all methods with names that match
+ and then executes the first it finds with compatable parameters.
This method supports calls to methods taking primitive parameters
+ via passing in wrapping classes. So, for example, a Boolean
class
+ would match a boolean
primitive.
objectClass
- invoke static method on this classmethodName
- get method with this nameargs
- use these arguments - treat null as empty arrayparameterTypes
- match these parameters - treat null as empty arrayjava.lang.NoSuchMethodException
- if there is no such accessible methodjava.lang.reflect.InvocationTargetException
- wraps an exception thrown by the
+ method invokedjava.lang.IllegalAccessException
- if the requested method is not accessible
+ via reflectionpublic static java.lang.Object invokeExactStaticMethod(java.lang.Class objectClass, + java.lang.String methodName, + java.lang.Object arg) + throws java.lang.NoSuchMethodException, + java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
Invoke a static method whose parameter type matches exactly the object + type.
+ + This is a convenient wrapper for
+ invokeExactStaticMethod(Class objectClass,String methodName,Object [] args)
.
+
objectClass
- invoke static method on this classmethodName
- get method with this namearg
- use this argumentjava.lang.NoSuchMethodException
- if there is no such accessible methodjava.lang.reflect.InvocationTargetException
- wraps an exception thrown by the
+ method invokedjava.lang.IllegalAccessException
- if the requested method is not accessible
+ via reflectionpublic static java.lang.Object invokeExactStaticMethod(java.lang.Class objectClass, + java.lang.String methodName, + java.lang.Object[] args) + throws java.lang.NoSuchMethodException, + java.lang.IllegalAccessException, + java.lang.reflect.InvocationTargetException+
Invoke a static method whose parameter types match exactly the object + types.
+ + This uses reflection to invoke the method obtained from a call to
+ getAccessibleMethod(Class, String, Class[])
.
objectClass
- invoke static method on this classmethodName
- get method with this nameargs
- use these arguments - treat null as empty arrayjava.lang.NoSuchMethodException
- if there is no such accessible methodjava.lang.reflect.InvocationTargetException
- wraps an exception thrown by the
+ method invokedjava.lang.IllegalAccessException
- if the requested method is not accessible
+ via reflectionpublic static java.lang.reflect.Method getAccessibleMethod(java.lang.Class clazz, + java.lang.String methodName, + java.lang.Class[] parameterTypes)+
Return an accessible method (that is, one that can be invoked via
+ reflection) with given name and parameters. If no such method
+ can be found, return null
.
+ This is just a convenient wrapper for
+ getAccessibleMethod(Method method)
.
clazz
- get method from this classmethodName
- get method with this nameparameterTypes
- with these parameters typespublic static java.lang.reflect.Method getAccessibleMethod(java.lang.reflect.Method method)+
Return an accessible method (that is, one that can be invoked via
+ reflection) that implements the specified Method. If no such method
+ can be found, return null
.
method
- The method that we wish to callpublic static java.lang.reflect.Method getAccessibleMethod(java.lang.Class clazz, + java.lang.reflect.Method method)+
Return an accessible method (that is, one that can be invoked via
+ reflection) that implements the specified Method. If no such method
+ can be found, return null
.
clazz
- The class of the objectmethod
- The method that we wish to callpublic static java.lang.reflect.Method getMatchingAccessibleMethod(java.lang.Class clazz, + java.lang.String methodName, + java.lang.Class[] parameterTypes)+
Find an accessible method that matches the given name and has compatible parameters. + Compatible parameters mean that every method parameter is assignable from + the given parameters. + In other words, it finds a method with the given name + that will take the parameters given.
+ +
This method is slightly undeterminstic since it loops + through methods names and return the first matching method.
+ +This method is used by
+ invokeMethod(Object object,String methodName,Object [] args,Class[] parameterTypes)
.
+
+
This method can match primitive parameter by passing in wrapper classes.
+ For example, a Boolean
will match a primitive boolean
+ parameter.
clazz
- find method in this classmethodName
- find method with this nameparameterTypes
- find method with compatible parameterspublic static final boolean isAssignmentCompatible(java.lang.Class parameterType, + java.lang.Class parameterization)+
Determine whether a type can be used as a parameter in a method invocation. + This method handles primitive conversions correctly.
+ +In order words, it will match a Boolean
to a boolean
,
+ a Long
to a long
,
+ a Float
to a float
,
+ a Integer
to a int
,
+ and a Double
to a double
.
+ Now logic widening matches are allowed.
+ For example, a Long
will not match a int
.
parameterType
- the type of parameter accepted by the methodparameterization
- the type of parameter being testedpublic static java.lang.Class getPrimitiveWrapper(java.lang.Class primitiveType)+
boolean.class
returns Boolean.class
primitiveType
- the primitive type class for which a match is to be foundpublic static java.lang.Class getPrimitiveType(java.lang.Class wrapperType)+
Boolean.class
returns a boolean.class
.wrapperType
- thepublic static java.lang.Class toNonPrimitiveClass(java.lang.Class clazz)+
clazz
- the class to find a representation for, not nullpublic final class PrimitiveUtils
+extends java.lang.Object
+Modifier and Type | +Method and Description | +
---|---|
static <T> T |
+checkNotNull(T obj) |
+
static boolean |
+isPrimitive(java.lang.reflect.Type type)
+Returns true if this type is a primitive.
+ |
+
static boolean |
+isWrapperType(java.lang.reflect.Type type)
+Returns
+true if type is one of the nine primitive-wrapper
+ types, such as Integer . |
+
static <T> java.lang.Class<T> |
+unwrap(java.lang.Class<T> type)
+Returns the corresponding primitive type of
+type if it is a
+ wrapper type; otherwise returns type itself. |
+
static <T> java.lang.Class<T> |
+wrap(java.lang.Class<T> type)
+Returns the corresponding wrapper type of
+type if it is a
+ primitive type; otherwise returns type itself. |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static boolean isPrimitive(java.lang.reflect.Type type)+
public static boolean isWrapperType(java.lang.reflect.Type type)+
true
if type
is one of the nine primitive-wrapper
+ types, such as Integer
.Class.isPrimitive()
public static <T> java.lang.Class<T> wrap(java.lang.Class<T> type)+
type
if it is a
+ primitive type; otherwise returns type
itself. Idempotent.
+
+ + wrap(int.class) == Integer.class + wrap(Integer.class) == Integer.class + wrap(String.class) == String.class +
public static <T> java.lang.Class<T> unwrap(java.lang.Class<T> type)+
type
if it is a
+ wrapper type; otherwise returns type
itself. Idempotent.
+
+ + unwrap(Integer.class) == int.class + unwrap(int.class) == int.class + unwrap(String.class) == String.class +
public static <T> T checkNotNull(T obj)+
public class StructureModifier<TField>
+extends java.lang.Object
+Constructor and Description | +
---|
StructureModifier(java.lang.Class targetType,
+ java.lang.Class superclassExclude,
+ boolean requireDefault)
+Creates a structure modifier.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
java.util.List<java.lang.reflect.Field> |
+getFields()
+Retrieves a list of the fields matching the constraints of this structure modifier.
+ |
+
java.lang.Class |
+getFieldType()
+Retrieves the common type of each field.
+ |
+
java.lang.Object |
+getTarget()
+Retrieves the object we're currently modifying.
+ |
+
java.lang.Class |
+getTargetType()
+Retrieves the type of the object we're modifying.
+ |
+
java.util.List<TField> |
+getValues()
+Retrieve every value stored in the fields of the current type.
+ |
+
StructureModifier<TField> |
+modify(int fieldIndex,
+ com.google.common.base.Function<TField,TField> select)
+Correctly modifies the value of a field.
+ |
+
TField |
+read(int fieldIndex)
+Reads the value of a field given its index.
+ |
+
TField |
+readSafely(int fieldIndex)
+Reads the value of a field if and ONLY IF it exists.
+ |
+
int |
+size()
+Retrieve the number of readable types.
+ |
+
StructureModifier<TField> |
+withTarget(java.lang.Object target)
+Retrieves a structure modifier of the same type for a different object target.
+ |
+
<T> StructureModifier<T> |
+withType(java.lang.Class fieldType)
+Retrieves a structure modifier that only reads and writes fields of a given type.
+ |
+
<T> StructureModifier<T> |
+withType(java.lang.Class fieldType,
+ EquivalentConverter<T> converter)
+Retrieves a structure modifier that only reads and writes fields of a given type.
+ |
+
StructureModifier<TField> |
+write(int fieldIndex,
+ TField value)
+Writes the value of a field given its index.
+ |
+
StructureModifier<TField> |
+writeDefaults()
+Sets all non-primitive fields to a more fitting default value.
+ |
+
StructureModifier<TField> |
+writeSafely(int fieldIndex,
+ TField value)
+Writes the value of a given field IF and ONLY if it exists.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public StructureModifier(java.lang.Class targetType, + java.lang.Class superclassExclude, + boolean requireDefault)+
targetType
- - the structure to modify.superclassExclude
- - a superclass to exclude.requireDefault
- - whether or not we will be using writeDefaults().public TField read(int fieldIndex) + throws FieldAccessException+
fieldIndex
- - index of the field.FieldAccessException
- The field doesn't exist, or it cannot be accessed under the current security contraints.public TField readSafely(int fieldIndex) + throws FieldAccessException+
fieldIndex
- - index of the field.FieldAccessException
- The field cannot be accessed under the current security contraints.public StructureModifier<TField> write(int fieldIndex, + TField value) + throws FieldAccessException+
fieldIndex
- - index of the field.value
- - new value of the field.FieldAccessException
- The field doesn't exist, or it cannot be accessed under the current security contraints.public StructureModifier<TField> writeSafely(int fieldIndex, + TField value) + throws FieldAccessException+
fieldIndex
- - index of the potential field.value
- - new value of the field.FieldAccessException
- The field cannot be accessed under the current security contraints.public StructureModifier<TField> modify(int fieldIndex, + com.google.common.base.Function<TField,TField> select) + throws FieldAccessException+
fieldIndex
- - index of the field to modify.select
- - the function that modifies the field value.FieldAccessException
- The field cannot be accessed under the current security contraints.public <T> StructureModifier<T> withType(java.lang.Class fieldType)+
fieldType
- - the type, or supertype, of every field to modify.public StructureModifier<TField> writeDefaults() + throws FieldAccessException+
DefaultInstances.getDefault(Class)
.FieldAccessException
- If we're unable to write to the fields due to a security limitation.public <T> StructureModifier<T> withType(java.lang.Class fieldType, + EquivalentConverter<T> converter)+
fieldType
- - the type, or supertype, of every field to modify.converter
- - converts objects into the given type.public java.lang.Class getFieldType()+
public java.lang.Class getTargetType()+
public java.lang.Object getTarget()+
public int size()+
public StructureModifier<TField> withTarget(java.lang.Object target)+
target
- - different target of the same type.public java.util.List<java.lang.reflect.Field> getFields()+
public java.util.List<TField> getValues() + throws FieldAccessException+
FieldAccessException
- Unable to access one or all of the fieldspublic class StructureModifierTest
+extends java.lang.Object
+Constructor and Description | +
---|
StructureModifierTest() |
+
public void test() + throws FieldAccessException+
FieldAccessException
public class VolatileField
+extends java.lang.Object
+Constructor and Description | +
---|
VolatileField(java.lang.reflect.Field field,
+ java.lang.Object container)
+Initializes a volatile field with an associated object.
+ |
+
VolatileField(java.lang.reflect.Field field,
+ java.lang.Object container,
+ boolean forceAccess)
+Initializes a volatile field with an associated object.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
protected void |
+finalize() |
+
java.lang.Object |
+getContainer()
+Retrieves the object the field is stored.
+ |
+
java.lang.reflect.Field |
+getField()
+Retrieves the current field.
+ |
+
java.lang.Object |
+getOldValue()
+Retrieves the field value before the previous setValue(), unless saveValue() has been called.
+ |
+
java.lang.Object |
+getValue()
+Retrieves the current field value.
+ |
+
boolean |
+isForceAccess()
+Retrieves whether or not not to override any scope restrictions.
+ |
+
void |
+revertValue()
+Revert to the previously set value.
+ |
+
void |
+saveValue()
+Ensure that the current value is still set after this class has been garbaged collected.
+ |
+
void |
+setForceAccess(boolean forceAccess)
+Sets whether or not not to override any scope restrictions.
+ |
+
void |
+setValue(java.lang.Object newValue)
+Sets the current value.
+ |
+
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public VolatileField(java.lang.reflect.Field field, + java.lang.Object container)+
field
- - the field.container
- - the object this field belongs to.public VolatileField(java.lang.reflect.Field field, + java.lang.Object container, + boolean forceAccess)+
field
- - the field.container
- - the object this field belongs to.forceAccess
- - whether or not to override any scope restrictions.public java.lang.reflect.Field getField()+
public java.lang.Object getContainer()+
public boolean isForceAccess()+
public void setForceAccess(boolean forceAccess)+
forceAccess
- - TRUE if we override scope, FALSE otherwise.public java.lang.Object getValue()+
public java.lang.Object getOldValue()+
public void setValue(java.lang.Object newValue)+
newValue
- - new field value.public void saveValue()+
public void revertValue()+
protected void finalize() + throws java.lang.Throwable+
finalize
in class java.lang.Object
java.lang.Throwable
Package | +Description | +
---|---|
com.comphenix.protocol.reflect | ++ |
Modifier and Type | +Method and Description | +
---|---|
<T> StructureModifier<T> |
+StructureModifier.withType(java.lang.Class fieldType,
+ EquivalentConverter<T> converter)
+Retrieves a structure modifier that only reads and writes fields of a given type.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
com.comphenix.protocol.injector | ++ |
com.comphenix.protocol.reflect | ++ |
Modifier and Type | +Method and Description | +
---|---|
void |
+ProtocolManager.updateEntity(org.bukkit.entity.Entity entity,
+ java.util.List<org.bukkit.entity.Player> observers)
+Completely refresh all clients about an entity.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
PacketContainer |
+PacketConstructor.createPacket(java.lang.Object... values)
+Construct a packet using the special builtin Minecraft constructors.
+ |
+
void |
+PacketFilterManager.updateEntity(org.bukkit.entity.Entity entity,
+ java.util.List<org.bukkit.entity.Player> observers) |
+
Modifier and Type | +Method and Description | +
---|---|
static FieldAccessException |
+FieldAccessException.fromFormat(java.lang.String message,
+ java.lang.Object... params) |
+
Modifier and Type | +Method and Description | +
---|---|
java.util.List<TField> |
+StructureModifier.getValues()
+Retrieve every value stored in the fields of the current type.
+ |
+
StructureModifier<TField> |
+StructureModifier.modify(int fieldIndex,
+ com.google.common.base.Function<TField,TField> select)
+Correctly modifies the value of a field.
+ |
+
TField |
+StructureModifier.read(int fieldIndex)
+Reads the value of a field given its index.
+ |
+
TField |
+StructureModifier.readSafely(int fieldIndex)
+Reads the value of a field if and ONLY IF it exists.
+ |
+
void |
+StructureModifierTest.test() |
+
StructureModifier<TField> |
+StructureModifier.write(int fieldIndex,
+ TField value)
+Writes the value of a field given its index.
+ |
+
StructureModifier<TField> |
+StructureModifier.writeDefaults()
+Sets all non-primitive fields to a more fitting default value.
+ |
+
StructureModifier<TField> |
+StructureModifier.writeSafely(int fieldIndex,
+ TField value)
+Writes the value of a given field IF and ONLY if it exists.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.reflect | ++ |
Modifier and Type | +Method and Description | +
---|---|
static FuzzyReflection |
+FuzzyReflection.fromClass(java.lang.Class<?> source)
+Retrieves a fuzzy reflection instance from a given class.
+ |
+
static FuzzyReflection |
+FuzzyReflection.fromClass(java.lang.Class<?> source,
+ boolean forceAccess)
+Retrieves a fuzzy reflection instance from a given class.
+ |
+
static FuzzyReflection |
+FuzzyReflection.fromObject(java.lang.Object reference)
+Retrieves a fuzzy reflection instance from an object.
+ |
+
static FuzzyReflection |
+FuzzyReflection.fromObject(java.lang.Object reference,
+ boolean forceAccess)
+Retrieves a fuzzy reflection instance from an object.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
Modifier and Type | +Class and Description | +
---|---|
static class |
+Packets.Client
+List of packets sent by the client.
+ |
+
static class |
+Packets.Server
+List of packets sent only by the server.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.events | ++ |
com.comphenix.protocol.injector | ++ |
com.comphenix.protocol.reflect | ++ |
Modifier and Type | +Field and Description | +
---|---|
protected StructureModifier<java.lang.Object> |
+PacketContainer.structureModifier |
+
Modifier and Type | +Method and Description | +
---|---|
StructureModifier<org.bukkit.entity.Entity> |
+PacketContainer.getEntityModifier(org.bukkit.World world)
+Retrieves a read/write structure for entity objects.
+ |
+
StructureModifier<org.bukkit.inventory.ItemStack[]> |
+PacketContainer.getItemArrayModifier()
+Retrieves a read/write structure for arrays of ItemStacks.
+ |
+
StructureModifier<org.bukkit.inventory.ItemStack> |
+PacketContainer.getItemModifier()
+Retrieves a read/write structure for ItemStack.
+ |
+
StructureModifier<java.lang.Object> |
+PacketContainer.getModifier()
+Retrieves the generic structure modifier for this packet.
+ |
+
<T> StructureModifier<T> |
+PacketContainer.getSpecificModifier(java.lang.Class<T> primitiveType)
+Retrieves a read/write structure for every field with the given type.
+ |
+
StructureModifier<org.bukkit.WorldType> |
+PacketContainer.getWorldTypeModifier()
+Retrieves a read/write structure for the world type enum.
+ |
+
Constructor and Description | +
---|
PacketContainer(int id,
+ net.minecraft.server.Packet handle,
+ StructureModifier<java.lang.Object> structure)
+Creates a packet container for an existing packet.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static StructureModifier<java.lang.Object> |
+StructureCache.getStructure(int id)
+Retrieve a cached structure modifier for the given packet id.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
StructureModifier<TField> |
+StructureModifier.modify(int fieldIndex,
+ com.google.common.base.Function<TField,TField> select)
+Correctly modifies the value of a field.
+ |
+
StructureModifier<TField> |
+StructureModifier.withTarget(java.lang.Object target)
+Retrieves a structure modifier of the same type for a different object target.
+ |
+
<T> StructureModifier<T> |
+StructureModifier.withType(java.lang.Class fieldType)
+Retrieves a structure modifier that only reads and writes fields of a given type.
+ |
+
<T> StructureModifier<T> |
+StructureModifier.withType(java.lang.Class fieldType,
+ EquivalentConverter<T> converter)
+Retrieves a structure modifier that only reads and writes fields of a given type.
+ |
+
StructureModifier<TField> |
+StructureModifier.write(int fieldIndex,
+ TField value)
+Writes the value of a field given its index.
+ |
+
StructureModifier<TField> |
+StructureModifier.writeDefaults()
+Sets all non-primitive fields to a more fitting default value.
+ |
+
StructureModifier<TField> |
+StructureModifier.writeSafely(int fieldIndex,
+ TField value)
+Writes the value of a given field IF and ONLY if it exists.
+ |
+
public class CollectionGenerator +extends java.lang.Object +implements InstanceProvider+
Modifier and Type | +Field and Description | +
---|---|
static CollectionGenerator |
+INSTANCE
+Shared instance of this generator.
+ |
+
Constructor and Description | +
---|
CollectionGenerator() |
+
Modifier and Type | +Method and Description | +
---|---|
java.lang.Object |
+create(java.lang.Class<?> type)
+Create an instance given a type, if possible.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static CollectionGenerator INSTANCE+
public java.lang.Object create(@Nullable + java.lang.Class<?> type)+
InstanceProvider
create
in interface InstanceProvider
type
- - type to create.public class DefaultInstances
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
static DefaultInstances |
+DEFAULT
+Standard default instance provider.
+ |
+
Constructor and Description | +
---|
DefaultInstances(com.google.common.collect.ImmutableList<InstanceProvider> registered)
+Construct a default instance generator using the given instance providers.
+ |
+
DefaultInstances(InstanceProvider... instaceProviders)
+Construct a default instance generator using the given instance providers.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
protected <T> boolean |
+contains(T[] elements,
+ T elementToFind) |
+
protected <T> T |
+createInstance(java.lang.Class<T> type,
+ java.lang.reflect.Constructor<T> constructor,
+ java.lang.Class<?>[] types,
+ java.lang.Object[] params)
+Used by the default instance provider to create a class from a given constructor.
+ |
+
static DefaultInstances |
+fromArray(InstanceProvider... instaceProviders)
+Construct a default instance generator using the given instance providers.
+ |
+
<T> T |
+getDefault(java.lang.Class<T> type)
+Retrieves a default instance or value that is assignable to this type.
+ |
+
<T> T |
+getDefault(java.lang.Class<T> type,
+ java.util.List<InstanceProvider> providers)
+Retrieves a default instance or value that is assignable to this type.
+ |
+
com.google.common.collect.ImmutableList<InstanceProvider> |
+getRegistered()
+Retrieves a immutable list of every default object providers that generates instances.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static DefaultInstances DEFAULT+
public DefaultInstances(com.google.common.collect.ImmutableList<InstanceProvider> registered)+
registered
- - list of instance providers.public DefaultInstances(InstanceProvider... instaceProviders)+
instaceProviders
- - array of instance providers.public static DefaultInstances fromArray(InstanceProvider... instaceProviders)+
instaceProviders
- - array of instance providers.public com.google.common.collect.ImmutableList<InstanceProvider> getRegistered()+
public <T> T getDefault(java.lang.Class<T> type)+
+ This includes, but isn't limited too: +
type
- - the type to construct a default value.public <T> T getDefault(java.lang.Class<T> type, + java.util.List<InstanceProvider> providers)+
+ This includes, but isn't limited too: +
type
- - the type to construct a default value.providers
- - instance providers used during theprotected <T> T createInstance(java.lang.Class<T> type, + java.lang.reflect.Constructor<T> constructor, + java.lang.Class<?>[] types, + java.lang.Object[] params)+
type
- - the type to create.constructor
- - the constructor to use.types
- - type of each parameter in order.params
- - value of each parameter in order.protected <T> boolean contains(T[] elements, + T elementToFind)+
public interface InstanceProvider
+public class PrimitiveGenerator +extends java.lang.Object +implements InstanceProvider+
Modifier and Type | +Field and Description | +
---|---|
static PrimitiveGenerator |
+INSTANCE
+Shared instance of this generator.
+ |
+
static java.lang.String |
+STRING_DEFAULT
+Default value for Strings.
+ |
+
Constructor and Description | +
---|
PrimitiveGenerator(java.lang.String stringDefault) |
+
Modifier and Type | +Method and Description | +
---|---|
java.lang.Object |
+create(java.lang.Class<?> type)
+Create an instance given a type, if possible.
+ |
+
java.lang.String |
+getStringDefault()
+Retrieve the string default.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final java.lang.String STRING_DEFAULT+
public static PrimitiveGenerator INSTANCE+
public PrimitiveGenerator(java.lang.String stringDefault)+
public java.lang.String getStringDefault()+
public java.lang.Object create(@Nullable + java.lang.Class<?> type)+
InstanceProvider
create
in interface InstanceProvider
type
- - type to create.Package | +Description | +
---|---|
com.comphenix.protocol.reflect.instances | ++ |
Modifier and Type | +Field and Description | +
---|---|
static CollectionGenerator |
+CollectionGenerator.INSTANCE
+Shared instance of this generator.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.reflect.instances | ++ |
Modifier and Type | +Field and Description | +
---|---|
static DefaultInstances |
+DefaultInstances.DEFAULT
+Standard default instance provider.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static DefaultInstances |
+DefaultInstances.fromArray(InstanceProvider... instaceProviders)
+Construct a default instance generator using the given instance providers.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.reflect.instances | ++ |
Modifier and Type | +Class and Description | +
---|---|
class |
+CollectionGenerator
+Provides simple constructors for collection interfaces.
+ |
+
class |
+PrimitiveGenerator
+Provides constructors for primtive types, wrappers, arrays and strings.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
com.google.common.collect.ImmutableList<InstanceProvider> |
+DefaultInstances.getRegistered()
+Retrieves a immutable list of every default object providers that generates instances.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static DefaultInstances |
+DefaultInstances.fromArray(InstanceProvider... instaceProviders)
+Construct a default instance generator using the given instance providers.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
<T> T |
+DefaultInstances.getDefault(java.lang.Class<T> type,
+ java.util.List<InstanceProvider> providers)
+Retrieves a default instance or value that is assignable to this type.
+ |
+
Constructor and Description | +
---|
DefaultInstances(InstanceProvider... instaceProviders)
+Construct a default instance generator using the given instance providers.
+ |
+
Constructor and Description | +
---|
DefaultInstances(com.google.common.collect.ImmutableList<InstanceProvider> registered)
+Construct a default instance generator using the given instance providers.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.reflect.instances | ++ |
Modifier and Type | +Field and Description | +
---|---|
static PrimitiveGenerator |
+PrimitiveGenerator.INSTANCE
+Shared instance of this generator.
+ |
+
Interface | +Description | +
---|---|
InstanceProvider | +
+ Represents a type generator for specific types.
+ |
+
Class | +Description | +
---|---|
CollectionGenerator | +
+ Provides simple constructors for collection interfaces.
+ |
+
DefaultInstances | +
+ Used to construct default instances of any type.
+ |
+
PrimitiveGenerator | +
+ Provides constructors for primtive types, wrappers, arrays and strings.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol.reflect.instances | ++ |
Class and Description | +
---|
CollectionGenerator
+ Provides simple constructors for collection interfaces.
+ |
+
DefaultInstances
+ Used to construct default instances of any type.
+ |
+
InstanceProvider
+ Represents a type generator for specific types.
+ |
+
PrimitiveGenerator
+ Provides constructors for primtive types, wrappers, arrays and strings.
+ |
+
Interface | +Description | +
---|---|
EquivalentConverter<TType> | +
+ Interface that converts generic objects into types and back.
+ |
+
Class | +Description | +
---|---|
FieldUtils | +
+ Utilities for working with fields by reflection.
+ |
+
FuzzyReflection | +
+ Retrieves fields and methods by signature, not just name.
+ |
+
IntEnum | +
+ Represents a traditional int field enum.
+ |
+
MethodUtils | +
+ Utility reflection methods focussed on methods in general rather than properties in particular.
+ |
+
PrimitiveUtils | +
+ Contains static utility methods pertaining to primitive types and their
+ corresponding wrapper types.
+ |
+
StructureModifier<TField> | ++ |
StructureModifierTest | ++ |
VolatileField | +
+ Represents a field that will revert to its original state when this class is garbaged collected.
+ |
+
Exception | +Description | +
---|---|
FieldAccessException | +
+ Invoked when a field is inaccessible due to security limitations, or when it simply doesn't exist.
+ |
+
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
com.comphenix.protocol.events | ++ |
com.comphenix.protocol.injector | ++ |
com.comphenix.protocol.reflect | ++ |
Class and Description | +
---|
FieldAccessException
+ Invoked when a field is inaccessible due to security limitations, or when it simply doesn't exist.
+ |
+
IntEnum
+ Represents a traditional int field enum.
+ |
+
Class and Description | +
---|
StructureModifier | +
Class and Description | +
---|
FieldAccessException
+ Invoked when a field is inaccessible due to security limitations, or when it simply doesn't exist.
+ |
+
StructureModifier | +
Class and Description | +
---|
EquivalentConverter
+ Interface that converts generic objects into types and back.
+ |
+
FieldAccessException
+ Invoked when a field is inaccessible due to security limitations, or when it simply doesn't exist.
+ |
+
FuzzyReflection
+ Retrieves fields and methods by signature, not just name.
+ |
+
StructureModifier | +
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final int |
+ABILITIES |
+202 |
+
+
+public static final int |
+ARM_ANIMATION |
+18 |
+
+
+public static final int |
+BLOCK_DIG |
+14 |
+
+
+public static final int |
+BLOCK_ITEM_SWITCH |
+16 |
+
+
+public static final int |
+BUTTON_CLICK |
+108 |
+
+
+public static final int |
+CHAT |
+3 |
+
+
+public static final int |
+CLIENT_COMMAND |
+205 |
+
+
+public static final int |
+CLOSE_WINDOW |
+101 |
+
+
+public static final int |
+CUSTOM_PAYLOAD |
+250 |
+
+
+public static final int |
+ENTITY_ACTION |
+19 |
+
+
+public static final int |
+FLYING |
+10 |
+
+
+public static final int |
+GET_INFO |
+254 |
+
+
+public static final int |
+HANDSHAKE |
+2 |
+
+
+public static final int |
+KEEP_ALIVE |
+0 |
+
+
+public static final int |
+KEY_RESPONSE |
+252 |
+
+
+public static final int |
+KICK_DISCONNECT |
+255 |
+
+
+public static final int |
+LOCALE_AND_VIEW_DISTANCE |
+204 |
+
+
+public static final int |
+LOGIN |
+1 |
+
+
+public static final int |
+PLACE |
+15 |
+
+
+public static final int |
+PLAYER_LOOK |
+12 |
+
+
+public static final int |
+PLAYER_LOOK_MOVE |
+13 |
+
+
+public static final int |
+PLAYER_POSITION |
+11 |
+
+
+public static final int |
+RESPAWN |
+9 |
+
+
+public static final int |
+SET_CREATIVE_SLOT |
+107 |
+
+
+public static final int |
+TAB_COMPLETE |
+203 |
+
+
+public static final int |
+TRANSACTION |
+106 |
+
+
+public static final int |
+UPDATE_SIGN |
+130 |
+
+
+public static final int |
+USE_ENTITY |
+7 |
+
+
+public static final int |
+WINDOW_CLICK |
+102 |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final int |
+ABILITIES |
+202 |
+
+
+public static final int |
+ADD_EXP_ORB |
+26 |
+
+
+public static final int |
+ARM_ANIMATION |
+18 |
+
+
+public static final int |
+ATTACH_ENTITY |
+39 |
+
+
+public static final int |
+BED |
+70 |
+
+
+public static final int |
+BLOCK_BREAK_ANIMATION |
+55 |
+
+
+public static final int |
+BLOCK_CHANGE |
+53 |
+
+
+public static final int |
+CHAT |
+3 |
+
+
+public static final int |
+CLOSE_WINDOW |
+101 |
+
+
+public static final int |
+COLLECT |
+22 |
+
+
+public static final int |
+CRAFT_PROGRESS_BAR |
+105 |
+
+
+public static final int |
+CUSTOM_PAYLOAD |
+250 |
+
+
+public static final int |
+DESTROY_ENTITY |
+29 |
+
+
+public static final int |
+ENTITY |
+30 |
+
+
+public static final int |
+ENTITY_EQUIPMENT |
+5 |
+
+
+public static final int |
+ENTITY_HEAD_ROTATION |
+35 |
+
+
+public static final int |
+ENTITY_LOCATION_ACTION |
+17 |
+
+
+public static final int |
+ENTITY_LOOK |
+32 |
+
+
+public static final int |
+ENTITY_METADATA |
+40 |
+
+
+public static final int |
+ENTITY_PAINTING |
+25 |
+
+
+public static final int |
+ENTITY_STATUS |
+38 |
+
+
+public static final int |
+ENTITY_TELEPORT |
+34 |
+
+
+public static final int |
+ENTITY_VELOCITY |
+28 |
+
+
+public static final int |
+EXPLOSION |
+60 |
+
+
+public static final int |
+FLYING |
+10 |
+
+
+public static final int |
+ITEM_DATA |
+131 |
+
+
+public static final int |
+KEEP_ALIVE |
+0 |
+
+
+public static final int |
+KEY_REQUEST |
+253 |
+
+
+public static final int |
+KEY_RESPONSE |
+252 |
+
+
+public static final int |
+KICK_DISCONNECT |
+255 |
+
+
+public static final int |
+LOGIN |
+1 |
+
+
+public static final int |
+MAP_CHUNK |
+51 |
+
+
+public static final int |
+MAP_CHUNK_BULK |
+56 |
+
+
+public static final int |
+MOB_EFFECT |
+41 |
+
+
+public static final int |
+MOB_SPAWN |
+24 |
+
+
+public static final int |
+MULTI_BLOCK_CHANGE |
+52 |
+
+
+public static final int |
+NAMED_ENTITY_SPAWN |
+20 |
+
+
+public static final int |
+NAMED_SOUND_EFFECT |
+62 |
+
+
+public static final int |
+OPEN_WINDOW |
+100 |
+
+
+public static final int |
+PICKUP_SPAWN |
+21 |
+
+
+public static final int |
+PLAY_NOTE_BLOCK |
+54 |
+
+
+public static final int |
+PLAYER_INFO |
+201 |
+
+
+public static final int |
+PLAYER_LOOK |
+12 |
+
+
+public static final int |
+PLAYER_LOOK_MOVE |
+13 |
+
+
+public static final int |
+PLAYER_POSITION |
+11 |
+
+
+public static final int |
+REL_ENTITY_MOVE |
+31 |
+
+
+public static final int |
+REL_ENTITY_MOVE_LOOK |
+33 |
+
+
+public static final int |
+REMOVE_MOB_EFFECT |
+42 |
+
+
+public static final int |
+RESPAWN |
+9 |
+
+
+public static final int |
+SET_CREATIVE_SLOT |
+107 |
+
+
+public static final int |
+SET_EXPERIENCE |
+43 |
+
+
+public static final int |
+SET_SLOT |
+103 |
+
+
+public static final int |
+SPAWN_POSITION |
+6 |
+
+
+public static final int |
+STATISTIC |
+200 |
+
+
+public static final int |
+TAB_COMPLETE |
+203 |
+
+
+public static final int |
+TILE_ENTITY_DATA |
+132 |
+
+
+public static final int |
+TRANSACTION |
+106 |
+
+
+public static final int |
+UPDATE_HEALTH |
+8 |
+
+
+public static final int |
+UPDATE_SIGN |
+130 |
+
+
+public static final int |
+UPDATE_TIME |
+4 |
+
+
+public static final int |
+VEHICLE_SPAWN |
+23 |
+
+
+public static final int |
+WEATHER |
+71 |
+
+
+public static final int |
+WINDOW_ITEMS |
+104 |
+
+
+public static final int |
+WORLD_EVENT |
+61 |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final java.lang.String |
+STRING_DEFAULT |
+"" |
+
The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+Each annotation type has its own separate page with the following sections:
+Each enum has its own separate page with the following sections:
+Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object
. The interfaces do not inherit from java.lang.Object
.
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+These links take you to the next or previous class, interface, package, or related page.
+These links show and hide the HTML frames. All pages are available with or without frames.
+The All Classes link shows all classes and interfaces except non-static nested types.
+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
+The Constant Field Values page lists the static final fields and their values.
+true
.type
if it is a
+ wrapper type; otherwise returns type
itself.type
if it is a
+ primitive type; otherwise returns type
itself.Field
by name respecting scope.Field
by name breaking scope if
+ requested.true
if type
is one of the nine primitive-wrapper
+ types, such as Integer
.+ + diff --git a/Javadoc/overview-summary.html b/Javadoc/overview-summary.html new file mode 100644 index 00000000..0f26239e --- /dev/null +++ b/Javadoc/overview-summary.html @@ -0,0 +1,150 @@ + + + + + +
Package | +Description | +
---|---|
com.comphenix.protocol | ++ |
com.comphenix.protocol.concurrency | ++ |
com.comphenix.protocol.events | ++ |
com.comphenix.protocol.injector | ++ |
com.comphenix.protocol.metrics | ++ |
com.comphenix.protocol.reflect | ++ |
com.comphenix.protocol.reflect.instances | ++ |
PacketContainer packet+
org.bukkit.entity.Player player+
boolean serverPacket+
boolean cancel+