diff --git a/Javadoc/allclasses-frame.html b/Javadoc/allclasses-frame.html deleted file mode 100644 index 83527ff6..00000000 --- a/Javadoc/allclasses-frame.html +++ /dev/null @@ -1,133 +0,0 @@ - - - -
- -public class Application
-extends java.lang.Object
-Constructor and Description | -
---|
Application() |
-
public interface AsynchronousManager
-Modifier and Type | -Method and Description | -
---|---|
void |
-cleanupAll()
-Remove listeners, close threads and transmit every delayed packet.
- |
-
ErrorReporter |
-getErrorReporter()
-Retrieve the default error reporter.
- |
-
PacketStream |
-getPacketStream()
-Retrieve the default packet stream.
- |
-
java.util.Set<java.lang.Integer> |
-getReceivingFilters()
-Retrieves a immutable set containing the ID of the recieved client packets that will be
- observed by the asynchronous 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 the asynchronous listeners.
- |
-
java.util.Set<PacketListener> |
-getTimeoutHandlers()
-Get a immutable list of every registered timeout handler.
- |
-
boolean |
-hasAsynchronousListeners(PacketEvent packet)
-Determine if a given synchronous packet has asynchronous listeners.
- |
-
AsyncListenerHandler |
-registerAsyncHandler(PacketListener listener)
-Registers an asynchronous packet handler.
- |
-
void |
-registerTimeoutHandler(PacketListener listener)
-Register a synchronous listener that handles packets when they time out.
- |
-
void |
-signalPacketTransmission(PacketEvent packet)
-Signal that a packet is ready to be transmitted.
- |
-
void |
-unregisterAsyncHandler(AsyncListenerHandler handler)
-Unregisters and closes the given asynchronous handler.
- |
-
void |
-unregisterAsyncHandlers(org.bukkit.plugin.Plugin plugin)
-Unregisters every asynchronous handler associated with this plugin.
- |
-
void |
-unregisterTimeoutHandler(PacketListener listener)
-Unregisters a given timeout listener.
- |
-
AsyncListenerHandler registerAsyncHandler(PacketListener listener)-
- Use AsyncMarker.incrementProcessingDelay()
to delay a packet until its ready to be transmitted.
-
- To start listening asynchronously, pass the getListenerLoop() runnable to a different thread.
listener
- - the packet listener that will recieve these asynchronous events.void unregisterAsyncHandler(AsyncListenerHandler handler)-
handler
- - asynchronous handler.void unregisterAsyncHandlers(org.bukkit.plugin.Plugin plugin)-
plugin
- - the original plugin.java.util.Set<java.lang.Integer> getSendingFilters()-
java.util.Set<java.lang.Integer> getReceivingFilters()-
boolean hasAsynchronousListeners(PacketEvent packet)-
packet
- - packet to test.PacketStream getPacketStream()-
ErrorReporter getErrorReporter()-
void cleanupAll()-
void signalPacketTransmission(PacketEvent packet)-
- This should only be called if AsyncMarker.incrementProcessingDelay()
- has been called previously.
packet
- - packet to signal.void registerTimeoutHandler(PacketListener listener)-
listener
- - synchronous listener that will handle timed out packets.void unregisterTimeoutHandler(PacketListener listener)-
listener
- - the timeout listener to unregister.java.util.Set<PacketListener> getTimeoutHandlers()-
public class BukkitInitialization
-extends java.lang.Object
-Constructor and Description | -
---|
BukkitInitialization() |
-
Modifier and Type | -Method and Description | -
---|---|
static void |
-initializeItemMeta()
-Initialize Bukkit and ProtocolLib such that we can perfrom unit testing.
- |
-
static void |
-initializePackage()
-Ensure that package names are correctly set up.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static void initializeItemMeta() - throws java.lang.IllegalAccessException-
java.lang.IllegalAccessException
- If we are unable to initialize Bukkit.public static void initializePackage()-
public static class CommandFilter.Filter
-extends java.lang.Object
-Constructor and Description | -
---|
CommandFilter.Filter(java.lang.String name,
- java.lang.String predicate,
- java.util.Set<java.lang.Integer> packets)
-Construct a new immutable filter.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-close(javax.script.ScriptEngine context)
-Clean up all associated code from this filter in the provided script engine.
- |
-
void |
-compile(javax.script.ScriptEngine context)
-Force the compilation of a specific filter.
- |
-
boolean |
-evaluate(javax.script.ScriptEngine context,
- PacketEvent event)
-Evaluate the current filter using the provided ScriptEngine as context.
- |
-
java.lang.String |
-getName()
-Retrieve the unique name of the filter.
- |
-
java.lang.String |
-getPredicate()
-Retrieve the JavaScript predicate that will be used to filter packet events.
- |
-
java.util.Set<java.lang.Integer> |
-getRanges()
-Retrieve a copy of the set of packets this filter applies to.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public CommandFilter.Filter(java.lang.String name, - java.lang.String predicate, - java.util.Set<java.lang.Integer> packets)-
name
- - the unique name of the filter.predicate
- - the JavaScript predicate that will be used to filter packet events.ranges
- - a list of valid packet ID ranges that this filter applies to.public java.lang.String getName()-
public java.lang.String getPredicate()-
public java.util.Set<java.lang.Integer> getRanges()-
public boolean evaluate(javax.script.ScriptEngine context, - PacketEvent event) - throws javax.script.ScriptException-
- This context may be modified with additional code.
context
- - the current script context.event
- - the packet event to evaluate.javax.script.ScriptException
- If the compilation failed or the filter is not valid.public void compile(javax.script.ScriptEngine context) - throws javax.script.ScriptException-
context
- - the current script context.javax.script.ScriptException
- If the compilation failed.public void close(javax.script.ScriptEngine context)-
context
- - the current script context.public static interface CommandFilter.FilterFailedHandler
-Modifier and Type | -Method and Description | -
---|---|
boolean |
-handle(PacketEvent event,
- CommandFilter.Filter filter,
- java.lang.Exception ex)
-Invoked when a given filter has failed.
- |
-
boolean handle(PacketEvent event, - CommandFilter.Filter filter, - java.lang.Exception ex)-
event
- - the packet event.filter
- - the filter that failed.ex
- - the failure.public class CommandFilter
-extends java.lang.Object
-Modifier and Type | -Class and Description | -
---|---|
static class |
-CommandFilter.Filter
-A filter that will be used to process a packet event.
- |
-
static interface |
-CommandFilter.FilterFailedHandler |
-
Modifier and Type | -Field and Description | -
---|---|
static java.lang.String |
-NAME
-Name of this command.
- |
-
static java.lang.String |
-PERMISSION_ADMIN |
-
static ReportType |
-REPORT_CANNOT_HANDLE_CONVERSATION |
-
static ReportType |
-REPORT_CANNOT_LOAD_FALLBACK_ENGINE |
-
static ReportType |
-REPORT_COMMAND_ERROR |
-
static ReportType |
-REPORT_FALLBACK_ENGINE |
-
static ReportType |
-REPORT_FILTER_REMOVED_FOR_ERROR |
-
static ReportType |
-REPORT_PACKAGES_UNSUPPORTED_IN_ENGINE |
-
static ReportType |
-REPORT_UNEXPECTED_COMMAND |
-
protected ErrorReporter |
-reporter |
-
Constructor and Description | -
---|
CommandFilter(ErrorReporter reporter,
- org.bukkit.plugin.Plugin plugin,
- com.comphenix.protocol.ProtocolConfig config) |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-filterEvent(PacketEvent event)
-Determine whether or not to pass the given packet event to the packet listeners.
- |
-
boolean |
-filterEvent(PacketEvent event,
- CommandFilter.FilterFailedHandler handler)
-Determine whether or not to pass the given packet event to the packet listeners.
- |
-
java.lang.String |
-getName()
-Retrieve the primary name of this command.
- |
-
java.lang.String |
-getPermission()
-Retrieve the permission necessary to execute this command.
- |
-
protected ErrorReporter |
-getReporter()
-Retrieve the error reporter.
- |
-
protected boolean |
-handleCommand(org.bukkit.command.CommandSender sender,
- java.lang.String[] args)
-Main implementation of this command.
- |
-
boolean |
-isInitialized()
-Determine if the filter engine has been successfully initialized.
- |
-
boolean |
-onCommand(org.bukkit.command.CommandSender sender,
- org.bukkit.command.Command command,
- java.lang.String label,
- java.lang.String[] args) |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final ReportType REPORT_FALLBACK_ENGINE-
public static final ReportType REPORT_CANNOT_LOAD_FALLBACK_ENGINE-
public static final ReportType REPORT_PACKAGES_UNSUPPORTED_IN_ENGINE-
public static final ReportType REPORT_FILTER_REMOVED_FOR_ERROR-
public static final ReportType REPORT_CANNOT_HANDLE_CONVERSATION-
public static final java.lang.String NAME-
public static final ReportType REPORT_COMMAND_ERROR-
public static final ReportType REPORT_UNEXPECTED_COMMAND-
public static final java.lang.String PERMISSION_ADMIN-
protected ErrorReporter reporter-
public CommandFilter(ErrorReporter reporter, - org.bukkit.plugin.Plugin plugin, - com.comphenix.protocol.ProtocolConfig config)-
public boolean isInitialized()-
public boolean filterEvent(PacketEvent event)-
- Uses a default filter failure handler that simply prints the error message and removes the filter.
event
- - the event.public boolean filterEvent(PacketEvent event, - CommandFilter.FilterFailedHandler handler)-
event
- - the event.handler
- - failure handler.FilterFailedException
- If one of the filters failed.protected boolean handleCommand(org.bukkit.command.CommandSender sender, - java.lang.String[] args)-
sender
- - command sender.public final boolean onCommand(org.bukkit.command.CommandSender sender, - org.bukkit.command.Command command, - java.lang.String label, - java.lang.String[] args)-
onCommand
in interface org.bukkit.command.CommandExecutor
public java.lang.String getPermission()-
public java.lang.String getName()-
protected ErrorReporter getReporter()-
public class MinecraftVersionTest
-extends java.lang.Object
-Constructor and Description | -
---|
MinecraftVersionTest() |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-testComparision() |
-
void |
-testParsing() |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public interface PacketStream
-Modifier and Type | -Method and Description | -
---|---|
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 |
-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 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 below ListenerPriority.MONITOR
.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 below ListenerPriority.MONITOR
.java.lang.reflect.InvocationTargetException
- If the reflection machinery failed.java.lang.IllegalAccessException
- If the underlying method caused an error.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
-Deprecated.
- |
-
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.
- |
-
static java.util.Set<java.lang.Integer> |
-getSupported()
-Retrieve every client packet the current version of Minecraft is aware of.
- |
-
static boolean |
-isSupported(int packetID)
-Determine if the given packet is a valid client packet in the current version of Minecraft.
- |
-
getDeclaredName, hasMember, registerAll, registerMember, valueOf, values
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-
@Deprecated -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()-
public static boolean isSupported(int packetID) - throws FieldAccessException-
packetID
- - the packet to test.FieldAccessException
- If we're unable to retrieve the client packet data from Minecraft.public static java.util.Set<java.lang.Integer> getSupported() - throws FieldAccessException-
FieldAccessException
- If we're unable to retrieve the client packet data from Minecraft.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 |
-BLOCK_ITEM_SWITCH
-Made bi-directional in 1.4.6.
- |
-
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 |
-DISPLAY_SCOREBOARD |
-
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
-Deprecated.
- |
-
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 |
-SCOREBOARD_OBJECTIVE |
-
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 |
-TEAMS |
-
static int |
-TILE_ENTITY_DATA |
-
static int |
-TRANSACTION |
-
static int |
-UPDATE_HEALTH |
-
static int |
-UPDATE_SCORE |
-
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.
- |
-
static java.util.Set<java.lang.Integer> |
-getSupported()
-Retrieve every client packet the current version of Minecraft is aware of.
- |
-
static boolean |
-isSupported(int packetID)
-Determine if the given packet is a valid server packet in the current version of Minecraft.
- |
-
getDeclaredName, hasMember, registerAll, registerMember, valueOf, values
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 BLOCK_ITEM_SWITCH-
public static final int ENTITY_LOCATION_ACTION-
public static final int ARM_ANIMATION-
public static final int NAMED_ENTITY_SPAWN-
@Deprecated -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 SCOREBOARD_OBJECTIVE-
public static final int UPDATE_SCORE-
public static final int DISPLAY_SCOREBOARD-
public static final int TEAMS-
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 static boolean isSupported(int packetID) - throws FieldAccessException-
packetID
- - the packet to test.FieldAccessException
- If we're unable to retrieve the server packet data from Minecraft.public static java.util.Set<java.lang.Integer> getSupported() - throws FieldAccessException-
FieldAccessException
- If we're unable to retrieve the server packet data from Minecraft.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 | -Field and Description | -
---|---|
static int |
-MAXIMUM_PACKET_ID
-The highest possible packet ID.
- |
-
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 final int MAXIMUM_PACKET_ID-
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
-Modifier and Type | -Field and Description | -
---|---|
static ReportType |
-REPORT_CANNOT_CREATE_TIMEOUT_TASK |
-
static ReportType |
-REPORT_CANNOT_DELETE_CONFIG |
-
static ReportType |
-REPORT_CANNOT_DETECT_CONFLICTING_PLUGINS |
-
static ReportType |
-REPORT_CANNOT_LOAD_CONFIG |
-
static ReportType |
-REPORT_CANNOT_PARSE_INJECTION_METHOD |
-
static ReportType |
-REPORT_CANNOT_PARSE_MINECRAFT_VERSION |
-
static ReportType |
-REPORT_CANNOT_REGISTER_COMMAND |
-
static ReportType |
-REPORT_CANNOT_UPDATE_PLUGIN |
-
static ReportType |
-REPORT_METRICS_GENERIC_ERROR |
-
static ReportType |
-REPORT_METRICS_IO_ERROR |
-
static ReportType |
-REPORT_PLUGIN_ENABLE_ERROR |
-
static ReportType |
-REPORT_PLUGIN_LOAD_ERROR |
-
Constructor and Description | -
---|
ProtocolLibrary() |
-
Modifier and Type | -Method and Description | -
---|---|
static ErrorReporter |
-getErrorReporter()
-Retrieve the current error reporter.
- |
-
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() |
-
void |
-reloadConfig() |
-
getClassLoader, getCommand, getConfig, getDatabase, getDatabaseClasses, getDataFolder, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPluginLoader, getResource, getServer, initialize, installDDL, isEnabled, isInitialized, isNaggable, onCommand, onTabComplete, removeDDL, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toString
equals, getName, hashCode
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public static final ReportType REPORT_CANNOT_LOAD_CONFIG-
public static final ReportType REPORT_CANNOT_DELETE_CONFIG-
public static final ReportType REPORT_CANNOT_PARSE_INJECTION_METHOD-
public static final ReportType REPORT_PLUGIN_LOAD_ERROR-
public static final ReportType REPORT_PLUGIN_ENABLE_ERROR-
public static final ReportType REPORT_METRICS_IO_ERROR-
public static final ReportType REPORT_METRICS_GENERIC_ERROR-
public static final ReportType REPORT_CANNOT_PARSE_MINECRAFT_VERSION-
public static final ReportType REPORT_CANNOT_DETECT_CONFLICTING_PLUGINS-
public static final ReportType REPORT_CANNOT_REGISTER_COMMAND-
public static final ReportType REPORT_CANNOT_CREATE_TIMEOUT_TASK-
public static final ReportType REPORT_CANNOT_UPDATE_PLUGIN-
public void onLoad()-
onLoad
in interface org.bukkit.plugin.Plugin
onLoad
in class org.bukkit.plugin.java.JavaPlugin
public void reloadConfig()-
reloadConfig
in interface org.bukkit.plugin.Plugin
reloadConfig
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 ErrorReporter getErrorReporter()-
- This is guaranteed to not be NULL in 2.5.0 and later.
public static ProtocolManager getProtocolManager()-
public Statistics getStatistics()-
- Note that this method may return NULL when the server is reloading or shutting down. It is also - NULL if metrics has been disabled.
public interface ProtocolManager -extends PacketStream-
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.
- |
-
com.comphenix.protocol.injector.PacketConstructor |
-createPacketConstructor(int id,
- java.lang.Object... arguments)
-Construct a packet using the special builtin Minecraft constructors.
- |
-
AsynchronousManager |
-getAsynchronousManager()
-Retrieve the current asyncronous packet manager.
- |
-
org.bukkit.entity.Entity |
-getEntityFromID(org.bukkit.World container,
- int id)
-Retrieve the associated entity.
- |
-
java.util.List<org.bukkit.entity.Player> |
-getEntityTrackers(org.bukkit.entity.Entity entity)
-Retrieve every client that is receiving information about a given entity.
- |
-
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,
- 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,
- 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 resend an entity to a list of clients.
- |
-
recieveClientPacket, sendServerPacket
void sendServerPacket(org.bukkit.entity.Player reciever, - PacketContainer packet, - boolean filters) - throws java.lang.reflect.InvocationTargetException-
- Re-sending a previously cancelled packet is discuraged. Use AsyncMarker.incrementProcessingDelay()
- to delay a packet until a certain condition has been met.
sendServerPacket
in interface PacketStream
reciever
- - the reciever.packet
- - packet to send.filters
- - whether or not to invoke any packet filters below ListenerPriority.MONITOR
.java.lang.reflect.InvocationTargetException
- - if an error occured when sending the packet.void recieveClientPacket(org.bukkit.entity.Player sender, - PacketContainer packet, - boolean filters) - throws java.lang.IllegalAccessException, - java.lang.reflect.InvocationTargetException-
- Receiving a previously cancelled packet is discuraged. Use AsyncMarker.incrementProcessingDelay()
- to delay a packet until a certain condition has been met.
recieveClientPacket
in interface PacketStream
sender
- - the sender.packet
- - the packet that was sent.filters
- - whether or not to invoke any packet filters below ListenerPriority.MONITOR
.java.lang.reflect.InvocationTargetException
- If the reflection machinery failed.java.lang.IllegalAccessException
- If the underlying method caused an error.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.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.com.comphenix.protocol.injector.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-
- Note that this method is NOT thread safe. If you call this method from anything - but the main thread, it will throw an exception.
entity
- - entity to refresh.observers
- - the clients to update.FieldAccessException
org.bukkit.entity.Entity getEntityFromID(org.bukkit.World container, - int id) - throws FieldAccessException-
container
- - the world the entity belongs to.id
- - the unique ID of the entity.FieldAccessException
- Reflection failed.java.util.List<org.bukkit.entity.Player> getEntityTrackers(org.bukkit.entity.Entity entity) - throws FieldAccessException-
entity
- - the entity that is being tracked.FieldAccessException
- If reflection failed.java.util.Set<java.lang.Integer> getSendingFilters()-
java.util.Set<java.lang.Integer> getReceivingFilters()-
boolean isClosed()-
AsynchronousManager getAsynchronousManager()-
public class AsyncFilterManager -extends java.lang.Object -implements AsynchronousManager-
- By using AsyncMarker.incrementProcessingDelay()
, a packet can be delayed without having to block the
- processing thread.
Constructor and Description | -
---|
AsyncFilterManager(ErrorReporter reporter,
- org.bukkit.scheduler.BukkitScheduler scheduler,
- ProtocolManager manager)
-Initialize a asynchronous filter manager.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-cleanupAll()
-Remove listeners, close threads and transmit every delayed packet.
- |
-
AsyncMarker |
-createAsyncMarker()
-Construct a asynchronous marker with all the default values.
- |
-
AsyncMarker |
-createAsyncMarker(long sendingDelta,
- long timeoutDelta)
-Construct an async marker with the given sending priority delta and timeout delta.
- |
-
void |
-enqueueSyncPacket(PacketEvent syncPacket,
- AsyncMarker asyncMarker)
-Enqueue a packet for asynchronous processing.
- |
-
ErrorReporter |
-getErrorReporter()
-Retrieve the default error reporter.
- |
-
PacketStream |
-getPacketStream()
-Retrieve the default packet stream.
- |
-
com.comphenix.protocol.async.PacketProcessingQueue |
-getProcessingQueue(PacketEvent packet)
-Retrieve the processing queue this packet belongs to.
- |
-
java.util.Set<java.lang.Integer> |
-getReceivingFilters()
-Retrieves a immutable set containing the ID of the recieved client packets that will be
- observed by the asynchronous listeners.
- |
-
org.bukkit.scheduler.BukkitScheduler |
-getScheduler()
-Retrieve the current task scheduler.
- |
-
java.util.Set<java.lang.Integer> |
-getSendingFilters()
-Retrieves a immutable set containing the ID of the sent server packets that will be
- observed by the asynchronous listeners.
- |
-
com.comphenix.protocol.async.PacketSendingQueue |
-getSendingQueue(PacketEvent packet)
-Retrieve the sending queue this packet belongs to.
- |
-
com.comphenix.protocol.async.PacketSendingQueue |
-getSendingQueue(PacketEvent packet,
- boolean createNew)
-Retrieve the sending queue this packet belongs to.
- |
-
java.util.Set<PacketListener> |
-getTimeoutHandlers()
-Get a immutable list of every registered timeout handler.
- |
-
boolean |
-hasAsynchronousListeners(PacketEvent packet)
-Determine if a given synchronous packet has asynchronous listeners.
- |
-
AsyncListenerHandler |
-registerAsyncHandler(PacketListener listener)
-Registers an asynchronous packet handler.
- |
-
AsyncListenerHandler |
-registerAsyncHandler(PacketListener listener,
- boolean autoInject)
-Registers an asynchronous packet handler.
- |
-
void |
-registerTimeoutHandler(PacketListener listener)
-Register a synchronous listener that handles packets when they time out.
- |
-
void |
-removePlayer(org.bukkit.entity.Player player)
-Clean up after a given player has logged out.
- |
-
void |
-sendProcessedPackets(int tickCounter,
- boolean onMainThread)
-Send any due packets, or clean up packets that have expired.
- |
-
void |
-signalFreeProcessingSlot(PacketEvent packet)
-Signal that a packet has finished processing.
- |
-
void |
-signalPacketTransmission(PacketEvent packet)
-Signal that a packet is ready to be transmitted.
- |
-
void |
-unregisterAsyncHandler(AsyncListenerHandler handler)
-Unregisters and closes the given asynchronous handler.
- |
-
void |
-unregisterAsyncHandlers(org.bukkit.plugin.Plugin plugin)
-Unregisters every asynchronous handler associated with this plugin.
- |
-
void |
-unregisterTimeoutHandler(PacketListener listener)
-Unregisters a given timeout listener.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public AsyncFilterManager(ErrorReporter reporter, - org.bukkit.scheduler.BukkitScheduler scheduler, - ProtocolManager manager)-
- Internal method. Retrieve the global asynchronous manager from the protocol manager instead.
reporter
- - desired error reporter.scheduler
- - task scheduler.manager
- - protocol manager.public AsyncListenerHandler registerAsyncHandler(PacketListener listener)-
AsynchronousManager
- Use AsyncMarker.incrementProcessingDelay()
to delay a packet until its ready to be transmitted.
-
- To start listening asynchronously, pass the getListenerLoop() runnable to a different thread.
registerAsyncHandler
in interface AsynchronousManager
listener
- - the packet listener that will recieve these asynchronous events.public void registerTimeoutHandler(PacketListener listener)-
AsynchronousManager
registerTimeoutHandler
in interface AsynchronousManager
listener
- - synchronous listener that will handle timed out packets.public java.util.Set<PacketListener> getTimeoutHandlers()-
AsynchronousManager
getTimeoutHandlers
in interface AsynchronousManager
public AsyncListenerHandler registerAsyncHandler(PacketListener listener, - boolean autoInject)-
- Use AsyncMarker.incrementProcessingDelay()
to delay a packet until its ready to be transmitted.
-
- To start listening asynchronously, pass the getListenerLoop() runnable to a different thread. -
- Asynchronous events will only be executed if a synchronous listener with the same packets is registered. - If you already have a synchronous event, call this method with autoInject set to FALSE.
listener
- - the packet listener that will recieve these asynchronous events.autoInject
- - whether or not to automatically create the corresponding synchronous listener,public void unregisterTimeoutHandler(PacketListener listener)-
AsynchronousManager
unregisterTimeoutHandler
in interface AsynchronousManager
listener
- - the timeout listener to unregister.public void unregisterAsyncHandler(AsyncListenerHandler handler)-
AsynchronousManager
unregisterAsyncHandler
in interface AsynchronousManager
handler
- - asynchronous handler.public void unregisterAsyncHandlers(org.bukkit.plugin.Plugin plugin)-
AsynchronousManager
unregisterAsyncHandlers
in interface AsynchronousManager
plugin
- - the original plugin.public void enqueueSyncPacket(PacketEvent syncPacket, - AsyncMarker asyncMarker)-
syncPacket
- - synchronous packet event.asyncMarker
- - the asynchronous marker to use.public java.util.Set<java.lang.Integer> getSendingFilters()-
AsynchronousManager
getSendingFilters
in interface AsynchronousManager
public java.util.Set<java.lang.Integer> getReceivingFilters()-
AsynchronousManager
getReceivingFilters
in interface AsynchronousManager
public org.bukkit.scheduler.BukkitScheduler getScheduler()-
public boolean hasAsynchronousListeners(PacketEvent packet)-
AsynchronousManager
hasAsynchronousListeners
in interface AsynchronousManager
packet
- - packet to test.public AsyncMarker createAsyncMarker()-
public AsyncMarker createAsyncMarker(long sendingDelta, - long timeoutDelta)-
sendingDelta
- - how many packets we're willing to wait.timeoutDelta
- - how long (in ms) until the packet expire.public PacketStream getPacketStream()-
AsynchronousManager
getPacketStream
in interface AsynchronousManager
public ErrorReporter getErrorReporter()-
AsynchronousManager
getErrorReporter
in interface AsynchronousManager
public void cleanupAll()-
AsynchronousManager
cleanupAll
in interface AsynchronousManager
public void signalPacketTransmission(PacketEvent packet)-
AsynchronousManager
- This should only be called if AsyncMarker.incrementProcessingDelay()
- has been called previously.
signalPacketTransmission
in interface AsynchronousManager
packet
- - packet to signal.public com.comphenix.protocol.async.PacketSendingQueue getSendingQueue(PacketEvent packet)-
packet
- - the packet.public com.comphenix.protocol.async.PacketSendingQueue getSendingQueue(PacketEvent packet, - boolean createNew)-
packet
- - the packet.createNew
- - if TRUE, create a new queue if it hasn't already been created.public com.comphenix.protocol.async.PacketProcessingQueue getProcessingQueue(PacketEvent packet)-
packet
- - the packet.public void signalFreeProcessingSlot(PacketEvent packet)-
packet
- - packet to signal.public void sendProcessedPackets(int tickCounter, - boolean onMainThread)-
public void removePlayer(org.bukkit.entity.Player player)-
player
- - the player that has just logged out.public class AsyncListenerHandler
-extends java.lang.Object
-
- Use AsyncMarker.incrementProcessingDelay()
to delay a packet until a certain condition has been met.
Modifier and Type | -Method and Description | -
---|---|
void |
-cancel()
-Cancel the handler.
- |
-
void |
-enqueuePacket(PacketEvent packet)
-Queue a packet for processing.
- |
-
PacketListener |
-getAsyncListener()
-Retrieve the current asynchronous packet listener.
- |
-
java.lang.String |
-getFriendlyWorkerName(int id)
-Create a friendly thread name using the following convention:
- |
-
AsyncRunnable |
-getListenerLoop()
-Create a worker that will initiate the listener loop.
- |
-
org.bukkit.plugin.Plugin |
-getPlugin()
-Retrieve the plugin associated with this async listener.
- |
-
int |
-getWorkers()
-Retrieve the current number of registered workers.
- |
-
boolean |
-isCancelled()
-Determine whether or not this asynchronous handler has been cancelled.
- |
-
void |
-setWorkers(int count)
-Set the current number of workers.
- |
-
void |
-start()
-Start a singler worker thread handling the asynchronous listener.
- |
-
void |
-start(com.google.common.base.Function<AsyncRunnable,java.lang.Void> executor)
-Start a singler worker thread handling the asynchronous listener.
- |
-
void |
-start(int count)
-Start multiple worker threads for this listener.
- |
-
void |
-stop()
-Stop a worker thread.
- |
-
void |
-stop(int count)
-Stop the given amount of worker threads.
- |
-
boolean |
-syncStart()
-Start processing packets on the main thread.
- |
-
boolean |
-syncStart(long time,
- java.util.concurrent.TimeUnit unit)
-Start processing packets on the main thread.
- |
-
boolean |
-syncStop()
-Stop processing packets on the main thread.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public boolean isCancelled()-
public PacketListener getAsyncListener()-
public org.bukkit.plugin.Plugin getPlugin()-
public void cancel()-
public void enqueuePacket(PacketEvent packet)-
packet
- - a packet for processing.java.lang.IllegalStateException
- If the underlying packet queue is full.public AsyncRunnable getListenerLoop()-
- Warning: Never call the run() method in the main thread.
public void start()-
public void start(com.google.common.base.Function<AsyncRunnable,java.lang.Void> executor)-
- This method is intended to allow callers to customize the thread priority - before the worker loop is actually called. This is simpler than to - schedule the worker threads manually. -
- listenerHandler.start(new Function<AsyncRunnable, Void>() {
- @Override
- public Void apply(@Nullable AsyncRunnable workerLoop) {
- Thread thread = Thread.currentThread();
- int prevPriority = thread.getPriority();
-
- thread.setPriority(Thread.MIN_PRIORITY);
- workerLoop.run();
- thread.setPriority(prevPriority);
- return null;
- }
- });
- }
-
executor
- - a method that will execute the given listener loop.public java.lang.String getFriendlyWorkerName(int id)-
- Protocol Worker {id} - {plugin} - [recv: {packets}, send: {packets}]
-
id
- - the worker ID.public boolean syncStart()-
- This is useful if you need to synchronize with the main thread in your packet listener, but - you're not performing any expensive processing. -
- Note: Use a asynchronous worker if the packet listener may use more than 0.5 ms - of processing time on a single packet. Do as much as possible on the worker thread, and schedule synchronous tasks - to use the Bukkit API instead.
java.lang.IllegalStateException
- If we couldn't start the underlying task.public boolean syncStart(long time, - java.util.concurrent.TimeUnit unit)-
- This is useful if you need to synchronize with the main thread in your packet listener, but - you're not performing any expensive processing. -
- The processing time parameter gives the upper bound for the amount of time spent processing pending packets. - It should be set to a fairly low number, such as 0.5 ms or 1% of a game tick - to reduce the impact - on the main thread. Never go beyond 50 milliseconds. -
- Note: Use a asynchronous worker if the packet listener may exceed the ideal processing time - on a single packet. Do as much as possible on the worker thread, and schedule synchronous tasks - to use the Bukkit API instead.
time
- - the amount of processing time alloted per game tick (20 ticks per second).unit
- - the unit of the processingTime argument.java.lang.IllegalStateException
- If we couldn't start the underlying task.public boolean syncStop()-
public void start(int count)-
count
- - number of worker threads to start.public void stop()-
public void stop(int count)-
count
- - number of threads to stop.public void setWorkers(int count)-
- This method can only be called with a count of zero when the listener is closing.
count
- - new number of workers.public int getWorkers()-
- Note that the returned value may be out of data.
public class AsyncMarker -extends java.lang.Object -implements java.io.Serializable, java.lang.Comparable<AsyncMarker>-
- Asynchronous listeners can use this to set packet timeout or transmission order.
Modifier and Type | -Field and Description | -
---|---|
static int |
-DEFAULT_SENDING_DELTA
-Default number of packets to skip.
- |
-
static int |
-DEFAULT_TIMEOUT_DELTA
-Default number of milliseconds until a packet will rejected.
- |
-
Modifier and Type | -Method and Description | -
---|---|
int |
-compareTo(AsyncMarker o) |
-
boolean |
-equals(java.lang.Object other) |
-
long |
-getInitialTime()
-Retrieve the time the packet was initially queued for asynchronous processing.
- |
-
AsyncListenerHandler |
-getListenerHandler()
-Retrieve the current asynchronous listener handler.
- |
-
long |
-getNewSendingIndex()
-Retrieve the desired sending order after processing has completed.
- |
-
long |
-getOriginalSendingIndex()
-Retrieve the order the packet was originally transmitted.
- |
-
PacketStream |
-getPacketStream()
-Retrieve the packet stream responsible for transmitting this packet.
- |
-
int |
-getProcessingDelay()
-Retrieve the number of times a packet must be signalled to be done before it's sent.
- |
-
java.lang.Object |
-getProcessingLock()
-Processing lock used to synchronize access to the parent PacketEvent and PacketContainer.
- |
-
long |
-getQueuedSendingIndex()
-Retrieve the sending index when the packet was queued.
- |
-
long |
-getTimeout()
-Retrieve the time the packet will be forcefully rejected.
- |
-
int |
-getWorkerID()
-Retrieve the current worker ID.
- |
-
boolean |
-hasExpired()
-Determine if this packet has expired.
- |
-
boolean |
-hasExpired(long currentTime)
-Determine if this packet has expired given this time.
- |
-
int |
-hashCode() |
-
int |
-incrementProcessingDelay()
-Increment the number of times the current packet must be signalled as done before its transmitted.
- |
-
boolean |
-isAsyncCancelled()
-Determine if the asynchronous handling should be cancelled.
- |
-
boolean |
-isMinecraftAsync(PacketEvent event)
-Determine if Minecraft allows asynchronous processing of this packet.
- |
-
boolean |
-isProcessed()
-Retrieve whether or not this packet has been processed by the async listeners.
- |
-
boolean |
-isQueued()
-Whether or not this packet is or has been queued for processing.
- |
-
boolean |
-isTransmitted()
-Retrieve whether or not this packet has already been sent.
- |
-
void |
-setAsyncCancelled(boolean asyncCancelled)
-Set whether or not the asynchronous handling should be cancelled.
- |
-
void |
-setNewSendingIndex(long newSendingIndex)
-Sets the desired sending order after processing has completed.
- |
-
void |
-setPacketStream(PacketStream packetStream)
-Sets the output packet stream responsible for transmitting this packet.
- |
-
void |
-setProcessingLock(java.lang.Object processingLock) |
-
void |
-setTimeout(long timeout)
-Set the time the packet will be forcefully rejected.
- |
-
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
public static final int DEFAULT_TIMEOUT_DELTA-
public static final int DEFAULT_SENDING_DELTA-
public long getInitialTime()-
public long getTimeout()-
public void setTimeout(long timeout)-
timeout
- - time to reject the packet, in milliseconds since 01.01.1970 00:00.public long getOriginalSendingIndex()-
public long getNewSendingIndex()-
- Higher sending order means lower priority.
public void setNewSendingIndex(long newSendingIndex)-
- Higher sending order means lower priority.
newSendingIndex
- - new packet send index.public PacketStream getPacketStream()-
public void setPacketStream(PacketStream packetStream)-
packetStream
- - new output packet stream.public boolean isProcessed()-
public int incrementProcessingDelay()-
- This is useful if an asynchronous listener is waiting for further information before the
- packet can be sent to the user. A packet listener MUST eventually call
- AsyncFilterManager.signalPacketTransmission(PacketEvent)
,
- even if the packet is cancelled, after this method is called.
-
- It is recommended that processing outside a packet listener is wrapped in a synchronized block
- using the getProcessingLock()
method.
public int getProcessingDelay()-
public boolean isQueued()-
public long getQueuedSendingIndex()-
public java.lang.Object getProcessingLock()-
- This lock is automatically acquired for every asynchronous packet listener. It should only be - used to synchronize access to a PacketEvent if it's processing has been delayed.
public void setProcessingLock(java.lang.Object processingLock)-
public boolean isTransmitted()-
public boolean hasExpired()-
public boolean hasExpired(long currentTime)-
currentTime
- - the current time in milliseconds since 01.01.1970 00:00.public boolean isAsyncCancelled()-
public void setAsyncCancelled(boolean asyncCancelled)-
- This is only relevant during the synchronous processing. Asynchronous - listeners should use the normal cancel-field to cancel a PacketEvent.
asyncCancelled
- - TRUE to cancel it, FALSE otherwise.public AsyncListenerHandler getListenerHandler()-
public int getWorkerID()-
public boolean isMinecraftAsync(PacketEvent event) - throws FieldAccessException-
FieldAccessException
public int compareTo(AsyncMarker o)-
compareTo
in interface java.lang.Comparable<AsyncMarker>
public boolean equals(java.lang.Object other)-
equals
in class java.lang.Object
public int hashCode()-
hashCode
in class java.lang.Object
public interface AsyncRunnable
-extends java.lang.Runnable
-Modifier and Type | -Method and Description | -
---|---|
int |
-getID()
-Retrieve a unique worker ID.
- |
-
boolean |
-isFinished()
-Determine if this runnable has already run its course.
- |
-
boolean |
-isRunning()
-Determine if we're running or not.
- |
-
boolean |
-stop()
-Stop the given runnable.
- |
-
run
int getID()-
boolean stop() - throws java.lang.InterruptedException-
- This may not occur right away.
java.lang.InterruptedException
boolean isRunning()-
boolean isFinished()-
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.async | -- |
Modifier and Type | -Method and Description | -
---|---|
AsyncListenerHandler |
-AsynchronousManager.registerAsyncHandler(PacketListener listener)
-Registers an asynchronous packet handler.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-AsynchronousManager.unregisterAsyncHandler(AsyncListenerHandler handler)
-Unregisters and closes the given asynchronous handler.
- |
-
Modifier and Type | -Method and Description | -
---|---|
AsyncListenerHandler |
-AsyncMarker.getListenerHandler()
-Retrieve the current asynchronous listener handler.
- |
-
AsyncListenerHandler |
-AsyncFilterManager.registerAsyncHandler(PacketListener listener) |
-
AsyncListenerHandler |
-AsyncFilterManager.registerAsyncHandler(PacketListener listener,
- boolean autoInject)
-Registers an asynchronous packet handler.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-AsyncFilterManager.unregisterAsyncHandler(AsyncListenerHandler handler) |
-
Package | -Description | -
---|---|
com.comphenix.protocol.async | -- |
com.comphenix.protocol.events | -- |
Modifier and Type | -Method and Description | -
---|---|
AsyncMarker |
-AsyncFilterManager.createAsyncMarker()
-Construct a asynchronous marker with all the default values.
- |
-
AsyncMarker |
-AsyncFilterManager.createAsyncMarker(long sendingDelta,
- long timeoutDelta)
-Construct an async marker with the given sending priority delta and timeout delta.
- |
-
Modifier and Type | -Method and Description | -
---|---|
int |
-AsyncMarker.compareTo(AsyncMarker o) |
-
void |
-AsyncFilterManager.enqueueSyncPacket(PacketEvent syncPacket,
- AsyncMarker asyncMarker)
-Enqueue a packet for asynchronous processing.
- |
-
Modifier and Type | -Method and Description | -
---|---|
AsyncMarker |
-PacketEvent.getAsyncMarker()
-Retrieve the asynchronous marker.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static PacketEvent |
-PacketEvent.fromSynchronous(PacketEvent event,
- AsyncMarker marker)
-Create an asynchronous packet event from a synchronous event and a async marker.
- |
-
void |
-PacketEvent.setAsyncMarker(AsyncMarker asyncMarker)
-Set the asynchronous marker.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.async | -- |
Modifier and Type | -Method and Description | -
---|---|
AsyncRunnable |
-AsyncListenerHandler.getListenerLoop()
-Create a worker that will initiate the listener loop.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-AsyncListenerHandler.start(com.google.common.base.Function<AsyncRunnable,java.lang.Void> executor)
-Start a singler worker thread handling the asynchronous listener.
- |
-
Interface | -Description | -
---|---|
AsyncRunnable | -
- A runnable representing a asynchronous event listener.
- |
-
Class | -Description | -
---|---|
AsyncFilterManager | -
- Represents a filter manager for asynchronous packets.
- |
-
AsyncListenerHandler | -
- Represents a handler for an asynchronous event.
- |
-
AsyncMarker | -
- Contains information about the packet that is being processed by asynchronous listeners.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.async | -- |
com.comphenix.protocol.events | -- |
Class and Description | -
---|
AsyncListenerHandler
- Represents a handler for an asynchronous event.
- |
-
Class and Description | -
---|
AsyncListenerHandler
- Represents a handler for an asynchronous event.
- |
-
AsyncMarker
- Contains information about the packet that is being processed by asynchronous listeners.
- |
-
AsyncRunnable
- A runnable representing a asynchronous event listener.
- |
-
Class and Description | -
---|
AsyncMarker
- Contains information about the packet that is being processed by asynchronous listeners.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.async | -- |
Modifier and Type | -Method and Description | -
---|---|
AsynchronousManager |
-ProtocolManager.getAsynchronousManager()
-Retrieve the current asyncronous packet manager.
- |
-
Modifier and Type | -Class and Description | -
---|---|
class |
-AsyncFilterManager
-Represents a filter manager for asynchronous packets.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-CommandFilter.FilterFailedHandler.handle(PacketEvent event,
- CommandFilter.Filter filter,
- java.lang.Exception ex)
-Invoked when a given filter has failed.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-CommandFilter.filterEvent(PacketEvent event,
- CommandFilter.FilterFailedHandler handler)
-Determine whether or not to pass the given packet event to the packet listeners.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.async | -- |
Modifier and Type | -Interface and Description | -
---|---|
interface |
-ProtocolManager
-Represents an API for accessing the Minecraft protocol.
- |
-
Modifier and Type | -Method and Description | -
---|---|
PacketStream |
-AsynchronousManager.getPacketStream()
-Retrieve the default packet stream.
- |
-
Modifier and Type | -Method and Description | -
---|---|
PacketStream |
-AsyncMarker.getPacketStream()
-Retrieve the packet stream responsible for transmitting this packet.
- |
-
PacketStream |
-AsyncFilterManager.getPacketStream() |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-AsyncMarker.setPacketStream(PacketStream packetStream)
-Sets the output packet stream responsible for transmitting this packet.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
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 | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
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 | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.async | -- |
com.comphenix.protocol.utility | -- |
Modifier and Type | -Method and Description | -
---|---|
static ProtocolManager |
-ProtocolLibrary.getProtocolManager()
-Retrieves the packet protocol manager.
- |
-
Constructor and Description | -
---|
AsyncFilterManager(ErrorReporter reporter,
- org.bukkit.scheduler.BukkitScheduler scheduler,
- ProtocolManager manager)
-Initialize a asynchronous filter manager.
- |
-
Constructor and Description | -
---|
ChatExtensions(ProtocolManager manager) |
-
public abstract class AbstractConcurrentListenerMultimap<TListener>
-extends java.lang.Object
-Constructor and Description | -
---|
AbstractConcurrentListenerMultimap(int maximumPacketID) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-addListener(TListener listener,
- ListeningWhitelist whitelist)
-Adds a listener to its requested list of packet recievers.
- |
-
protected void |
-clearListeners()
-Remove all packet listeners.
- |
-
java.util.Collection<com.comphenix.protocol.injector.PrioritizedListener<TListener>> |
-getListener(int packetID)
-Retrieve the registered listeners, in order from the lowest to the highest priority.
- |
-
java.util.Set<java.lang.Integer> |
-keySet()
-Retrieve every registered packet ID:
- |
-
java.util.List<java.lang.Integer> |
-removeListener(TListener listener,
- ListeningWhitelist whitelist)
-Removes the given listener from the packet event list.
- |
-
java.lang.Iterable<com.comphenix.protocol.injector.PrioritizedListener<TListener>> |
-values()
-Retrieve every listener.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public AbstractConcurrentListenerMultimap(int maximumPacketID)-
public void addListener(TListener 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(TListener listener, - ListeningWhitelist whitelist)-
listener
- - listener to remove.whitelist
- - the packet whitelist that was used.public java.util.Collection<com.comphenix.protocol.injector.PrioritizedListener<TListener>> getListener(int packetID)-
- The returned list is thread-safe and doesn't require synchronization.
packetID
- - packet ID.public java.lang.Iterable<com.comphenix.protocol.injector.PrioritizedListener<TListener>> values()-
public java.util.Set<java.lang.Integer> keySet()-
protected void clearListeners()-
protected class AbstractIntervalTree.EndPoint
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
TKey |
-key |
-
AbstractIntervalTree.State |
-state |
-
TValue |
-value |
-
Constructor and Description | -
---|
AbstractIntervalTree.EndPoint(AbstractIntervalTree.State state,
- TKey key,
- TValue value) |
-
public class AbstractIntervalTree.Entry
-extends java.lang.Object
-implements java.util.Map.Entry<com.google.common.collect.Range<TKey>,TValue>
-Modifier and Type | -Method and Description | -
---|---|
boolean |
-equals(java.lang.Object obj) |
-
com.google.common.collect.Range<TKey> |
-getKey() |
-
TValue |
-getValue() |
-
int |
-hashCode() |
-
TValue |
-setValue(TValue value) |
-
java.lang.String |
-toString() |
-
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public com.google.common.collect.Range<TKey> getKey()- -
public TValue getValue()- -
public boolean equals(java.lang.Object obj)- -
public int hashCode()- -
public java.lang.String toString()-
toString
in class java.lang.Object
protected static enum AbstractIntervalTree.State -extends java.lang.Enum<AbstractIntervalTree.State>-
Enum Constant and Description | -
---|
BOTH |
-
CLOSE |
-
OPEN |
-
Modifier and Type | -Method and Description | -
---|---|
static AbstractIntervalTree.State |
-valueOf(java.lang.String name)
-Returns the enum constant of this type with the specified name.
- |
-
static AbstractIntervalTree.State[] |
-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 AbstractIntervalTree.State OPEN-
public static final AbstractIntervalTree.State CLOSE-
public static final AbstractIntervalTree.State BOTH-
public static AbstractIntervalTree.State[] values()-
-for (AbstractIntervalTree.State c : AbstractIntervalTree.State.values()) - System.out.println(c); -
public static AbstractIntervalTree.State 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 nullTKey
- - type of the key. Must implement Comparable.TValue
- - type of the value to associate.public abstract class AbstractIntervalTree<TKey extends java.lang.Comparable<TKey>,TValue>
-extends java.lang.Object
-- Note that this implementation is not thread safe.
Modifier and Type | -Class and Description | -
---|---|
protected class |
-AbstractIntervalTree.EndPoint
-Represents a single end point (open, close or both) of a range.
- |
-
class |
-AbstractIntervalTree.Entry
-Represents a range and a value in this interval tree.
- |
-
protected static class |
-AbstractIntervalTree.State |
-
Modifier and Type | -Field and Description | -
---|---|
protected java.util.NavigableMap<TKey,AbstractIntervalTree.EndPoint> |
-bounds |
-
Constructor and Description | -
---|
AbstractIntervalTree() |
-
Modifier and Type | -Method and Description | -
---|---|
protected AbstractIntervalTree.EndPoint |
-addEndPoint(TKey key,
- TValue value,
- AbstractIntervalTree.State state) |
-
void |
-clear()
-Remove every interval.
- |
-
boolean |
-containsKey(TKey key)
-Determines if the given key is within an interval.
- |
-
protected abstract TKey |
-decrementKey(TKey key)
-Decrement the given key by one unit.
- |
-
java.util.Set<AbstractIntervalTree.Entry> |
-entrySet()
-Enumerates over every range in this interval tree.
- |
-
TValue |
-get(TKey key)
-Retrieves the value of the range that matches the given key, or NULL if nothing was found.
- |
-
protected AbstractIntervalTree.EndPoint |
-getEndPoint(TKey key)
-Get the left-most end-point associated with this key.
- |
-
protected AbstractIntervalTree.Entry |
-getEntry(AbstractIntervalTree.EndPoint left,
- AbstractIntervalTree.EndPoint right)
-Retrieve the entry from a given set of end points.
- |
-
protected AbstractIntervalTree.EndPoint |
-getNextEndPoint(TKey point,
- boolean inclusive)
-Get the next end point of a given key.
- |
-
protected AbstractIntervalTree.EndPoint |
-getPreviousEndPoint(TKey point,
- boolean inclusive)
-Get the previous end point of a given key.
- |
-
protected abstract TKey |
-incrementKey(TKey key)
-Increment the given key by one unit.
- |
-
protected void |
-onEntryAdded(AbstractIntervalTree.Entry added)
-Invoked when an entry is added.
- |
-
protected void |
-onEntryRemoved(AbstractIntervalTree.Entry removed)
-Invoked when an entry is removed.
- |
-
void |
-put(TKey lowerBound,
- TKey upperBound,
- TValue value)
-Associates a given interval of keys with a certain value.
- |
-
void |
-putAll(AbstractIntervalTree<TKey,TValue> other)
-Inserts every range from the given tree into the current tree.
- |
-
java.util.Set<AbstractIntervalTree.Entry> |
-remove(TKey lowerBound,
- TKey upperBound)
-Removes every interval that intersects with the given range.
- |
-
java.util.Set<AbstractIntervalTree.Entry> |
-remove(TKey lowerBound,
- TKey upperBound,
- boolean preserveDifference)
-Removes every interval that intersects with the given range.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected java.util.NavigableMap<TKey extends java.lang.Comparable<TKey>,AbstractIntervalTree.EndPoint> bounds-
public java.util.Set<AbstractIntervalTree.Entry> remove(TKey lowerBound, - TKey upperBound)-
lowerBound
- - lowest value to remove.upperBound
- - highest value to remove.public java.util.Set<AbstractIntervalTree.Entry> remove(TKey lowerBound, - TKey upperBound, - boolean preserveDifference)-
lowerBound
- - lowest value to remove.upperBound
- - highest value to remove.preserveDifference
- - whether or not to preserve the intervals that are partially outside.protected AbstractIntervalTree.Entry getEntry(AbstractIntervalTree.EndPoint left, - AbstractIntervalTree.EndPoint right)-
left
- - leftmost end point.right
- - rightmost end point.protected AbstractIntervalTree.EndPoint addEndPoint(TKey key, - TValue value, - AbstractIntervalTree.State state)-
public void put(TKey lowerBound, - TKey upperBound, - TValue value)-
- Overlapping intervals are not permitted. A key can only be associated with a single value.
lowerBound
- - the minimum key (inclusive).upperBound
- - the maximum key (inclusive).value
- - the value, or NULL to reset this range.public boolean containsKey(TKey key)-
key
- - key to check.public java.util.Set<AbstractIntervalTree.Entry> entrySet()-
public void clear()-
public void putAll(AbstractIntervalTree<TKey,TValue> other)-
other
- - the other tree to read from.public TValue get(TKey key)-
key
- - the level to read for.protected AbstractIntervalTree.EndPoint getEndPoint(TKey key)-
key
- - key to search for.protected AbstractIntervalTree.EndPoint getPreviousEndPoint(TKey point, - boolean inclusive)-
point
- - the point to search with.inclusive
- - whether or not to include the current point in the search.protected AbstractIntervalTree.EndPoint getNextEndPoint(TKey point, - boolean inclusive)-
point
- - the point to search with.inclusive
- - whether or not to include the current point in the search.protected void onEntryAdded(AbstractIntervalTree.Entry added)-
added
- - the entry that was added.protected void onEntryRemoved(AbstractIntervalTree.Entry removed)-
removed
- - the removed entry.protected abstract TKey decrementKey(TKey key)-
key
- - the key that should be decremented.TKey
- - type of the key.TValue
- - type of the value.public class BlockingHashMap<TKey,TValue>
-extends java.lang.Object
-- Values are stored as weak references, and will be automatically removed once they've all been dereferenced. -
Constructor and Description | -
---|
BlockingHashMap()
-Initialize a new map.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static <TKey,TValue> |
-create()
-Initialize a new map.
- |
-
TValue |
-get(TKey key)
-Waits until a value has been associated with the given key, and then retrieves that value.
- |
-
TValue |
-get(TKey key,
- long timeout,
- java.util.concurrent.TimeUnit unit)
-Waits until a value has been associated with the given key, and then retrieves that value.
- |
-
TValue |
-get(TKey key,
- long timeout,
- java.util.concurrent.TimeUnit unit,
- boolean ignoreInterrupted)
-Waits until a value has been associated with the given key, and then retrieves that value.
- |
-
java.util.Set<TKey> |
-keys() |
-
static <TKey,TValue> |
-newInvalidCacheLoader()
-Retrieve a cache loader that will always throw an exception.
- |
-
TValue |
-put(TKey key,
- TValue value)
-Associate a given key with the given value.
- |
-
TValue |
-putIfAbsent(TKey key,
- TValue value)
-If and only if a key is not present in the map will it be associated with the given value.
- |
-
int |
-size() |
-
java.util.Collection<TValue> |
-values() |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public BlockingHashMap()-
public static <TKey,TValue> com.google.common.cache.CacheLoader<TKey,TValue> newInvalidCacheLoader()-
public static <TKey,TValue> BlockingHashMap<TKey,TValue> create()-
public TValue get(TKey key) - throws java.lang.InterruptedException-
key
- - the key whose associated value is to be returnedjava.lang.InterruptedException
- If the current thread got interrupted while waiting.public TValue get(TKey key, - long timeout, - java.util.concurrent.TimeUnit unit) - throws java.lang.InterruptedException-
key
- - the key whose associated value is to be returnedtimeout
- - the amount of time to wait until an association has been made.unit
- - unit of timeout.java.lang.InterruptedException
- If the current thread got interrupted while waiting.public TValue get(TKey key, - long timeout, - java.util.concurrent.TimeUnit unit, - boolean ignoreInterrupted) - throws java.lang.InterruptedException-
- If timeout is zero, this method will return immediately if it can't find an socket injector.
key
- - the key whose associated value is to be returnedtimeout
- - the amount of time to wait until an association has been made.unit
- - unit of timeout.ignoreInterrupted
- - TRUE if we should ignore the thread being interrupted, FALSE otherwise.java.lang.InterruptedException
- If the current thread got interrupted while waiting.public TValue put(TKey key, - TValue value)-
- Wakes up any blocking getters on this specific key.
key
- - the key to associate.value
- - the value.public TValue putIfAbsent(TKey key, - TValue value)-
key
- - the key to associate.value
- - the value to associate.public int size()-
public java.util.Collection<TValue> values()-
public java.util.Set<TKey> keys()-
public class BlockingHashMapTest
-extends java.lang.Object
-Constructor and Description | -
---|
BlockingHashMapTest() |
-
public class IntegerSet
-extends java.lang.Object
-- This class is intentionally missing a size method.
Constructor and Description | -
---|
IntegerSet(int maximumCount)
-Initialize a lookup table with the given maximum number of elements.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-add(int element)
-Add the given element to the set, or do nothing if it already exists.
- |
-
void |
-addAll(java.util.Collection<java.lang.Integer> packets)
-Add the given collection of elements to the set.
- |
-
void |
-clear()
-Remove every element from the set.
- |
-
boolean |
-contains(int element)
-Determine whether or not the given element exists in the set.
- |
-
void |
-remove(int element)
-Remove the given element from the set, or do nothing if it's already removed.
- |
-
java.util.Set<java.lang.Integer> |
-toSet()
-Convert the current IntegerSet to an equivalent HashSet.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public IntegerSet(int maximumCount)-
- This creates a set for elements in the range [0, count). -
- Formally, the current set must be a subset of [0, 1, 2, ..., count - 1].
maximumCount
- - maximum element value and count.public boolean contains(int element)-
element
- - the element to check. Must be in the range [0, count).public void add(int element)-
element
- - element to add.OutOfBoundsException
- If the given element is not in the range [0, count).public void addAll(java.util.Collection<java.lang.Integer> packets)-
packets
- - elements to add.public void remove(int element)-
element
- - element to remove.public void clear()-
public java.util.Set<java.lang.Integer> toSet()-
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.concurrency | -- |
Modifier and Type | -Field and Description | -
---|---|
protected java.util.NavigableMap<TKey,AbstractIntervalTree.EndPoint> |
-AbstractIntervalTree.bounds |
-
Modifier and Type | -Method and Description | -
---|---|
protected AbstractIntervalTree.EndPoint |
-AbstractIntervalTree.addEndPoint(TKey key,
- TValue value,
- AbstractIntervalTree.State state) |
-
protected AbstractIntervalTree.EndPoint |
-AbstractIntervalTree.getEndPoint(TKey key)
-Get the left-most end-point associated with this key.
- |
-
protected AbstractIntervalTree.EndPoint |
-AbstractIntervalTree.getNextEndPoint(TKey point,
- boolean inclusive)
-Get the next end point of a given key.
- |
-
protected AbstractIntervalTree.EndPoint |
-AbstractIntervalTree.getPreviousEndPoint(TKey point,
- boolean inclusive)
-Get the previous end point of a given key.
- |
-
Modifier and Type | -Method and Description | -
---|---|
protected AbstractIntervalTree.Entry |
-AbstractIntervalTree.getEntry(AbstractIntervalTree.EndPoint left,
- AbstractIntervalTree.EndPoint right)
-Retrieve the entry from a given set of end points.
- |
-
protected AbstractIntervalTree.Entry |
-AbstractIntervalTree.getEntry(AbstractIntervalTree.EndPoint left,
- AbstractIntervalTree.EndPoint right)
-Retrieve the entry from a given set of end points.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.concurrency | -- |
Modifier and Type | -Method and Description | -
---|---|
protected AbstractIntervalTree.Entry |
-AbstractIntervalTree.getEntry(AbstractIntervalTree.EndPoint left,
- AbstractIntervalTree.EndPoint right)
-Retrieve the entry from a given set of end points.
- |
-
Modifier and Type | -Method and Description | -
---|---|
java.util.Set<AbstractIntervalTree.Entry> |
-AbstractIntervalTree.entrySet()
-Enumerates over every range in this interval tree.
- |
-
java.util.Set<AbstractIntervalTree.Entry> |
-AbstractIntervalTree.remove(TKey lowerBound,
- TKey upperBound)
-Removes every interval that intersects with the given range.
- |
-
java.util.Set<AbstractIntervalTree.Entry> |
-AbstractIntervalTree.remove(TKey lowerBound,
- TKey upperBound,
- boolean preserveDifference)
-Removes every interval that intersects with the given range.
- |
-
Modifier and Type | -Method and Description | -
---|---|
protected void |
-AbstractIntervalTree.onEntryAdded(AbstractIntervalTree.Entry added)
-Invoked when an entry is added.
- |
-
protected void |
-AbstractIntervalTree.onEntryRemoved(AbstractIntervalTree.Entry removed)
-Invoked when an entry is removed.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.concurrency | -- |
Modifier and Type | -Field and Description | -
---|---|
AbstractIntervalTree.State |
-AbstractIntervalTree.EndPoint.state |
-
Modifier and Type | -Method and Description | -
---|---|
static AbstractIntervalTree.State |
-AbstractIntervalTree.State.valueOf(java.lang.String name)
-Returns the enum constant of this type with the specified name.
- |
-
static AbstractIntervalTree.State[] |
-AbstractIntervalTree.State.values()
-Returns an array containing the constants of this enum type, in
-the order they are declared.
- |
-
Modifier and Type | -Method and Description | -
---|---|
protected AbstractIntervalTree.EndPoint |
-AbstractIntervalTree.addEndPoint(TKey key,
- TValue value,
- AbstractIntervalTree.State state) |
-
Constructor and Description | -
---|
AbstractIntervalTree.EndPoint(AbstractIntervalTree.State state,
- TKey key,
- TValue value) |
-
Package | -Description | -
---|---|
com.comphenix.protocol.concurrency | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-AbstractIntervalTree.putAll(AbstractIntervalTree<TKey,TValue> other)
-Inserts every range from the given tree into the current tree.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.concurrency | -- |
Modifier and Type | -Method and Description | -
---|---|
static <TKey,TValue> |
-BlockingHashMap.create()
-Initialize a new map.
- |
-
Class | -Description | -
---|---|
AbstractConcurrentListenerMultimap<TListener> | -
- A thread-safe implementation of a listener multimap.
- |
-
AbstractIntervalTree<TKey extends java.lang.Comparable<TKey>,TValue> | -
- Represents a generic store of intervals and associated values.
- |
-
BlockingHashMap<TKey,TValue> | -
- A map that supports blocking on read operations.
- |
-
BlockingHashMapTest | -- |
IntegerSet | -
- Represents a very quick integer set that uses a lookup table to store membership.
- |
-
SortedCopyOnWriteArray<T extends java.lang.Comparable<T>> | -
- An implicitly sorted array list that preserves insertion order and maintains duplicates.
- |
-
Enum | -Description | -
---|---|
AbstractIntervalTree.State | -- |
Package | -Description | -
---|---|
com.comphenix.protocol.concurrency | -- |
Class and Description | -
---|
AbstractIntervalTree
- Represents a generic store of intervals and associated values.
- |
-
AbstractIntervalTree.EndPoint
- Represents a single end point (open, close or both) of a range.
- |
-
AbstractIntervalTree.Entry
- Represents a range and a value in this interval tree.
- |
-
AbstractIntervalTree.State | -
BlockingHashMap
- A map that supports blocking on read operations.
- |
-
public class BasicErrorReporter -extends java.lang.Object -implements ErrorReporter-
- Note that this implementation doesn't distinguish between reportWarning(Object, Report)
- and reportDetailed(Object, Report)
- they both have the exact same behavior.
Constructor and Description | -
---|
BasicErrorReporter()
-Construct a new basic error reporter that prints directly the standard error stream.
- |
-
BasicErrorReporter(java.io.PrintStream output)
-Construct a error reporter that prints to the given output stream.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-reportDetailed(java.lang.Object sender,
- Report.ReportBuilder reportBuilder)
-Prints a detailed error report about an unhandled exception.
- |
-
void |
-reportDetailed(java.lang.Object sender,
- Report report)
-Prints a detailed error report about an unhandled exception.
- |
-
void |
-reportMinimal(org.bukkit.plugin.Plugin sender,
- java.lang.String methodName,
- java.lang.Throwable error)
-Prints a small minimal error report regarding an exception from another plugin.
- |
-
void |
-reportMinimal(org.bukkit.plugin.Plugin sender,
- java.lang.String methodName,
- java.lang.Throwable error,
- java.lang.Object... parameters)
-Prints a small minimal error report regarding an exception from another plugin.
- |
-
void |
-reportWarning(java.lang.Object sender,
- Report.ReportBuilder reportBuilder)
-Prints a warning message from the current plugin.
- |
-
void |
-reportWarning(java.lang.Object sender,
- Report report)
-Prints a warning message from the current plugin.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public BasicErrorReporter()-
public BasicErrorReporter(java.io.PrintStream output)-
output
- - the output stream.public void reportMinimal(org.bukkit.plugin.Plugin sender, - java.lang.String methodName, - java.lang.Throwable error)-
ErrorReporter
reportMinimal
in interface ErrorReporter
sender
- - the other plugin.methodName
- - name of the caller method.error
- - the exception itself.public void reportMinimal(org.bukkit.plugin.Plugin sender, - java.lang.String methodName, - java.lang.Throwable error, - java.lang.Object... parameters)-
ErrorReporter
reportMinimal
in interface ErrorReporter
sender
- - the other plugin.methodName
- - name of the caller method.error
- - the exception itself.parameters
- - any relevant parameters to print.public void reportWarning(java.lang.Object sender, - Report report)-
ErrorReporter
reportWarning
in interface ErrorReporter
sender
- - the object containing the caller method.report
- - an error report to include.public void reportWarning(java.lang.Object sender, - Report.ReportBuilder reportBuilder)-
ErrorReporter
reportWarning
in interface ErrorReporter
sender
- - the object containing the caller method.reportBuilder
- - an error report builder that will be used to get the report.public void reportDetailed(java.lang.Object sender, - Report report)-
ErrorReporter
reportDetailed
in interface ErrorReporter
sender
- - the object containing the caller method.report
- - an error report to include.public void reportDetailed(java.lang.Object sender, - Report.ReportBuilder reportBuilder)-
ErrorReporter
reportDetailed
in interface ErrorReporter
sender
- - the object containing the caller method.reportBuilder
- - an error report builder that will be used to get the report.public class DelegatedErrorReporter -extends java.lang.Object -implements ErrorReporter-
Constructor and Description | -
---|
DelegatedErrorReporter(ErrorReporter delegated)
-Construct a new error reporter that forwards all reports to a given reporter.
- |
-
Modifier and Type | -Method and Description | -
---|---|
protected Report |
-filterReport(java.lang.Object sender,
- Report report,
- boolean detailed)
-Invoked before an error report is passed on to the underlying error reporter.
- |
-
ErrorReporter |
-getDelegated()
-Retrieve the underlying error reporter.
- |
-
void |
-reportDetailed(java.lang.Object sender,
- Report.ReportBuilder reportBuilder)
-Prints a detailed error report about an unhandled exception.
- |
-
void |
-reportDetailed(java.lang.Object sender,
- Report report)
-Prints a detailed error report about an unhandled exception.
- |
-
void |
-reportMinimal(org.bukkit.plugin.Plugin sender,
- java.lang.String methodName,
- java.lang.Throwable error)
-Prints a small minimal error report regarding an exception from another plugin.
- |
-
void |
-reportMinimal(org.bukkit.plugin.Plugin sender,
- java.lang.String methodName,
- java.lang.Throwable error,
- java.lang.Object... parameters)
-Prints a small minimal error report regarding an exception from another plugin.
- |
-
void |
-reportWarning(java.lang.Object sender,
- Report.ReportBuilder reportBuilder)
-Prints a warning message from the current plugin.
- |
-
void |
-reportWarning(java.lang.Object sender,
- Report report)
-Prints a warning message from the current plugin.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public DelegatedErrorReporter(ErrorReporter delegated)-
delegated
- - the delegated reporter.public ErrorReporter getDelegated()-
public void reportMinimal(org.bukkit.plugin.Plugin sender, - java.lang.String methodName, - java.lang.Throwable error)-
ErrorReporter
reportMinimal
in interface ErrorReporter
sender
- - the other plugin.methodName
- - name of the caller method.error
- - the exception itself.public void reportMinimal(org.bukkit.plugin.Plugin sender, - java.lang.String methodName, - java.lang.Throwable error, - java.lang.Object... parameters)-
ErrorReporter
reportMinimal
in interface ErrorReporter
sender
- - the other plugin.methodName
- - name of the caller method.error
- - the exception itself.parameters
- - any relevant parameters to print.public void reportWarning(java.lang.Object sender, - Report report)-
ErrorReporter
reportWarning
in interface ErrorReporter
sender
- - the object containing the caller method.report
- - an error report to include.public void reportDetailed(java.lang.Object sender, - Report report)-
ErrorReporter
reportDetailed
in interface ErrorReporter
sender
- - the object containing the caller method.report
- - an error report to include.protected Report filterReport(java.lang.Object sender, - Report report, - boolean detailed)-
- To cancel a report, return NULL.
sender
- - the sender component.report
- - the error report.detailed
- - whether or not the report will be displayed in detail.public void reportWarning(java.lang.Object sender, - Report.ReportBuilder reportBuilder)-
ErrorReporter
reportWarning
in interface ErrorReporter
sender
- - the object containing the caller method.reportBuilder
- - an error report builder that will be used to get the report.public void reportDetailed(java.lang.Object sender, - Report.ReportBuilder reportBuilder)-
ErrorReporter
reportDetailed
in interface ErrorReporter
sender
- - the object containing the caller method.reportBuilder
- - an error report builder that will be used to get the report.public class DetailedErrorReporter -extends java.lang.Object -implements ErrorReporter-
Modifier and Type | -Field and Description | -
---|---|
protected boolean |
-apacheCommonsMissing |
-
static int |
-DEFAULT_MAX_ERROR_COUNT |
-
static java.lang.String |
-DEFAULT_PREFIX |
-
static java.lang.String |
-DEFAULT_SUPPORT_URL |
-
static java.lang.String |
-ERROR_PERMISSION |
-
protected java.util.Map<java.lang.String,java.lang.Object> |
-globalParameters |
-
protected java.util.concurrent.atomic.AtomicInteger |
-internalErrorCount |
-
protected java.util.logging.Logger |
-logger |
-
protected int |
-maxErrorCount |
-
protected java.lang.String |
-pluginName |
-
protected java.lang.ref.WeakReference<org.bukkit.plugin.Plugin> |
-pluginReference |
-
protected java.lang.String |
-prefix |
-
static ReportType |
-REPORT_EXCEPTION_COUNT
-Report format for printing the current exception count.
- |
-
static java.lang.String |
-SECOND_LEVEL_PREFIX |
-
protected java.lang.String |
-supportURL |
-
Constructor and Description | -
---|
DetailedErrorReporter(org.bukkit.plugin.Plugin plugin)
-Create a default error reporting system.
- |
-
DetailedErrorReporter(org.bukkit.plugin.Plugin plugin,
- java.lang.String prefix,
- java.lang.String supportURL)
-Create a central error reporting system.
- |
-
DetailedErrorReporter(org.bukkit.plugin.Plugin plugin,
- java.lang.String prefix,
- java.lang.String supportURL,
- int maxErrorCount,
- java.util.logging.Logger logger)
-Create a central error reporting system.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-addGlobalParameter(java.lang.String key,
- java.lang.Object value)
-Adds the given global parameter.
- |
-
protected java.lang.String |
-addPrefix(java.lang.String text,
- java.lang.String prefix)
-Adds the given prefix to every line in the text.
- |
-
void |
-clearGlobalParameters()
-Reset all global parameters.
- |
-
int |
-getErrorCount()
-Retrieve the current number of errors printed through
-reportDetailed(Object, Report) . |
-
java.lang.Object |
-getGlobalParameter(java.lang.String key)
-Retrieve a global parameter by its key.
- |
-
java.util.logging.Logger |
-getLogger()
-Retrieve the current logger that is used to print all reports.
- |
-
int |
-getMaxErrorCount()
-Retrieve the maximum number of errors we can print before we begin suppressing errors.
- |
-
java.lang.String |
-getPrefix()
-Retrieve the prefix to apply to every line in the error reports.
- |
-
protected java.lang.String |
-getStringDescription(java.lang.Object value)
-Retrieve a string representation of the given object.
- |
-
java.lang.String |
-getSupportURL()
-Retrieve the support URL that will be added to all detailed reports.
- |
-
java.util.Set<java.lang.String> |
-globalParameters()
-Retrieve a set of every registered global parameter.
- |
-
protected boolean |
-isSimpleType(java.lang.Object test)
-Determine if the given object is a wrapper for a primitive/simple type or not.
- |
-
void |
-reportDetailed(java.lang.Object sender,
- Report.ReportBuilder reportBuilder)
-Prints a detailed error report about an unhandled exception.
- |
-
void |
-reportDetailed(java.lang.Object sender,
- Report report)
-Prints a detailed error report about an unhandled exception.
- |
-
void |
-reportMinimal(org.bukkit.plugin.Plugin sender,
- java.lang.String methodName,
- java.lang.Throwable error)
-Prints a small minimal error report regarding an exception from another plugin.
- |
-
void |
-reportMinimal(org.bukkit.plugin.Plugin sender,
- java.lang.String methodName,
- java.lang.Throwable error,
- java.lang.Object... parameters)
-Prints a small minimal error report regarding an exception from another plugin.
- |
-
boolean |
-reportMinimalNoSpam(org.bukkit.plugin.Plugin sender,
- java.lang.String methodName,
- java.lang.Throwable error)
-Report a problem with a given method and plugin, ensuring that we don't exceed the maximum number of error reports.
- |
-
void |
-reportWarning(java.lang.Object sender,
- Report.ReportBuilder reportBuilder)
-Prints a warning message from the current plugin.
- |
-
void |
-reportWarning(java.lang.Object sender,
- Report report)
-Prints a warning message from the current plugin.
- |
-
void |
-setErrorCount(int errorCount)
-Set the number of errors printed.
- |
-
void |
-setLogger(java.util.logging.Logger logger)
-Set the current logger that is used to print all reports.
- |
-
void |
-setMaxErrorCount(int maxErrorCount)
-Set the maximum number of errors we can print before we begin suppressing errors.
- |
-
void |
-setPrefix(java.lang.String prefix)
-Set the prefix to apply to every line in the error reports.
- |
-
void |
-setSupportURL(java.lang.String supportURL)
-Set the support URL that will be added to all detailed reports.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final ReportType REPORT_EXCEPTION_COUNT-
public static final java.lang.String SECOND_LEVEL_PREFIX-
public static final java.lang.String DEFAULT_PREFIX-
public static final java.lang.String DEFAULT_SUPPORT_URL-
public static final java.lang.String ERROR_PERMISSION-
public static final int DEFAULT_MAX_ERROR_COUNT-
protected java.lang.String prefix-
protected java.lang.String supportURL-
protected java.util.concurrent.atomic.AtomicInteger internalErrorCount-
protected int maxErrorCount-
protected java.util.logging.Logger logger-
protected java.lang.ref.WeakReference<org.bukkit.plugin.Plugin> pluginReference-
protected java.lang.String pluginName-
protected boolean apacheCommonsMissing-
protected java.util.Map<java.lang.String,java.lang.Object> globalParameters-
public DetailedErrorReporter(org.bukkit.plugin.Plugin plugin)-
public DetailedErrorReporter(org.bukkit.plugin.Plugin plugin, - java.lang.String prefix, - java.lang.String supportURL)-
plugin
- - the plugin owner.prefix
- - default line prefix.supportURL
- - URL to report the error.public DetailedErrorReporter(org.bukkit.plugin.Plugin plugin, - java.lang.String prefix, - java.lang.String supportURL, - int maxErrorCount, - java.util.logging.Logger logger)-
plugin
- - the plugin owner.prefix
- - default line prefix.supportURL
- - URL to report the error.maxErrorCount
- - number of errors to print before giving up.logger
- - current logger.public void reportMinimal(org.bukkit.plugin.Plugin sender, - java.lang.String methodName, - java.lang.Throwable error, - java.lang.Object... parameters)-
ErrorReporter
reportMinimal
in interface ErrorReporter
sender
- - the other plugin.methodName
- - name of the caller method.error
- - the exception itself.parameters
- - any relevant parameters to print.public void reportMinimal(org.bukkit.plugin.Plugin sender, - java.lang.String methodName, - java.lang.Throwable error)-
ErrorReporter
reportMinimal
in interface ErrorReporter
sender
- - the other plugin.methodName
- - name of the caller method.error
- - the exception itself.public boolean reportMinimalNoSpam(org.bukkit.plugin.Plugin sender, - java.lang.String methodName, - java.lang.Throwable error)-
sender
- - the component that observed this exception.methodName
- - the method name.error
- - the error itself.public void reportWarning(java.lang.Object sender, - Report.ReportBuilder reportBuilder)-
ErrorReporter
reportWarning
in interface ErrorReporter
sender
- - the object containing the caller method.reportBuilder
- - an error report builder that will be used to get the report.public void reportWarning(java.lang.Object sender, - Report report)-
ErrorReporter
reportWarning
in interface ErrorReporter
sender
- - the object containing the caller method.report
- - an error report to include.public void reportDetailed(java.lang.Object sender, - Report.ReportBuilder reportBuilder)-
ErrorReporter
reportDetailed
in interface ErrorReporter
sender
- - the object containing the caller method.reportBuilder
- - an error report builder that will be used to get the report.public void reportDetailed(java.lang.Object sender, - Report report)-
ErrorReporter
reportDetailed
in interface ErrorReporter
sender
- - the object containing the caller method.report
- - an error report to include.protected java.lang.String addPrefix(java.lang.String text, - java.lang.String prefix)-
text
- - text to modify.prefix
- - prefix added to every line in the text.protected java.lang.String getStringDescription(java.lang.Object value)-
value
- - object to convert.protected boolean isSimpleType(java.lang.Object test)-
test
- - the object to test.public int getErrorCount()-
reportDetailed(Object, Report)
.public void setErrorCount(int errorCount)-
errorCount
- - new number of errors printed.public int getMaxErrorCount()-
public void setMaxErrorCount(int maxErrorCount)-
maxErrorCount
- - new max count.public void addGlobalParameter(java.lang.String key, - java.lang.Object value)-
- Both key and value must be non-null.
key
- - name of parameter.value
- - the global parameter itself.public java.lang.Object getGlobalParameter(java.lang.String key)-
key
- - key of the parameter to retrieve.public void clearGlobalParameters()-
public java.util.Set<java.lang.String> globalParameters()-
public java.lang.String getSupportURL()-
public void setSupportURL(java.lang.String supportURL)-
supportURL
- - the new support URL.public java.lang.String getPrefix()-
public void setPrefix(java.lang.String prefix)-
prefix
- - new prefix.public java.util.logging.Logger getLogger()-
public void setLogger(java.util.logging.Logger logger)-
logger
- - new logger.public interface ErrorReporter
-Report
to the display and permanent storage.Modifier and Type | -Method and Description | -
---|---|
void |
-reportDetailed(java.lang.Object sender,
- Report.ReportBuilder reportBuilder)
-Prints a detailed error report about an unhandled exception.
- |
-
void |
-reportDetailed(java.lang.Object sender,
- Report report)
-Prints a detailed error report about an unhandled exception.
- |
-
void |
-reportMinimal(org.bukkit.plugin.Plugin sender,
- java.lang.String methodName,
- java.lang.Throwable error)
-Prints a small minimal error report regarding an exception from another plugin.
- |
-
void |
-reportMinimal(org.bukkit.plugin.Plugin sender,
- java.lang.String methodName,
- java.lang.Throwable error,
- java.lang.Object... parameters)
-Prints a small minimal error report regarding an exception from another plugin.
- |
-
void |
-reportWarning(java.lang.Object sender,
- Report.ReportBuilder reportBuilder)
-Prints a warning message from the current plugin.
- |
-
void |
-reportWarning(java.lang.Object sender,
- Report report)
-Prints a warning message from the current plugin.
- |
-
void reportMinimal(org.bukkit.plugin.Plugin sender, - java.lang.String methodName, - java.lang.Throwable error)-
sender
- - the other plugin.methodName
- - name of the caller method.error
- - the exception itself.void reportMinimal(org.bukkit.plugin.Plugin sender, - java.lang.String methodName, - java.lang.Throwable error, - java.lang.Object... parameters)-
sender
- - the other plugin.methodName
- - name of the caller method.error
- - the exception itself.parameters
- - any relevant parameters to print.void reportWarning(java.lang.Object sender, - Report report)-
sender
- - the object containing the caller method.report
- - an error report to include.void reportWarning(java.lang.Object sender, - Report.ReportBuilder reportBuilder)-
sender
- - the object containing the caller method.reportBuilder
- - an error report builder that will be used to get the report.void reportDetailed(java.lang.Object sender, - Report report)-
sender
- - the object containing the caller method.report
- - an error report to include.void reportDetailed(java.lang.Object sender, - Report.ReportBuilder reportBuilder)-
sender
- - the object containing the caller method.reportBuilder
- - an error report builder that will be used to get the report.public static class Report.ReportBuilder
-extends java.lang.Object
-Modifier and Type | -Method and Description | -
---|---|
Report |
-build()
-Construct a new report with the provided input.
- |
-
Report.ReportBuilder |
-callerParam(java.lang.Object... callerParameters)
-Set the parameters in the caller method.
- |
-
Report.ReportBuilder |
-error(java.lang.Throwable exception)
-Set the current exception that occured.
- |
-
Report.ReportBuilder |
-messageParam(java.lang.Object... messageParameters)
-Set the message parameters that are used to construct a message text.
- |
-
Report.ReportBuilder |
-type(ReportType type)
-Set the current report type.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Report.ReportBuilder type(ReportType type)-
type
- - report type.public Report.ReportBuilder error(@Nullable - java.lang.Throwable exception)-
exception
- - exception that occured.public Report.ReportBuilder messageParam(@Nullable - java.lang.Object... messageParameters)-
messageParameters
- - parameters for the report type.public Report.ReportBuilder callerParam(@Nullable - java.lang.Object... callerParameters)-
callerParameters
- - parameters of the caller method.public Report build()-
public class Report
-extends java.lang.Object
-Modifier and Type | -Class and Description | -
---|---|
static class |
-Report.ReportBuilder
-Must be constructed through the factory method in Report.
- |
-
Modifier | -Constructor and Description | -
---|---|
protected |
-Report(ReportType type,
- java.lang.Throwable exception,
- java.lang.Object[] messageParameters,
- java.lang.Object[] callerParameters)
-Construct a new report with the given type and parameters.
- |
-
Modifier and Type | -Method and Description | -
---|---|
java.lang.Object[] |
-getCallerParameters()
-Retrieve the parameters of the caller method.
- |
-
java.lang.Throwable |
-getException()
-Retrieve the associated exception, or NULL if not found.
- |
-
java.lang.Object[] |
-getMessageParameters()
-Retrieve the message parameters that will be used to construc the report message.
- |
-
java.lang.String |
-getReportMessage()
-Format the current report type with the provided message parameters.
- |
-
ReportType |
-getType()
-Retrieve the report type.
- |
-
boolean |
-hasCallerParameters()
-Determine if we have any caller parameters.
- |
-
boolean |
-hasMessageParameters()
-Determine if we have any message parameters.
- |
-
static Report.ReportBuilder |
-newBuilder(ReportType type)
-Construct a new report builder.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected Report(ReportType type, - @Nullable - java.lang.Throwable exception, - @Nullable - java.lang.Object[] messageParameters, - @Nullable - java.lang.Object[] callerParameters)-
exception
- - exception that occured in the caller method.type
- - the report type that will be used to construct the message.messageParameters
- - parameters used to construct the report message.callerParameters
- - parameters from the caller method.public static Report.ReportBuilder newBuilder(ReportType type)-
type
- - the initial report type.public java.lang.String getReportMessage()-
public java.lang.Object[] getMessageParameters()-
-
public java.lang.Object[] getCallerParameters()-
public ReportType getType()-
public java.lang.Throwable getException()-
public boolean hasMessageParameters()-
public boolean hasCallerParameters()-
public class ReportType
-extends java.lang.Object
-- By convention, a report must be declared as a static field publicly accessible from the sender class.
Constructor and Description | -
---|
ReportType(java.lang.String errorFormat)
-Construct a new report type.
- |
-
Modifier and Type | -Method and Description | -
---|---|
java.lang.String |
-getMessage(java.lang.Object[] parameters)
-Convert the given report to a string, using the provided parameters.
- |
-
static ReportType[] |
-getReports(java.lang.Class<?> clazz)
-Retrieve all publicly associated reports.
- |
-
java.lang.String |
-toString() |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public ReportType(java.lang.String errorFormat)-
errorFormat
- - string used to format the underlying report.public java.lang.String getMessage(java.lang.Object[] parameters)-
parameters
- - parameters to insert, or NULL to insert nothing.public java.lang.String toString()-
toString
in class java.lang.Object
public static ReportType[] getReports(java.lang.Class<?> clazz)-
clazz
- - sender class.Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.async | -- |
com.comphenix.protocol.error | -- |
com.comphenix.protocol.reflect.compiler | -- |
Modifier and Type | -Method and Description | -
---|---|
static ErrorReporter |
-ProtocolLibrary.getErrorReporter()
-Retrieve the current error reporter.
- |
-
ErrorReporter |
-AsynchronousManager.getErrorReporter()
-Retrieve the default error reporter.
- |
-
Constructor and Description | -
---|
CommandFilter(ErrorReporter reporter,
- org.bukkit.plugin.Plugin plugin,
- com.comphenix.protocol.ProtocolConfig config) |
-
Modifier and Type | -Method and Description | -
---|---|
ErrorReporter |
-AsyncFilterManager.getErrorReporter() |
-
Constructor and Description | -
---|
AsyncFilterManager(ErrorReporter reporter,
- org.bukkit.scheduler.BukkitScheduler scheduler,
- ProtocolManager manager)
-Initialize a asynchronous filter manager.
- |
-
Modifier and Type | -Class and Description | -
---|---|
class |
-BasicErrorReporter
-Represents a basic error reporter that prints error reports to the standard error stream.
- |
-
class |
-DelegatedErrorReporter
-Construct an error reporter that delegates to another error reporter.
- |
-
class |
-DetailedErrorReporter
-Internal class used to handle exceptions.
- |
-
Modifier and Type | -Method and Description | -
---|---|
ErrorReporter |
-DelegatedErrorReporter.getDelegated()
-Retrieve the underlying error reporter.
- |
-
Constructor and Description | -
---|
DelegatedErrorReporter(ErrorReporter delegated)
-Construct a new error reporter that forwards all reports to a given reporter.
- |
-
Constructor and Description | -
---|
BackgroundCompiler(java.lang.ClassLoader loader,
- ErrorReporter reporter)
-Initialize a background compiler.
- |
-
BackgroundCompiler(java.lang.ClassLoader loader,
- ErrorReporter reporter,
- java.util.concurrent.ExecutorService executor)
-Initialize a background compiler utilizing the given thread pool.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.error | -- |
Modifier and Type | -Method and Description | -
---|---|
Report.ReportBuilder |
-Report.ReportBuilder.callerParam(java.lang.Object... callerParameters)
-Set the parameters in the caller method.
- |
-
Report.ReportBuilder |
-Report.ReportBuilder.error(java.lang.Throwable exception)
-Set the current exception that occured.
- |
-
Report.ReportBuilder |
-Report.ReportBuilder.messageParam(java.lang.Object... messageParameters)
-Set the message parameters that are used to construct a message text.
- |
-
static Report.ReportBuilder |
-Report.newBuilder(ReportType type)
-Construct a new report builder.
- |
-
Report.ReportBuilder |
-Report.ReportBuilder.type(ReportType type)
-Set the current report type.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-ErrorReporter.reportDetailed(java.lang.Object sender,
- Report.ReportBuilder reportBuilder)
-Prints a detailed error report about an unhandled exception.
- |
-
void |
-DetailedErrorReporter.reportDetailed(java.lang.Object sender,
- Report.ReportBuilder reportBuilder) |
-
void |
-DelegatedErrorReporter.reportDetailed(java.lang.Object sender,
- Report.ReportBuilder reportBuilder) |
-
void |
-BasicErrorReporter.reportDetailed(java.lang.Object sender,
- Report.ReportBuilder reportBuilder) |
-
void |
-ErrorReporter.reportWarning(java.lang.Object sender,
- Report.ReportBuilder reportBuilder)
-Prints a warning message from the current plugin.
- |
-
void |
-DetailedErrorReporter.reportWarning(java.lang.Object sender,
- Report.ReportBuilder reportBuilder) |
-
void |
-DelegatedErrorReporter.reportWarning(java.lang.Object sender,
- Report.ReportBuilder reportBuilder) |
-
void |
-BasicErrorReporter.reportWarning(java.lang.Object sender,
- Report.ReportBuilder reportBuilder) |
-
Package | -Description | -
---|---|
com.comphenix.protocol.error | -- |
Modifier and Type | -Method and Description | -
---|---|
Report |
-Report.ReportBuilder.build()
-Construct a new report with the provided input.
- |
-
protected Report |
-DelegatedErrorReporter.filterReport(java.lang.Object sender,
- Report report,
- boolean detailed)
-Invoked before an error report is passed on to the underlying error reporter.
- |
-
Modifier and Type | -Method and Description | -
---|---|
protected Report |
-DelegatedErrorReporter.filterReport(java.lang.Object sender,
- Report report,
- boolean detailed)
-Invoked before an error report is passed on to the underlying error reporter.
- |
-
void |
-ErrorReporter.reportDetailed(java.lang.Object sender,
- Report report)
-Prints a detailed error report about an unhandled exception.
- |
-
void |
-DetailedErrorReporter.reportDetailed(java.lang.Object sender,
- Report report) |
-
void |
-DelegatedErrorReporter.reportDetailed(java.lang.Object sender,
- Report report) |
-
void |
-BasicErrorReporter.reportDetailed(java.lang.Object sender,
- Report report) |
-
void |
-ErrorReporter.reportWarning(java.lang.Object sender,
- Report report)
-Prints a warning message from the current plugin.
- |
-
void |
-DetailedErrorReporter.reportWarning(java.lang.Object sender,
- Report report) |
-
void |
-DelegatedErrorReporter.reportWarning(java.lang.Object sender,
- Report report) |
-
void |
-BasicErrorReporter.reportWarning(java.lang.Object sender,
- Report report) |
-
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.error | -- |
com.comphenix.protocol.reflect.compiler | -- |
Modifier and Type | -Field and Description | -
---|---|
static ReportType |
-DetailedErrorReporter.REPORT_EXCEPTION_COUNT
-Report format for printing the current exception count.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static ReportType[] |
-ReportType.getReports(java.lang.Class<?> clazz)
-Retrieve all publicly associated reports.
- |
-
ReportType |
-Report.getType()
-Retrieve the report type.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static Report.ReportBuilder |
-Report.newBuilder(ReportType type)
-Construct a new report builder.
- |
-
Report.ReportBuilder |
-Report.ReportBuilder.type(ReportType type)
-Set the current report type.
- |
-
Constructor and Description | -
---|
Report(ReportType type,
- java.lang.Throwable exception,
- java.lang.Object[] messageParameters,
- java.lang.Object[] callerParameters)
-Construct a new report with the given type and parameters.
- |
-
Modifier and Type | -Field and Description | -
---|---|
static ReportType |
-BackgroundCompiler.REPORT_CANNOT_COMPILE_STRUCTURE_MODIFIER |
-
static ReportType |
-BackgroundCompiler.REPORT_CANNOT_SCHEDULE_COMPILATION |
-
static ReportType |
-StructureCompiler.REPORT_TOO_MANY_GENERATED_CLASSES |
-
Interface | -Description | -
---|---|
ErrorReporter | -
- Represents an object that can forward an error
-Report to the display and permanent storage. |
-
Class | -Description | -
---|---|
BasicErrorReporter | -
- Represents a basic error reporter that prints error reports to the standard error stream.
- |
-
DelegatedErrorReporter | -
- Construct an error reporter that delegates to another error reporter.
- |
-
DetailedErrorReporter | -
- Internal class used to handle exceptions.
- |
-
Report | -
- Represents a error or warning report.
- |
-
Report.ReportBuilder | -
- Must be constructed through the factory method in Report.
- |
-
ReportType | -
- Represents a strongly-typed report.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.async | -- |
com.comphenix.protocol.error | -- |
com.comphenix.protocol.reflect.compiler | -- |
Class and Description | -
---|
ErrorReporter
- Represents an object that can forward an error
-Report to the display and permanent storage. |
-
ReportType
- Represents a strongly-typed report.
- |
-
Class and Description | -
---|
ErrorReporter
- Represents an object that can forward an error
-Report to the display and permanent storage. |
-
Class and Description | -
---|
ErrorReporter
- Represents an object that can forward an error
-Report to the display and permanent storage. |
-
Report
- Represents a error or warning report.
- |
-
Report.ReportBuilder
- Must be constructed through the factory method in Report.
- |
-
ReportType
- Represents a strongly-typed report.
- |
-
Class and Description | -
---|
ErrorReporter
- Represents an object that can forward an error
-Report to the display and permanent storage. |
-
ReportType
- Represents a strongly-typed report.
- |
-
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.lang.Integer[] whitelist,
- com.comphenix.protocol.injector.GamePhase gamePhase)
-Creates a packet whitelist for a given priority with a set of packet IDs.
- |
-
ListeningWhitelist(ListenerPriority priority,
- java.util.Set<java.lang.Integer> whitelist)
-Creates a packet whitelist for a given priority with a set of packet IDs.
- |
-
ListeningWhitelist(ListenerPriority priority,
- java.util.Set<java.lang.Integer> whitelist,
- com.comphenix.protocol.injector.GamePhase gamePhase)
-Creates a packet whitelist for a given priority with a set of packet IDs.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static boolean |
-containsAny(ListeningWhitelist whitelist,
- int... idList)
-Determine if any of the given IDs can be found in the whitelist.
- |
-
boolean |
-equals(java.lang.Object obj) |
-
com.comphenix.protocol.injector.GamePhase |
-getGamePhase()
-Retrieve which game phase this listener is active under.
- |
-
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() |
-
static boolean |
-isEmpty(ListeningWhitelist whitelist)
-Determine if the given whitelist is empty or not.
- |
-
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 final 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.util.Set<java.lang.Integer> whitelist, - com.comphenix.protocol.injector.GamePhase gamePhase)-
priority
- - the listener priority.whitelist
- - set of IDs to observe/enable.gamePhase
- - which game phase to receieve notifications on.public ListeningWhitelist(ListenerPriority priority, - java.lang.Integer... whitelist)-
priority
- - the listener priority.whitelist
- - list of packet IDs to observe/enable.public ListeningWhitelist(ListenerPriority priority, - java.lang.Integer[] whitelist, - com.comphenix.protocol.injector.GamePhase gamePhase)-
priority
- - the listener priority.whitelist
- - list of packet IDs to observe/enable.gamePhase
- - which game phase to receieve notifications on.public boolean isEnabled()-
public ListenerPriority getPriority()-
public java.util.Set<java.lang.Integer> getWhitelist()-
public com.comphenix.protocol.injector.GamePhase getGamePhase()-
public int hashCode()-
hashCode
in class java.lang.Object
public static boolean containsAny(ListeningWhitelist whitelist, - int... idList)-
whitelist
- - whitelist to test.idList
- - list of packet IDs to find.public static boolean isEmpty(ListeningWhitelist whitelist)-
whitelist
- - the whitelist to test.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 MonitorAdapter -extends java.lang.Object -implements PacketListener-
Constructor and Description | -
---|
MonitorAdapter(org.bukkit.plugin.Plugin plugin,
- ConnectionSide side) |
-
MonitorAdapter(org.bukkit.plugin.Plugin plugin,
- ConnectionSide side,
- java.util.logging.Logger logger) |
-
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.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onPacketReceiving, onPacketSending
public MonitorAdapter(org.bukkit.plugin.Plugin plugin, - ConnectionSide side)-
public MonitorAdapter(org.bukkit.plugin.Plugin plugin, - ConnectionSide side, - java.util.logging.Logger logger)-
public ListeningWhitelist getSendingWhitelist()-
PacketListener
getSendingWhitelist
in interface PacketListener
public ListeningWhitelist getReceivingWhitelist()-
PacketListener
getReceivingWhitelist
in interface PacketListener
public org.bukkit.plugin.Plugin getPlugin()-
PacketListener
getPlugin
in interface PacketListener
public abstract class PacketAdapter -extends java.lang.Object -implements PacketListener-
- Remember to override onPacketReceiving() and onPacketSending(), depending on the ConnectionSide.
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,
- com.comphenix.protocol.injector.GamePhase gamePhase,
- java.lang.Integer... packets)
-Initialize a packet listener for a single connection side.
- |
-
PacketAdapter(org.bukkit.plugin.Plugin plugin,
- ConnectionSide connectionSide,
- com.comphenix.protocol.injector.GamePhase gamePhase,
- java.util.Set<java.lang.Integer> packets)
-Initialize a packet listener for a single connection side.
- |
-
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,
- com.comphenix.protocol.injector.GamePhase gamePhase,
- java.lang.Integer... packets)
-Initialize a packet listener for a single connection side.
- |
-
PacketAdapter(org.bukkit.plugin.Plugin plugin,
- ConnectionSide connectionSide,
- ListenerPriority listenerPriority,
- com.comphenix.protocol.injector.GamePhase gamePhase,
- java.util.Set<java.lang.Integer> packets)
-Initialize a packet listener for a single connection side.
- |
-
PacketAdapter(org.bukkit.plugin.Plugin plugin,
- ConnectionSide connectionSide,
- ListenerPriority listenerPriority,
- java.lang.Integer... packets)
-Initialize a packet listener for a single connection side.
- |
-
PacketAdapter(org.bukkit.plugin.Plugin plugin,
- ConnectionSide connectionSide,
- ListenerPriority listenerPriority,
- java.util.Set<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.
- |
-
static java.lang.String |
-getPluginName(org.bukkit.plugin.Plugin plugin)
-Retrieves the name of the given plugin.
- |
-
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.util.Set<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 PacketAdapter(org.bukkit.plugin.Plugin plugin, - ConnectionSide connectionSide, - com.comphenix.protocol.injector.GamePhase gamePhase, - java.util.Set<java.lang.Integer> packets)-
- The game phase is used to optmize performance. A listener should only choose BOTH or LOGIN if it's absolutely necessary.
plugin
- - the plugin that spawned this listener.connectionSide
- - the packet type the listener is looking for.gamePhase
- - which game phase this listener is active under.packets
- - the packet IDs the listener is looking for.public PacketAdapter(org.bukkit.plugin.Plugin plugin, - ConnectionSide connectionSide, - ListenerPriority listenerPriority, - com.comphenix.protocol.injector.GamePhase gamePhase, - java.util.Set<java.lang.Integer> packets)-
- The game phase is used to optmize performance. A listener should only choose BOTH or LOGIN if it's absolutely necessary.
plugin
- - the plugin that spawned this listener.connectionSide
- - the packet type the listener is looking for.listenerPriority
- - the event priority.gamePhase
- - which game phase this listener is active under.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 PacketAdapter(org.bukkit.plugin.Plugin plugin, - ConnectionSide connectionSide, - com.comphenix.protocol.injector.GamePhase gamePhase, - java.lang.Integer... packets)-
plugin
- - the plugin that spawned this listener.connectionSide
- - the packet type the listener is looking for.gamePhase
- - which game phase this listener is active under.packets
- - the packet IDs the listener is looking for.public PacketAdapter(org.bukkit.plugin.Plugin plugin, - ConnectionSide connectionSide, - ListenerPriority listenerPriority, - com.comphenix.protocol.injector.GamePhase gamePhase, - java.lang.Integer... packets)-
- The game phase is used to optmize performance. A listener should only choose BOTH or LOGIN if it's absolutely necessary.
plugin
- - the plugin that spawned this listener.connectionSide
- - the packet type the listener is looking for.listenerPriority
- - the event priority.gamePhase
- - which game phase this listener is active under.packets
- - the packet IDs the listener is looking for.public void onPacketReceiving(PacketEvent event)-
PacketListener
- WARNING:
- This method will be called asynchronously! You should synchronize with the main
- thread using scheduleSyncDelayedTask
- if you need to call the Bukkit API.
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. -
- This method is executed on the main thread, and thus the Bukkit API is safe to use.
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)-
listener
- - the listener.public static java.lang.String getPluginName(org.bukkit.plugin.Plugin plugin)-
plugin
- - the plugin.public java.lang.String toString()-
toString
in class java.lang.Object
public class PacketContainer
-extends java.lang.Object
-implements java.io.Serializable
-Modifier and Type | -Field and Description | -
---|---|
protected java.lang.Object |
-handle |
-
protected int |
-id |
-
protected StructureModifier<java.lang.Object> |
-structureModifier |
-
Modifier | -Constructor and Description | -
---|---|
protected |
-PacketContainer()
-For serialization.
- |
-
|
-PacketContainer(int id)
-Creates a packet container for a new packet.
- |
-
|
-PacketContainer(int id,
- java.lang.Object handle)
-Creates a packet container for an existing packet.
- |
-
|
-PacketContainer(int id,
- java.lang.Object handle,
- StructureModifier<java.lang.Object> structure)
-Creates a packet container for an existing packet.
- |
-
Modifier and Type | -Method and Description | -
---|---|
PacketContainer |
-deepClone()
-Create a deep copy of the current packet.
- |
-
StructureModifier<java.lang.Boolean> |
-getBooleans()
-Retrieves a read/write structure for every boolean field.
- |
-
StructureModifier<byte[]> |
-getByteArrays()
-Retrieves a read/write structure for every byte array field.
- |
-
StreamSerializer |
-getByteArraySerializer()
-Retrieve a serializer for reading and writing ItemStacks stored in a byte array.
- |
-
StructureModifier<java.lang.Byte> |
-getBytes()
-Retrieves a read/write structure for every byte field.
- |
-
StructureModifier<WrappedDataWatcher> |
-getDataWatcherModifier()
-Retrieves a read/write structure for data watchers.
- |
-
StructureModifier<java.lang.Double> |
-getDoubles()
-Retrieves a read/write structure for every double field.
- |
-
StructureModifier<org.bukkit.entity.Entity> |
-getEntityModifier(org.bukkit.World world)
-Retrieves a read/write structure for entity objects.
- |
-
StructureModifier<java.lang.Float> |
-getFloat()
-Retrieves a read/write structure for every float field.
- |
-
java.lang.Object |
-getHandle()
-Retrieves the underlying Minecraft packet.
- |
-
int |
-getID()
-Retrieves the ID of this packet.
- |
-
StructureModifier<int[]> |
-getIntegerArrays()
-Retrieves a read/write structure for every int array field.
- |
-
StructureModifier<java.lang.Integer> |
-getIntegers()
-Retrieves a read/write structure for every integer field.
- |
-
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.Long> |
-getLongs()
-Retrieves a read/write structure for every long field.
- |
-
StructureModifier<java.lang.Object> |
-getModifier()
-Retrieves the generic structure modifier for this packet.
- |
-
StructureModifier<NbtBase<?>> |
-getNbtModifier()
-Retrieves a read/write structure for NBT classes.
- |
-
StructureModifier<java.util.List<ChunkPosition>> |
-getPositionCollectionModifier()
-Retrieves a read/write structure for collections of chunk positions.
- |
-
StructureModifier<ChunkPosition> |
-getPositionModifier()
-Retrieves a read/write structure for chunk positions.
- |
-
StructureModifier<java.lang.Short> |
-getShorts()
-Retrieves a read/write structure for every short field.
- |
-
<T> StructureModifier<T> |
-getSpecificModifier(java.lang.Class<T> primitiveType)
-Retrieves a read/write structure for every field with the given type.
- |
-
StructureModifier<java.lang.String[]> |
-getStringArrays()
-Retrieves a read/write structure for every String array field.
- |
-
StructureModifier<java.lang.String> |
-getStrings()
-Retrieves a read/write structure for every String field.
- |
-
StructureModifier<java.util.List<WrappedWatchableObject>> |
-getWatchableCollectionModifier()
-Retrieves a read/write structure for collections of watchable objects.
- |
-
StructureModifier<org.bukkit.WorldType> |
-getWorldTypeModifier()
-Retrieves a read/write structure for the world type enum.
- |
-
PacketContainer |
-shallowClone()
-Create a shallow copy of the current packet.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected int id-
protected transient java.lang.Object handle-
protected transient StructureModifier<java.lang.Object> structureModifier-
public PacketContainer(int id)-
id
- - ID of the packet to create.public PacketContainer(int id, - java.lang.Object handle)-
id
- - ID of the given packet.handle
- - contained packet.public PacketContainer(int id, - java.lang.Object handle, - StructureModifier<java.lang.Object> structure)-
id
- - ID of the given packet.handle
- - contained packet.structure
- - structure modifier.protected PacketContainer()-
public java.lang.Object getHandle()-
public StructureModifier<java.lang.Object> getModifier()-
public <T> StructureModifier<T> getSpecificModifier(java.lang.Class<T> primitiveType)-
primitiveType
- - the type to find.public StructureModifier<java.lang.Byte> getBytes()-
public StructureModifier<java.lang.Boolean> getBooleans()-
public StructureModifier<java.lang.Short> getShorts()-
public StructureModifier<java.lang.Integer> getIntegers()-
public StructureModifier<java.lang.Long> getLongs()-
public StructureModifier<java.lang.Float> getFloat()-
public StructureModifier<java.lang.Double> getDoubles()-
public StructureModifier<java.lang.String> getStrings()-
public StructureModifier<java.lang.String[]> getStringArrays()-
public StructureModifier<byte[]> getByteArrays()-
public StreamSerializer getByteArraySerializer()-
public StructureModifier<int[]> getIntegerArrays()-
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<WrappedDataWatcher> getDataWatcherModifier()-
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 StructureModifier<ChunkPosition> getPositionModifier()-
public StructureModifier<NbtBase<?>> getNbtModifier()-
public StructureModifier<java.util.List<ChunkPosition>> getPositionCollectionModifier()-
- This modifier will automatically marshall between the visible ProtocolLib ChunkPosition and the - internal Minecraft ChunkPosition.
public StructureModifier<java.util.List<WrappedWatchableObject>> getWatchableCollectionModifier()-
- This modifier will automatically marshall between the visible WrappedWatchableObject and the - internal Minecraft WatchableObject.
public int getID()-
public PacketContainer shallowClone()-
- This merely writes the content of each field to the new class directly, - without performing any expensive copies.
public PacketContainer deepClone()-
- This will perform a full copy of the entire object tree, only skipping - known immutable objects and primitive types. -
- Note that the inflated buffers in packet 51 and 56 will be copied directly to save memory.
@PrepareForTest(value=org.bukkit.craftbukkit.v1_5_R2.inventory.CraftItemFactory.class)
-public class PacketContainerTest
-extends java.lang.Object
-Constructor and Description | -
---|
PacketContainerTest() |
-
Modifier and Type | -Method and Description | -
---|---|
static void |
-initializeBukkit() |
-
void |
-testDeepClone() |
-
void |
-testGetByteArrays() |
-
void |
-testGetBytes() |
-
void |
-testGetDataWatcherModifier() |
-
void |
-testGetDoubles() |
-
void |
-testGetFloat() |
-
void |
-testGetIntegerArrays() |
-
void |
-testGetIntegers() |
-
void |
-testGetItemArrayModifier() |
-
void |
-testGetItemModifier() |
-
void |
-testGetLongs() |
-
void |
-testGetNbtModifier() |
-
void |
-testGetPositionCollectionModifier() |
-
void |
-testGetShorts() |
-
void |
-testGetStringArrays() |
-
void |
-testGetStrings() |
-
void |
-testGetWatchableCollectionModifier() |
-
void |
-testGetWorldTypeModifier() |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static void initializeBukkit() - throws java.lang.IllegalAccessException-
java.lang.IllegalAccessException
public void testGetByteArrays()-
public void testGetBytes()-
public void testGetShorts()-
public void testGetIntegers()-
public void testGetLongs()-
public void testGetFloat()-
public void testGetDoubles()-
public void testGetStrings()-
public void testGetStringArrays()-
public void testGetIntegerArrays()-
public void testGetItemModifier()-
public void testGetItemArrayModifier()-
public void testGetWorldTypeModifier()-
public void testGetNbtModifier()-
public void testGetDataWatcherModifier()-
public void testGetPositionCollectionModifier()-
public void testGetWatchableCollectionModifier()-
public void testDeepClone()-
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.
- |
-
static PacketEvent |
-fromSynchronous(PacketEvent event,
- AsyncMarker marker)
-Create an asynchronous packet event from a synchronous event and a async marker.
- |
-
AsyncMarker |
-getAsyncMarker()
-Retrieve the asynchronous marker.
- |
-
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 |
-isAsynchronous()
-Determine if the packet event has been executed asynchronously or not.
- |
-
boolean |
-isCancelled()
-Retrieves whether or not the packet should be cancelled.
- |
-
boolean |
-isReadOnly()
-Determine if the current packet event is read only.
- |
-
boolean |
-isServerPacket()
-Whether or not this packet was created by the server.
- |
-
void |
-setAsyncMarker(AsyncMarker asyncMarker)
-Set the asynchronous marker.
- |
-
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.
- |
-
void |
-setReadOnly(boolean readOnly)
-Set the read-only state of this packet event.
- |
-
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 static PacketEvent fromSynchronous(PacketEvent event, - AsyncMarker marker)-
event
- - the original synchronous event.marker
- - the asynchronous marker.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)-
- Warning: A cancelled packet should never be re-transmitted. Use the asynchronous - packet manager if you need to perform extensive processing. It should also be used - if you need to synchronize with the main thread. -
- This ensures that other plugins can work with the same packet. -
- An asynchronous listener can also delay a packet indefinitely without having to block its thread.
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()-
- Most listeners can deduce this by noting which listener method was invoked.
public AsyncMarker getAsyncMarker()-
- If the packet is synchronous, this marker will be used to schedule an asynchronous event. In the following - asynchronous event, the marker is used to correctly pass the packet around to the different threads. -
- Note that if there are no asynchronous events that can receive this packet, the marker is NULL.
public void setAsyncMarker(AsyncMarker asyncMarker)-
- If the marker is non-null at the end of an synchronous event processing, the packet will be scheduled - to be processed asynchronously with the given settings. -
- Note that if there are no asynchronous events that can receive this packet, the marker should be NULL.
asyncMarker
- - the new asynchronous marker, or NULL.java.lang.IllegalStateException
- If the current event is asynchronous.public boolean isReadOnly()-
- This is used to ensure that a monitor listener doesn't accidentally alter the state of the event. However, - it is still possible to modify the packet itself, as it would require too many resources to verify its integrity. -
- Thus, the packet is considered immutable if the packet event is read only.
public void setReadOnly(boolean readOnly)-
- This will be reset for every packet listener.
readOnly
- - TRUE if it is read-only, FALSE otherwise.public boolean isAsynchronous()-
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. -
- This method is executed on the main thread, and thus the Bukkit API is safe to use.
event
- - the packet that should be sent.void onPacketReceiving(PacketEvent event)-
- WARNING:
- This method will be called asynchronously! You should synchronize with the main
- thread using scheduleSyncDelayedTask
- if you need to call the Bukkit API.
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 | -
---|
MonitorAdapter(org.bukkit.plugin.Plugin plugin,
- ConnectionSide side) |
-
MonitorAdapter(org.bukkit.plugin.Plugin plugin,
- ConnectionSide side,
- java.util.logging.Logger logger) |
-
PacketAdapter(org.bukkit.plugin.Plugin plugin,
- ConnectionSide connectionSide,
- com.comphenix.protocol.injector.GamePhase gamePhase,
- java.lang.Integer... packets)
-Initialize a packet listener for a single connection side.
- |
-
PacketAdapter(org.bukkit.plugin.Plugin plugin,
- ConnectionSide connectionSide,
- com.comphenix.protocol.injector.GamePhase gamePhase,
- java.util.Set<java.lang.Integer> packets)
-Initialize a packet listener for a single connection side.
- |
-
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,
- com.comphenix.protocol.injector.GamePhase gamePhase,
- java.lang.Integer... packets)
-Initialize a packet listener for a single connection side.
- |
-
PacketAdapter(org.bukkit.plugin.Plugin plugin,
- ConnectionSide connectionSide,
- ListenerPriority listenerPriority,
- com.comphenix.protocol.injector.GamePhase gamePhase,
- java.util.Set<java.lang.Integer> packets)
-Initialize a packet listener for a single connection side.
- |
-
PacketAdapter(org.bukkit.plugin.Plugin plugin,
- ConnectionSide connectionSide,
- ListenerPriority listenerPriority,
- java.lang.Integer... packets)
-Initialize a packet listener for a single connection side.
- |
-
PacketAdapter(org.bukkit.plugin.Plugin plugin,
- ConnectionSide connectionSide,
- ListenerPriority listenerPriority,
- java.util.Set<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.lang.Integer[] whitelist,
- com.comphenix.protocol.injector.GamePhase gamePhase)
-Creates a packet whitelist for a given priority with a set of packet IDs.
- |
-
ListeningWhitelist(ListenerPriority priority,
- java.util.Set<java.lang.Integer> whitelist)
-Creates a packet whitelist for a given priority with a set of packet IDs.
- |
-
ListeningWhitelist(ListenerPriority priority,
- java.util.Set<java.lang.Integer> whitelist,
- com.comphenix.protocol.injector.GamePhase gamePhase)
-Creates a packet whitelist for a given priority with a set of packet IDs.
- |
-
PacketAdapter(org.bukkit.plugin.Plugin plugin,
- ConnectionSide connectionSide,
- ListenerPriority listenerPriority,
- com.comphenix.protocol.injector.GamePhase gamePhase,
- java.lang.Integer... packets)
-Initialize a packet listener for a single connection side.
- |
-
PacketAdapter(org.bukkit.plugin.Plugin plugin,
- ConnectionSide connectionSide,
- ListenerPriority listenerPriority,
- com.comphenix.protocol.injector.GamePhase gamePhase,
- java.util.Set<java.lang.Integer> packets)
-Initialize a packet listener for a single connection side.
- |
-
PacketAdapter(org.bukkit.plugin.Plugin plugin,
- ConnectionSide connectionSide,
- ListenerPriority listenerPriority,
- java.lang.Integer... packets)
-Initialize a packet listener for a single connection side.
- |
-
PacketAdapter(org.bukkit.plugin.Plugin plugin,
- ConnectionSide connectionSide,
- ListenerPriority listenerPriority,
- java.util.Set<java.lang.Integer> packets)
-Initialize a packet listener for a single connection side.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.concurrency | -- |
com.comphenix.protocol.events | -- |
Modifier and Type | -Method and Description | -
---|---|
void |
-AbstractConcurrentListenerMultimap.addListener(TListener listener,
- ListeningWhitelist whitelist)
-Adds a listener to its requested list of packet recievers.
- |
-
java.util.List<java.lang.Integer> |
-AbstractConcurrentListenerMultimap.removeListener(TListener listener,
- ListeningWhitelist whitelist)
-Removes the given listener from the packet event list.
- |
-
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 |
-MonitorAdapter.getReceivingWhitelist() |
-
ListeningWhitelist |
-PacketListener.getSendingWhitelist()
-Retrieve which packets sent by the server this listener will observe.
- |
-
ListeningWhitelist |
-PacketAdapter.getSendingWhitelist() |
-
ListeningWhitelist |
-MonitorAdapter.getSendingWhitelist() |
-
Modifier and Type | -Method and Description | -
---|---|
static boolean |
-ListeningWhitelist.containsAny(ListeningWhitelist whitelist,
- int... idList)
-Determine if any of the given IDs can be found in the whitelist.
- |
-
static boolean |
-ListeningWhitelist.isEmpty(ListeningWhitelist whitelist)
-Determine if the given whitelist is empty or not.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.events | -- |
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 |
-PacketStream.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 |
-PacketStream.recieveClientPacket(org.bukkit.entity.Player sender,
- PacketContainer packet,
- boolean filters)
-Simulate recieving a certain packet from a given player.
- |
-
void |
-PacketStream.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.
- |
-
void |
-PacketStream.sendServerPacket(org.bukkit.entity.Player reciever,
- PacketContainer packet,
- boolean filters)
-Send a packet to the given player.
- |
-
Modifier and Type | -Method and Description | -
---|---|
PacketContainer |
-PacketContainer.deepClone()
-Create a deep copy of the current packet.
- |
-
PacketContainer |
-PacketEvent.getPacket()
-Retrieves the packet that will be sent to the player.
- |
-
PacketContainer |
-PacketContainer.shallowClone()
-Create a shallow copy of the current packet.
- |
-
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.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.async | -- |
com.comphenix.protocol.events | -- |
Modifier and Type | -Method and Description | -
---|---|
boolean |
-CommandFilter.Filter.evaluate(javax.script.ScriptEngine context,
- PacketEvent event)
-Evaluate the current filter using the provided ScriptEngine as context.
- |
-
boolean |
-CommandFilter.filterEvent(PacketEvent event)
-Determine whether or not to pass the given packet event to the packet listeners.
- |
-
boolean |
-CommandFilter.filterEvent(PacketEvent event,
- CommandFilter.FilterFailedHandler handler)
-Determine whether or not to pass the given packet event to the packet listeners.
- |
-
boolean |
-CommandFilter.FilterFailedHandler.handle(PacketEvent event,
- CommandFilter.Filter filter,
- java.lang.Exception ex)
-Invoked when a given filter has failed.
- |
-
boolean |
-AsynchronousManager.hasAsynchronousListeners(PacketEvent packet)
-Determine if a given synchronous packet has asynchronous listeners.
- |
-
void |
-AsynchronousManager.signalPacketTransmission(PacketEvent packet)
-Signal that a packet is ready to be transmitted.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-AsyncListenerHandler.enqueuePacket(PacketEvent packet)
-Queue a packet for processing.
- |
-
void |
-AsyncFilterManager.enqueueSyncPacket(PacketEvent syncPacket,
- AsyncMarker asyncMarker)
-Enqueue a packet for asynchronous processing.
- |
-
com.comphenix.protocol.async.PacketProcessingQueue |
-AsyncFilterManager.getProcessingQueue(PacketEvent packet)
-Retrieve the processing queue this packet belongs to.
- |
-
com.comphenix.protocol.async.PacketSendingQueue |
-AsyncFilterManager.getSendingQueue(PacketEvent packet)
-Retrieve the sending queue this packet belongs to.
- |
-
com.comphenix.protocol.async.PacketSendingQueue |
-AsyncFilterManager.getSendingQueue(PacketEvent packet,
- boolean createNew)
-Retrieve the sending queue this packet belongs to.
- |
-
boolean |
-AsyncFilterManager.hasAsynchronousListeners(PacketEvent packet) |
-
boolean |
-AsyncMarker.isMinecraftAsync(PacketEvent event)
-Determine if Minecraft allows asynchronous processing of this packet.
- |
-
void |
-AsyncFilterManager.signalFreeProcessingSlot(PacketEvent packet)
-Signal that a packet has finished processing.
- |
-
void |
-AsyncFilterManager.signalPacketTransmission(PacketEvent packet) |
-
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.
- |
-
static PacketEvent |
-PacketEvent.fromSynchronous(PacketEvent event,
- AsyncMarker marker)
-Create an asynchronous packet event from a synchronous event and a async marker.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static PacketEvent |
-PacketEvent.fromSynchronous(PacketEvent event,
- AsyncMarker marker)
-Create an asynchronous packet event from a synchronous event and a async marker.
- |
-
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) |
-
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.async | -- |
com.comphenix.protocol.events | -- |
Modifier and Type | -Method and Description | -
---|---|
com.google.common.collect.ImmutableSet<PacketListener> |
-ProtocolManager.getPacketListeners()
-Retrieves a list of every registered packet listener.
- |
-
java.util.Set<PacketListener> |
-AsynchronousManager.getTimeoutHandlers()
-Get a immutable list of every registered timeout handler.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-ProtocolManager.addPacketListener(PacketListener listener)
-Adds a packet listener.
- |
-
AsyncListenerHandler |
-AsynchronousManager.registerAsyncHandler(PacketListener listener)
-Registers an asynchronous packet handler.
- |
-
void |
-AsynchronousManager.registerTimeoutHandler(PacketListener listener)
-Register a synchronous listener that handles packets when they time out.
- |
-
void |
-ProtocolManager.removePacketListener(PacketListener listener)
-Removes a given packet listener.
- |
-
void |
-AsynchronousManager.unregisterTimeoutHandler(PacketListener listener)
-Unregisters a given timeout listener.
- |
-
Modifier and Type | -Method and Description | -
---|---|
PacketListener |
-AsyncListenerHandler.getAsyncListener()
-Retrieve the current asynchronous packet listener.
- |
-
Modifier and Type | -Method and Description | -
---|---|
java.util.Set<PacketListener> |
-AsyncFilterManager.getTimeoutHandlers() |
-
Modifier and Type | -Method and Description | -
---|---|
AsyncListenerHandler |
-AsyncFilterManager.registerAsyncHandler(PacketListener listener) |
-
AsyncListenerHandler |
-AsyncFilterManager.registerAsyncHandler(PacketListener listener,
- boolean autoInject)
-Registers an asynchronous packet handler.
- |
-
void |
-AsyncFilterManager.registerTimeoutHandler(PacketListener listener) |
-
void |
-AsyncFilterManager.unregisterTimeoutHandler(PacketListener listener) |
-
Modifier and Type | -Class and Description | -
---|---|
class |
-MonitorAdapter
-Represents a listener that is notified of every sent and recieved packet.
- |
-
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.
- |
-
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.
- |
-
MonitorAdapter | -
- Represents a listener that is notified of every sent and recieved packet.
- |
-
PacketAdapter | -
- Represents a packet listener with useful constructors.
- |
-
PacketContainer | -
- Represents a Minecraft packet indirectly.
- |
-
PacketContainerTest | -- |
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 | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.async | -- |
com.comphenix.protocol.concurrency | -- |
com.comphenix.protocol.events | -- |
Class and Description | -
---|
PacketContainer
- Represents a Minecraft packet indirectly.
- |
-
PacketEvent | -
PacketListener
- Represents a listener that recieves notifications when packets are sent or recieved.
- |
-
Class and Description | -
---|
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.
- |
-
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.
- |
-
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
Class | -Description | -
---|---|
SortedCopyOnWriteArrayTest | -- |
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.concurrency | -- |
com.comphenix.protocol.events | -- |
Class and Description | -
---|
PacketConstructor
- A packet constructor that uses an internal Minecraft.
- |
-
Class and Description | -
---|
PrioritizedListener
- Represents a listener with a priority.
- |
-
Class and Description | -
---|
GamePhase
- The current player phase.
- |
-
public static class Metrics.Graph
-extends java.lang.Object
-Modifier and Type | -Method and Description | -
---|---|
void |
-addPlotter(Metrics.Plotter plotter)
-Add a plotter to the graph, which will be used to plot entries
- |
-
boolean |
-equals(java.lang.Object object) |
-
java.lang.String |
-getName()
-Gets the graph's name
- |
-
java.util.Set<Metrics.Plotter> |
-getPlotters()
-Gets an unmodifiable set of the plotter objects in the graph
- |
-
int |
-hashCode() |
-
protected void |
-onOptOut()
-Called when the server owner decides to opt-out of BukkitMetrics while the server is running.
- |
-
void |
-removePlotter(Metrics.Plotter plotter)
-Remove a plotter from the graph
- |
-
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
public java.lang.String getName()-
public void addPlotter(Metrics.Plotter plotter)-
plotter
- the plotter to add to the graphpublic void removePlotter(Metrics.Plotter plotter)-
plotter
- the plotter to remove from the graphpublic java.util.Set<Metrics.Plotter> getPlotters()-
Set
of the plotter objectspublic int hashCode()-
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object object)-
equals
in class java.lang.Object
protected void onOptOut()-
public abstract static class Metrics.Plotter
-extends java.lang.Object
-Constructor and Description | -
---|
Metrics.Plotter()
-Construct a plotter with the default plot name
- |
-
Metrics.Plotter(java.lang.String name)
-Construct a plotter with a specific plot name
- |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-equals(java.lang.Object object) |
-
java.lang.String |
-getColumnName()
-Get the column name for the plotted point
- |
-
abstract int |
-getValue()
-Get the current value for the plotted point.
- |
-
int |
-hashCode() |
-
void |
-reset()
-Called after the website graphs have been updated
- |
-
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
public Metrics.Plotter()-
public Metrics.Plotter(java.lang.String name)-
name
- the name of the plotter to use, which will show up on the websitepublic abstract int getValue()-
public java.lang.String getColumnName()-
public void reset()-
public int hashCode()-
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object object)-
equals
in class java.lang.Object
public class Metrics
-extends java.lang.Object
-The metrics class obtains data about a plugin and submits statistics about it to the metrics backend.
- Public methods provided by this class:
-
- Graph createGraph(String name);
- void addCustomData(BukkitMetrics.Plotter plotter);
- void start();
-
Modifier and Type | -Class and Description | -
---|---|
static class |
-Metrics.Graph
-Represents a custom graph on the website
- |
-
static class |
-Metrics.Plotter
-Interface used to collect custom data for a plugin
- |
-
Constructor and Description | -
---|
Metrics(org.bukkit.plugin.Plugin plugin) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-addCustomData(Metrics.Plotter plotter)
-Adds a custom data plotter to the default graph
- |
-
void |
-addGraph(Metrics.Graph graph)
-Add a Graph object to BukkitMetrics that represents data for the plugin that should be sent to the backend
- |
-
Metrics.Graph |
-createGraph(java.lang.String name)
-Construct and create a Graph that can be used to separate specific plotters to their own graphs on the metrics
- website.
- |
-
void |
-disable()
-Disables metrics for the server by setting "opt-out" to true in the config file and canceling the metrics task.
- |
-
void |
-enable()
-Enables metrics for the server by setting "opt-out" to false in the config file and starting the metrics task.
- |
-
java.io.File |
-getConfigFile()
-Gets the File object of the config file that should be used to store data such as the GUID and opt-out status
- |
-
boolean |
-isOptOut()
-Has the server owner denied plugin metrics?
- |
-
boolean |
-start()
-Start measuring statistics.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Metrics(org.bukkit.plugin.Plugin plugin) - throws java.io.IOException-
java.io.IOException
public Metrics.Graph createGraph(java.lang.String name)-
name
- The name of the graphpublic void addGraph(Metrics.Graph graph)-
graph
- The name of the graphpublic void addCustomData(Metrics.Plotter plotter)-
plotter
- The plotter to use to plot custom datapublic boolean start()-
public boolean isOptOut()-
public void enable() - throws java.io.IOException-
java.io.IOException
public void disable() - throws java.io.IOException-
java.io.IOException
public java.io.File getConfigFile()-
public class Statistics
-extends java.lang.Object
-Constructor and Description | -
---|
Statistics(org.bukkit.plugin.Plugin plugin) |
-
public static enum Updater.UpdateResult -extends java.lang.Enum<Updater.UpdateResult>-
Enum Constant and Description | -
---|
FAIL_BADSLUG
-The slug provided by the plugin running the updater was invalid and doesn't exist on DBO.
- |
-
FAIL_DBO
-For some reason, the updater was unable to contact dev.bukkit.org to download the file.
- |
-
FAIL_DOWNLOAD
-The updater found an update, but was unable to download it.
- |
-
FAIL_NOVERSION
-When running the version check, the file on DBO did not contain the a version in the format 'vVersion' such as 'v1.0'.
- |
-
NO_UPDATE
-The updater did not find an update, and nothing was downloaded.
- |
-
NOT_SUPPORTED
-Updating SNAPSHOT versions are not supported.
- |
-
SUCCESS
-The updater found an update, and has readied it to be loaded the next time the server restarts/reloads.
- |
-
UPDATE_AVAILABLE
-The updater found an update, but because of the UpdateType being set to NO_DOWNLOAD, it wasn't downloaded.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static Updater.UpdateResult |
-getResult(int value) |
-
int |
-getValue() |
-
java.lang.String |
-toString() |
-
static Updater.UpdateResult |
-valueOf(java.lang.String name)
-Returns the enum constant of this type with the specified name.
- |
-
static Updater.UpdateResult[] |
-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, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final Updater.UpdateResult SUCCESS-
public static final Updater.UpdateResult NO_UPDATE-
public static final Updater.UpdateResult FAIL_DOWNLOAD-
public static final Updater.UpdateResult FAIL_DBO-
public static final Updater.UpdateResult FAIL_NOVERSION-
public static final Updater.UpdateResult FAIL_BADSLUG-
public static final Updater.UpdateResult UPDATE_AVAILABLE-
public static final Updater.UpdateResult NOT_SUPPORTED-
public static Updater.UpdateResult[] values()-
-for (Updater.UpdateResult c : Updater.UpdateResult.values()) - System.out.println(c); -
public static Updater.UpdateResult 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 getValue()-
public static Updater.UpdateResult getResult(int value)-
public java.lang.String toString()-
toString
in class java.lang.Enum<Updater.UpdateResult>
public static enum Updater.UpdateType -extends java.lang.Enum<Updater.UpdateType>-
Enum Constant and Description | -
---|
DEFAULT
-Run a version check, and then if the file is out of date, download the newest version.
- |
-
NO_DOWNLOAD
-Get information about the version and the download size, but don't actually download anything.
- |
-
NO_VERSION_CHECK
-Don't run a version check, just find the latest update and download it.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static Updater.UpdateType |
-getResult(int value) |
-
int |
-getValue() |
-
static Updater.UpdateType |
-valueOf(java.lang.String name)
-Returns the enum constant of this type with the specified name.
- |
-
static Updater.UpdateType[] |
-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 Updater.UpdateType DEFAULT-
public static final Updater.UpdateType NO_VERSION_CHECK-
public static final Updater.UpdateType NO_DOWNLOAD-
public static Updater.UpdateType[] values()-
-for (Updater.UpdateType c : Updater.UpdateType.values()) - System.out.println(c); -
public static Updater.UpdateType 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 getValue()-
public static Updater.UpdateType getResult(int value)-
public class Updater
-extends java.lang.Object
-
- VERY, VERY IMPORTANT: Because there are no standards for adding auto-update toggles in your plugin's config, this system provides NO CHECK WITH YOUR CONFIG to make sure the user has allowed auto-updating.
-
- It is a BUKKIT POLICY that you include a boolean value in your config that prevents the auto-updater from running AT ALL.
-
- If you fail to include this option in your config, your plugin will be REJECTED when you attempt to submit it to dev.bukkit.org.
-
- An example of a good configuration option would be something similar to 'auto-update: true' - if this value is set to false you may NOT run the auto-updater.
-
- If you are unsure about these rules, please read the plugin submission guidelines: http://goo.gl/8iU5l
Modifier and Type | -Class and Description | -
---|---|
static class |
-Updater.UpdateResult
-Gives the dev the result of the update process.
- |
-
static class |
-Updater.UpdateType
-Allows the dev to specify the type of update that will be run.
- |
-
Constructor and Description | -
---|
Updater(org.bukkit.plugin.Plugin plugin,
- java.util.logging.Logger logger,
- java.lang.String slug,
- java.io.File file,
- java.lang.String permission)
-Initialize the updater
- |
-
Modifier and Type | -Method and Description | -
---|---|
long |
-getFileSize()
-Get the total bytes of the file (can only be used after running a version check or a normal run).
- |
-
java.lang.String |
-getLatestVersionString()
-Get the version string latest file avaliable online.
- |
-
Updater.UpdateResult |
-getResult()
-Get the result of the update process.
- |
-
boolean |
-pluginFile(java.lang.String name)
-Check if the name of a jar is one of the plugins currently installed, used for extracting the correct files out of a zip.
- |
-
Updater.UpdateResult |
-update(Updater.UpdateType type,
- boolean announce)
-Update the plugin.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Updater(org.bukkit.plugin.Plugin plugin, - java.util.logging.Logger logger, - java.lang.String slug, - java.io.File file, - java.lang.String permission)-
plugin
- The plugin that is checking for an update.slug
- The dev.bukkit.org slug of the project (http://dev.bukkit.org/server-mods/SLUG_IS_HERE)file
- The file that the plugin is running from, get this by doing this.getFile() from within your main class.permission
- Permission needed to read the output of the update process.public Updater.UpdateResult update(Updater.UpdateType type, - boolean announce)-
type
- Specify the type of update this will be. See Updater.UpdateType
announce
- True if the program should announce the progress of new updates in consolepublic Updater.UpdateResult getResult()-
public long getFileSize()-
public java.lang.String getLatestVersionString()-
public boolean pluginFile(java.lang.String name)-
Package | -Description | -
---|---|
com.comphenix.protocol.metrics | -- |
Modifier and Type | -Method and Description | -
---|---|
Metrics.Graph |
-Metrics.createGraph(java.lang.String name)
-Construct and create a Graph that can be used to separate specific plotters to their own graphs on the metrics
- website.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-Metrics.addGraph(Metrics.Graph graph)
-Add a Graph object to BukkitMetrics that represents data for the plugin that should be sent to the backend
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.metrics | -- |
Modifier and Type | -Method and Description | -
---|---|
java.util.Set<Metrics.Plotter> |
-Metrics.Graph.getPlotters()
-Gets an unmodifiable set of the plotter objects in the graph
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-Metrics.addCustomData(Metrics.Plotter plotter)
-Adds a custom data plotter to the default graph
- |
-
void |
-Metrics.Graph.addPlotter(Metrics.Plotter plotter)
-Add a plotter to the graph, which will be used to plot entries
- |
-
void |
-Metrics.Graph.removePlotter(Metrics.Plotter plotter)
-Remove a plotter from the graph
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
Modifier and Type | -Method and Description | -
---|---|
Statistics |
-ProtocolLibrary.getStatistics()
-Retrieve the metrics instance used to measure users of this library.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.metrics | -- |
Modifier and Type | -Method and Description | -
---|---|
Updater.UpdateResult |
-Updater.getResult()
-Get the result of the update process.
- |
-
static Updater.UpdateResult |
-Updater.UpdateResult.getResult(int value) |
-
Updater.UpdateResult |
-Updater.update(Updater.UpdateType type,
- boolean announce)
-Update the plugin.
- |
-
static Updater.UpdateResult |
-Updater.UpdateResult.valueOf(java.lang.String name)
-Returns the enum constant of this type with the specified name.
- |
-
static Updater.UpdateResult[] |
-Updater.UpdateResult.values()
-Returns an array containing the constants of this enum type, in
-the order they are declared.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.metrics | -- |
Modifier and Type | -Method and Description | -
---|---|
static Updater.UpdateType |
-Updater.UpdateType.getResult(int value) |
-
static Updater.UpdateType |
-Updater.UpdateType.valueOf(java.lang.String name)
-Returns the enum constant of this type with the specified name.
- |
-
static Updater.UpdateType[] |
-Updater.UpdateType.values()
-Returns an array containing the constants of this enum type, in
-the order they are declared.
- |
-
Modifier and Type | -Method and Description | -
---|---|
Updater.UpdateResult |
-Updater.update(Updater.UpdateType type,
- boolean announce)
-Update the plugin.
- |
-
Class | -Description | -
---|---|
Metrics | -
- The metrics class obtains data about a plugin and submits statistics about it to the metrics backend.
- |
-
Metrics.Graph | -
- Represents a custom graph on the website
- |
-
Metrics.Plotter | -
- Interface used to collect custom data for a plugin
- |
-
Statistics | -- |
Updater | -
- Check dev.bukkit.org to find updates for a given plugin, and download the updates if needed.
- |
-
Enum | -Description | -
---|---|
Updater.UpdateResult | -
- Gives the dev the result of the update process.
- |
-
Updater.UpdateType | -
- Allows the dev to specify the type of update that will be run.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.metrics | -- |
Class and Description | -
---|
Statistics | -
Class and Description | -
---|
Metrics.Graph
- Represents a custom graph on the website
- |
-
Metrics.Plotter
- Interface used to collect custom data for a plugin
- |
-
Updater.UpdateResult
- Gives the dev the result of the update process.
- |
-
Updater.UpdateType
- Allows the dev to specify the type of update that will be run.
- |
-
ProtocolMananger
object.See: Description
-Interface | -Description | -
---|---|
AsynchronousManager | -
- Represents a asynchronous packet handler.
- |
-
CommandFilter.FilterFailedHandler | -- |
PacketStream | -
- Represents a object capable of sending or receiving packets.
- |
-
ProtocolManager | -
- Represents an API for accessing the Minecraft protocol.
- |
-
Class | -Description | -
---|---|
Application | -
- Ignore this class.
- |
-
BukkitInitialization | -
- Used to ensure that ProtocolLib and Bukkit is prepared to be tested.
- |
-
CommandFilter | -
- A command to apply JavaScript filtering to the packet command.
- |
-
CommandFilter.Filter | -
- A filter that will be used to process a packet event.
- |
-
MinecraftVersionTest | -- |
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 | -
- The main entry point for ProtocolLib.
- |
-
ProtocolMananger
object.
- - This allows plugins to reliably and easily read and modify the packet stream of any CraftBukkit-derivative - (or specifically compatible) Minecraft-server. -
- This manager can be retrieved throught a static method in ProtocolLibrary
:
-
- ProtocolManager manager = ProtocolLibrary.getProtocolManager();
-
-
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.async | -- |
com.comphenix.protocol.utility | -- |
Class and Description | -
---|
AsynchronousManager
- Represents a asynchronous packet handler.
- |
-
CommandFilter.Filter
- A filter that will be used to process a packet event.
- |
-
CommandFilter.FilterFailedHandler | -
Packets.Client
- List of packets sent by the client.
- |
-
Packets.Server
- List of packets sent only by the server.
- |
-
PacketStream
- Represents a object capable of sending or receiving packets.
- |
-
ProtocolManager
- Represents an API for accessing the Minecraft protocol.
- |
-
Class and Description | -
---|
AsynchronousManager
- Represents a asynchronous packet handler.
- |
-
PacketStream
- Represents a object capable of sending or receiving packets.
- |
-
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(java.lang.Class<?> genericType,
- TType specific)
-Retrieve a copy of the generic type from a specific type.
- |
-
TType |
-getSpecific(java.lang.Object generic)
-Retrieve a copy of the specific type using an instance of the generic type.
- |
-
java.lang.Class<TType> |
-getSpecificType()
-Due to type erasion, we need to explicitly keep a reference to the specific type.
- |
-
TType getSpecific(java.lang.Object generic)-
generic
- - the generic type.java.lang.Object getGeneric(java.lang.Class<?> genericType, - TType specific)-
genericType
- - class or super class of the generic type.specific
- - the specific type we need to copy.java.lang.Class<TType> getSpecificType()-
public class FieldAccessException
-extends java.lang.RuntimeException
-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
-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.Constructor<?> |
-getConstructor(AbstractFuzzyMatcher<MethodInfo> matcher)
-Retrieve the first constructor that matches.
- |
-
java.util.List<java.lang.reflect.Constructor<?>> |
-getConstructorList(AbstractFuzzyMatcher<MethodInfo> matcher)
-Retrieve a list of every constructor that matches the given matcher.
- |
-
java.util.Set<java.lang.reflect.Constructor<?>> |
-getConstructors()
-Retrieves all private and public constructors in declared order (after JDK 1.5).
- |
-
java.lang.reflect.Field |
-getField(AbstractFuzzyMatcher<java.lang.reflect.Field> matcher)
-Retrieve the first field that matches.
- |
-
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 name,
- java.lang.Class<?> type)
-Retrieves the first field with a type equal to or more specific to the given type.
- |
-
java.lang.reflect.Field |
-getFieldByType(java.lang.String typeRegex,
- java.util.Set<java.lang.Class> ignored)
-Retrieves a field by type.
- |
-
java.util.List<java.lang.reflect.Field> |
-getFieldList(AbstractFuzzyMatcher<java.lang.reflect.Field> matcher)
-Retrieve a list of every field that matches the given matcher.
- |
-
java.util.List<java.lang.reflect.Field> |
-getFieldListByType(java.lang.Class<?> type)
-Retrieves every field with a type equal to or more specific to the given type.
- |
-
java.util.Set<java.lang.reflect.Field> |
-getFields()
-Retrieves all private and public fields in declared order (after JDK 1.5).
- |
-
java.util.Map<java.lang.String,java.lang.reflect.Method> |
-getMappedMethods(java.util.List<java.lang.reflect.Method> methods)
-Retrieve every method as a map over names.
- |
-
java.lang.reflect.Method |
-getMethod(AbstractFuzzyMatcher<MethodInfo> matcher)
-Retrieve the first method that matches.
- |
-
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.lang.reflect.Method |
-getMethodByParameters(java.lang.String name,
- java.lang.String returnTypeRegex,
- java.lang.String[] argsRegex)
-Retrieves a method by looking at the parameter types and return type only.
- |
-
java.util.List<java.lang.reflect.Method> |
-getMethodList(AbstractFuzzyMatcher<MethodInfo> matcher)
-Retrieve a list of every method that matches the given matcher.
- |
-
java.util.List<java.lang.reflect.Method> |
-getMethodListByParameters(java.lang.Class<?> returnType,
- java.lang.Class<?>[] args)
-Retrieves every method that has the given parameter types and return type.
- |
-
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 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 getMethod(AbstractFuzzyMatcher<MethodInfo> matcher)-
- ForceAccess must be TRUE in order for this method to access private, protected and package level method.
matcher
- - the matcher to use.java.lang.IllegalArgumentException
- If the method cannot be found.public java.util.List<java.lang.reflect.Method> getMethodList(AbstractFuzzyMatcher<MethodInfo> matcher)-
- ForceAccess must be TRUE in order for this method to access private, protected and package level methods.
matcher
- - the matcher to apply.public java.lang.reflect.Method getMethodByName(java.lang.String nameRegex)-
nameRegex
- - regular expression that will match method names.java.lang.IllegalArgumentException
- If the method cannot be found.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.java.lang.IllegalArgumentException
- If the method cannot be found.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.java.lang.IllegalArgumentException
- If the method cannot be found.public java.lang.reflect.Method getMethodByParameters(java.lang.String name, - java.lang.String returnTypeRegex, - java.lang.String[] argsRegex)-
name
- - potential name of the method. Only used by the error mechanism.returnTypeRegex
- - regular expression matching the return type of the method to find.argsRegex
- - regular expressions of the matching parameter types.java.lang.IllegalArgumentException
- If the method cannot be found.public java.util.List<java.lang.reflect.Method> getMethodListByParameters(java.lang.Class<?> returnType, - java.lang.Class<?>[] args)-
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.java.lang.IllegalArgumentException
- If the field cannot be found.public java.lang.reflect.Field getFieldByType(java.lang.String name, - java.lang.Class<?> type)-
name
- - name the field probably is given. This will only be used in the error message.type
- - type of the field to find.public java.util.List<java.lang.reflect.Field> getFieldListByType(java.lang.Class<?> type)-
type
- - type of the fields to find.public java.lang.reflect.Field getField(AbstractFuzzyMatcher<java.lang.reflect.Field> matcher)-
- ForceAccess must be TRUE in order for this method to access private, protected and package level fields.
matcher
- - the matcher to use.java.lang.IllegalArgumentException
- If the method cannot be found.public java.util.List<java.lang.reflect.Field> getFieldList(AbstractFuzzyMatcher<java.lang.reflect.Field> matcher)-
- ForceAccess must be TRUE in order for this method to access private, protected and package level fields.
matcher
- - the matcher to apply.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.java.lang.IllegalArgumentException
- If the field cannot be found.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.java.lang.IllegalArgumentException
- If the field cannot be found.public java.lang.reflect.Constructor<?> getConstructor(AbstractFuzzyMatcher<MethodInfo> matcher)-
- ForceAccess must be TRUE in order for this method to access private, protected and package level constructors.
matcher
- - the matcher to use.java.lang.IllegalArgumentException
- If the constructor cannot be found.public java.util.Map<java.lang.String,java.lang.reflect.Method> getMappedMethods(java.util.List<java.lang.reflect.Method> methods)-
- Note that overloaded methods will only occur once in the resulting map.
methods
- - every method.public java.util.List<java.lang.reflect.Constructor<?>> getConstructorList(AbstractFuzzyMatcher<MethodInfo> matcher)-
- ForceAccess must be TRUE in order for this method to access private, protected and package level constructors.
matcher
- - the matcher to apply.public java.util.Set<java.lang.reflect.Field> getFields()-
- Private, protected and package fields are ignored if forceAccess is FALSE.
public java.util.Set<java.lang.reflect.Method> getMethods()-
- Private, protected and package methods are ignored if forceAccess is FALSE.
public java.util.Set<java.lang.reflect.Constructor<?>> getConstructors()-
- Private, protected and package constructors are ignored if forceAccess is FALSE.
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.
- |
-
java.util.Set<java.lang.Integer> |
-values()
-Retrieve the ID of every registered member.
- |
-
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 java.util.Set<java.lang.Integer> values()-
public abstract class MethodInfo
-extends java.lang.Object
-implements java.lang.reflect.GenericDeclaration, java.lang.reflect.Member
-DECLARED, PUBLIC
Constructor and Description | -
---|
MethodInfo() |
-
Modifier and Type | -Method and Description | -
---|---|
static MethodInfo |
-fromConstructor(java.lang.reflect.Constructor<?> constructor)
-Wraps a constructor as a method information object.
- |
-
static java.util.List<MethodInfo> |
-fromConstructors(java.util.Collection<java.lang.reflect.Constructor<?>> constructors)
-Construct a list of method infos from a given collection of constructors.
- |
-
static java.util.Collection<MethodInfo> |
-fromConstructors(java.lang.reflect.Constructor<?>[] constructors)
-Construct a list of method infos from a given array of constructors.
- |
-
static MethodInfo |
-fromMethod(java.lang.reflect.Method method)
-Wraps a method as a MethodInfo object.
- |
-
static java.util.List<MethodInfo> |
-fromMethods(java.util.Collection<java.lang.reflect.Method> methods)
-Construct a list of method infos from a given collection of methods.
- |
-
static java.util.Collection<MethodInfo> |
-fromMethods(java.lang.reflect.Method[] methods)
-Construct a list of method infos from a given array of methods.
- |
-
abstract java.lang.Class<?>[] |
-getExceptionTypes()
-Returns an array of Class objects that represent the types of the exceptions declared to be thrown by the
- underlying method or constructor represented by this MethodInfo object.
- |
-
abstract java.lang.Class<?>[] |
-getParameterTypes()
-Returns an array of Class objects that represent the formal parameter types, in declaration order,
- of the method or constructor represented by this MethodInfo object.
- |
-
abstract java.lang.Class<?> |
-getReturnType()
-Returns a Class object that represents the formal return type of the method or constructor
- represented by this MethodInfo object.
- |
-
abstract boolean |
-isConstructor()
-Determine if this is a constructor or not.
- |
-
abstract java.lang.String |
-toGenericString()
-Returns a string describing this method or constructor, including type parameters.
- |
-
java.lang.String |
-toString()
-Returns a string describing this method or constructor
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getTypeParameters
getDeclaringClass, getModifiers, getName, isSynthetic
public static MethodInfo fromMethod(java.lang.reflect.Method method)-
method
- - the method to wrap.public static java.util.Collection<MethodInfo> fromMethods(java.lang.reflect.Method[] methods)-
methods
- - array of methods.public static java.util.List<MethodInfo> fromMethods(java.util.Collection<java.lang.reflect.Method> methods)-
methods
- - list of methods.public static MethodInfo fromConstructor(java.lang.reflect.Constructor<?> constructor)-
constructor
- - the constructor to wrap.public static java.util.Collection<MethodInfo> fromConstructors(java.lang.reflect.Constructor<?>[] constructors)-
constructors
- - array of constructors.public static java.util.List<MethodInfo> fromConstructors(java.util.Collection<java.lang.reflect.Constructor<?>> constructors)-
constructors
- - list of constructors.public java.lang.String toString()-
toString
in class java.lang.Object
Method#toString()} or {@link Constructor#toString()}
public abstract java.lang.String toGenericString()-
Method#toGenericString()} or {@link Constructor#toGenericString()}
public abstract java.lang.Class<?>[] getExceptionTypes()-
Method#getExceptionTypes()} or {@link Constructor#getExceptionTypes()}
public abstract java.lang.Class<?> getReturnType()-
- This is always Void
for constructors.
Method#getReturnType()}
public abstract java.lang.Class<?>[] getParameterTypes()-
Method#getParameterTypes()} or {@link Constructor#getParameterTypes()}
public abstract boolean isConstructor()-
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 class ObjectWriter
-extends java.lang.Object
-Constructor and Description | -
---|
ObjectWriter() |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-copyTo(java.lang.Object source,
- java.lang.Object destination,
- java.lang.Class<?> commonType)
-Copy every field in object A to object B.
- |
-
protected void |
-transformField(StructureModifier<java.lang.Object> modifierSource,
- StructureModifier<java.lang.Object> modifierDest,
- int fieldIndex)
-Called for every non-static field that will be copied.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void copyTo(java.lang.Object source, - java.lang.Object destination, - java.lang.Class<?> commonType)-
- The two objects must have the same number of fields of the same type.
source
- - fields to copy.destination
- - fields to copy to.commonType
- - type containing each field to copy.protected void transformField(StructureModifier<java.lang.Object> modifierSource, - StructureModifier<java.lang.Object> modifierDest, - int fieldIndex)-
modifierSource
- - modifier for the original object.modifierDest
- - modifier for the new cloned object.fieldIndex
- - the current field index.public class PrettyPrinter
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
static int |
-RECURSE_DEPTH
-How far we will recurse.
- |
-
Constructor and Description | -
---|
PrettyPrinter() |
-
Modifier and Type | -Method and Description | -
---|---|
static java.lang.String |
-printObject(java.lang.Object object)
-Print the content of an object.
- |
-
static java.lang.String |
-printObject(java.lang.Object object,
- java.lang.Class<?> start,
- java.lang.Class<?> stop)
-Print the content of an object.
- |
-
static java.lang.String |
-printObject(java.lang.Object object,
- java.lang.Class<?> start,
- java.lang.Class<?> stop,
- int hierachyDepth)
-Print the content of an object.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final int RECURSE_DEPTH-
public static java.lang.String printObject(java.lang.Object object) - throws java.lang.IllegalAccessException-
object
- - the object to serialize.java.lang.IllegalAccessException
public static java.lang.String printObject(java.lang.Object object, - java.lang.Class<?> start, - java.lang.Class<?> stop) - throws java.lang.IllegalAccessException-
object
- - the object to serialize.stop
- - superclass that will stop the process.java.lang.IllegalAccessException
public static java.lang.String printObject(java.lang.Object object, - java.lang.Class<?> start, - java.lang.Class<?> stop, - int hierachyDepth) - throws java.lang.IllegalAccessException-
object
- - the object to serialize.stop
- - superclass that will stop the process.java.lang.IllegalAccessException
TField
- Type of the fields to retrieve.public class StructureModifier<TField>
-extends java.lang.Object
-- Implemented by using reflection. Use a CompiledStructureModifier, if speed is essential.
Modifier and Type | -Field and Description | -
---|---|
protected EquivalentConverter<TField> |
-converter |
-
protected boolean |
-customConvertHandling |
-
protected java.util.List<java.lang.reflect.Field> |
-data |
-
protected java.util.Map<java.lang.reflect.Field,java.lang.Integer> |
-defaultFields |
-
protected java.lang.Class |
-fieldType |
-
protected java.util.Map<java.lang.Class,StructureModifier> |
-subtypeCache |
-
protected java.lang.Object |
-target |
-
protected java.lang.Class |
-targetType |
-
protected boolean |
-useStructureCompiler |
-
Modifier | -Constructor and Description | -
---|---|
protected |
-StructureModifier()
-Consumers of this method should call "initialize".
- |
-
|
-StructureModifier(java.lang.Class targetType)
-Creates a structure modifier.
- |
-
|
-StructureModifier(java.lang.Class targetType,
- java.lang.Class superclassExclude,
- boolean requireDefault)
-Creates a structure modifier.
- |
-
|
-StructureModifier(java.lang.Class targetType,
- java.lang.Class superclassExclude,
- boolean requireDefault,
- boolean useStructureCompiler)
-Creates a structure modifier.
- |
-
Modifier and Type | -Method and Description | -
---|---|
java.lang.reflect.Field |
-getField(int fieldIndex)
-Retrieve a field by index.
- |
-
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.
- |
-
protected java.lang.Class<?> |
-getFieldType(int index)
-Retrieve the type of a specified 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.
- |
-
protected void |
-initialize(java.lang.Class targetType,
- java.lang.Class fieldType,
- java.util.List<java.lang.reflect.Field> data,
- java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaultFields,
- EquivalentConverter<TField> converter,
- java.util.Map<java.lang.Class,StructureModifier> subTypeCache)
-Initialize every field of this class.
- |
-
protected void |
-initialize(java.lang.Class targetType,
- java.lang.Class fieldType,
- java.util.List<java.lang.reflect.Field> data,
- java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaultFields,
- EquivalentConverter<TField> converter,
- java.util.Map<java.lang.Class,StructureModifier> subTypeCache,
- boolean useStructureCompiler)
-Initialize every field of this class.
- |
-
protected void |
-initialize(StructureModifier<TField> other)
-Initialize using the same field types.
- |
-
boolean |
-isPublic(int fieldIndex)
-Determine if a given field is public or not.
- |
-
boolean |
-isReadOnly(int fieldIndex)
-Determine whether or not a field is read-only (final).
- |
-
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.
- |
-
protected void |
-setConverter(EquivalentConverter<TField> converter)
-Set the current object converter.
- |
-
protected static void |
-setFinalState(java.lang.reflect.Field field,
- boolean isReadOnly)
-Alter the final status of a field.
- |
-
void |
-setReadOnly(int fieldIndex,
- boolean value)
-Set whether or not a field should be treated as read only.
- |
-
int |
-size()
-Retrieve the number of readable types.
- |
-
protected <T> StructureModifier<T> |
-withFieldType(java.lang.Class fieldType,
- java.util.List<java.lang.reflect.Field> filtered,
- java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaults,
- EquivalentConverter<T> converter)
-Create a new structure modifier for the new field type.
- |
-
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
protected java.lang.Class targetType-
protected java.lang.Object target-
protected EquivalentConverter<TField> converter-
protected java.lang.Class fieldType-
protected java.util.List<java.lang.reflect.Field> data-
protected java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaultFields-
protected java.util.Map<java.lang.Class,StructureModifier> subtypeCache-
protected boolean customConvertHandling-
protected boolean useStructureCompiler-
public StructureModifier(java.lang.Class targetType)-
targetType
- - the structure to modify.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 StructureModifier(java.lang.Class targetType, - java.lang.Class superclassExclude, - boolean requireDefault, - boolean useStructureCompiler)-
targetType
- - the structure to modify.superclassExclude
- - a superclass to exclude.requireDefault
- - whether or not we will be using writeDefaults().useStructureCompiler
- - whether or not to automatically compile this structure modifier.protected StructureModifier()-
protected void initialize(StructureModifier<TField> other)-
other
- - information to set.protected void initialize(java.lang.Class targetType, - java.lang.Class fieldType, - java.util.List<java.lang.reflect.Field> data, - java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaultFields, - EquivalentConverter<TField> converter, - java.util.Map<java.lang.Class,StructureModifier> subTypeCache)-
targetType
- - type of the object we're reading and writing from.fieldType
- - the common type of the fields we're modifying.data
- - list of fields to modify.defaultFields
- - list of fields that will be automatically initialized.converter
- - converts between the common field type and the actual type the consumer expects.subTypeCache
- - a structure modifier cache.protected void initialize(java.lang.Class targetType, - java.lang.Class fieldType, - java.util.List<java.lang.reflect.Field> data, - java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaultFields, - EquivalentConverter<TField> converter, - java.util.Map<java.lang.Class,StructureModifier> subTypeCache, - boolean useStructureCompiler)-
targetType
- - type of the object we're reading and writing from.fieldType
- - the common type of the fields we're modifying.data
- - list of fields to modify.defaultFields
- - list of fields that will be automatically initialized.converter
- - converts between the common field type and the actual type the consumer expects.subTypeCache
- - a structure modifier cache.useStructureCompiler
- - whether or not to automatically compile this structure modifier.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 boolean isReadOnly(int fieldIndex)-
fieldIndex
- - index of the field.public boolean isPublic(int fieldIndex)-
fieldIndex
- - field index.public void setReadOnly(int fieldIndex, - boolean value) - throws FieldAccessException-
- Note that changing the read-only state to TRUE will only work if the current - field was recently read-only or the current structure modifier hasn't been compiled yet.
fieldIndex
- - index of the field.value
- - TRUE if this field should be read only, FALSE otherwise.FieldAccessException
- If we cannot modify the read-only status.protected static void setFinalState(java.lang.reflect.Field field, - boolean isReadOnly) - throws java.lang.IllegalAccessException-
field
- - the field to change.isReadOnly
- - TRUE if the field should be read only, FALSE otherwise.java.lang.IllegalAccessException
- If an error occured.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.protected java.lang.Class<?> getFieldType(int index)-
index
- - the index.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()-
protected <T> StructureModifier<T> withFieldType(java.lang.Class fieldType, - java.util.List<java.lang.reflect.Field> filtered, - java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaults, - EquivalentConverter<T> converter)-
fieldType
- - common type of each field.filtered
- - list of fields after filtering the original modifier.defaults
- - list of default values after filtering the original.converter
- - the new converter.public StructureModifier<TField> withTarget(java.lang.Object target)-
target
- - different target of the same type.protected void setConverter(EquivalentConverter<TField> converter)-
converter
- - current object converter.public java.util.List<java.lang.reflect.Field> getFields()-
public java.lang.reflect.Field getField(int fieldIndex)-
fieldIndex
- - index of the field to retrieve.java.lang.IllegalArgumentException
- If no field with the given index can be found.public java.util.List<TField> getValues() - throws FieldAccessException-
FieldAccessException
- Unable to access one or all of the fieldspublic 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 |
-isCurrentSet()
-Determine whether or not we'll need to revert the 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()-
public boolean isCurrentSet()-
protected void finalize() - throws java.lang.Throwable-
finalize
in class java.lang.Object
java.lang.Throwable
Package | -Description | -
---|---|
com.comphenix.protocol.reflect | -- |
com.comphenix.protocol.wrappers | -- |
Modifier and Type | -Field and Description | -
---|---|
protected EquivalentConverter<TField> |
-StructureModifier.converter |
-
Modifier and Type | -Method and Description | -
---|---|
protected void |
-StructureModifier.initialize(java.lang.Class targetType,
- java.lang.Class fieldType,
- java.util.List<java.lang.reflect.Field> data,
- java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaultFields,
- EquivalentConverter<TField> converter,
- java.util.Map<java.lang.Class,StructureModifier> subTypeCache)
-Initialize every field of this class.
- |
-
protected void |
-StructureModifier.initialize(java.lang.Class targetType,
- java.lang.Class fieldType,
- java.util.List<java.lang.reflect.Field> data,
- java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaultFields,
- EquivalentConverter<TField> converter,
- java.util.Map<java.lang.Class,StructureModifier> subTypeCache,
- boolean useStructureCompiler)
-Initialize every field of this class.
- |
-
protected void |
-StructureModifier.setConverter(EquivalentConverter<TField> converter)
-Set the current object converter.
- |
-
protected <T> StructureModifier<T> |
-StructureModifier.withFieldType(java.lang.Class fieldType,
- java.util.List<java.lang.reflect.Field> filtered,
- java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaults,
- EquivalentConverter<T> converter)
-Create a new structure modifier for the new field 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.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static EquivalentConverter<ChunkPosition> |
-ChunkPosition.getConverter()
-Used to convert between NMS ChunkPosition and the wrapper instance.
- |
-
static EquivalentConverter<WrappedDataWatcher> |
-BukkitConverters.getDataWatcherConverter()
-Retrieve a converter for the NMS DataWatcher class and our wrapper.
- |
-
static EquivalentConverter<org.bukkit.entity.Entity> |
-BukkitConverters.getEntityConverter(org.bukkit.World world)
-Retrieve a converter for NMS entities and Bukkit entities.
- |
-
static <TType> EquivalentConverter<TType> |
-BukkitConverters.getIgnoreNull(EquivalentConverter<TType> delegate)
-Wraps a given equivalent converter in NULL checks, ensuring that such values are ignored.
- |
-
static EquivalentConverter<org.bukkit.inventory.ItemStack> |
-BukkitConverters.getItemStackConverter()
-Retrieve the converter used to convert NMS ItemStacks to Bukkit's ItemStack.
- |
-
static <T> EquivalentConverter<java.util.List<T>> |
-BukkitConverters.getListConverter(java.lang.Class<?> genericItemType,
- EquivalentConverter<T> itemConverter) |
-
static EquivalentConverter<NbtBase<?>> |
-BukkitConverters.getNbtConverter()
-Retrieve an equivalent converter for net.minecraft.server NBT classes and their wrappers.
- |
-
static EquivalentConverter<WrappedWatchableObject> |
-BukkitConverters.getWatchableObjectConverter()
-Retrieve a converter for watchable objects and the respective wrapper.
- |
-
static EquivalentConverter<org.bukkit.WorldType> |
-BukkitConverters.getWorldTypeConverter()
-Retrieve a converter for Bukkit's world type enum and the NMS equivalent.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static <TType> EquivalentConverter<TType> |
-BukkitConverters.getIgnoreNull(EquivalentConverter<TType> delegate)
-Wraps a given equivalent converter in NULL checks, ensuring that such values are ignored.
- |
-
static <T> EquivalentConverter<java.util.List<T>> |
-BukkitConverters.getListConverter(java.lang.Class<?> genericItemType,
- EquivalentConverter<T> itemConverter) |
-
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.async | -- |
com.comphenix.protocol.reflect | -- |
com.comphenix.protocol.reflect.compiler | -- |
com.comphenix.protocol.wrappers | -- |
Modifier and Type | -Method and Description | -
---|---|
org.bukkit.entity.Entity |
-ProtocolManager.getEntityFromID(org.bukkit.World container,
- int id)
-Retrieve the associated entity.
- |
-
java.util.List<org.bukkit.entity.Player> |
-ProtocolManager.getEntityTrackers(org.bukkit.entity.Entity entity)
-Retrieve every client that is receiving information about a given entity.
- |
-
static java.util.Set<java.lang.Integer> |
-Packets.Server.getSupported()
-Retrieve every client packet the current version of Minecraft is aware of.
- |
-
static java.util.Set<java.lang.Integer> |
-Packets.Client.getSupported()
-Retrieve every client packet the current version of Minecraft is aware of.
- |
-
static boolean |
-Packets.Server.isSupported(int packetID)
-Determine if the given packet is a valid server packet in the current version of Minecraft.
- |
-
static boolean |
-Packets.Client.isSupported(int packetID)
-Determine if the given packet is a valid client packet in the current version of Minecraft.
- |
-
void |
-ProtocolManager.updateEntity(org.bukkit.entity.Entity entity,
- java.util.List<org.bukkit.entity.Player> observers)
-Completely resend an entity to a list of clients.
- |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-AsyncMarker.isMinecraftAsync(PacketEvent event)
-Determine if Minecraft allows asynchronous processing of this packet.
- |
-
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 |
-StructureModifier.setReadOnly(int fieldIndex,
- boolean value)
-Set whether or not a field should be treated as read only.
- |
-
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.
- |
-
Modifier and Type | -Method and Description | -
---|---|
java.lang.Object |
-CompiledStructureModifier.read(int fieldIndex) |
-
protected abstract java.lang.Object |
-CompiledStructureModifier.readGenerated(int fieldIndex) |
-
protected java.lang.Object |
-CompiledStructureModifier.readReflected(int index)
-Read the given field index using reflection.
- |
-
void |
-CompiledStructureModifier.setReadOnly(int fieldIndex,
- boolean value) |
-
StructureModifier<java.lang.Object> |
-CompiledStructureModifier.write(int index,
- java.lang.Object value) |
-
StructureModifier<java.lang.Object> |
-CompiledStructureModifier.writeDefaults() |
-
protected abstract StructureModifier<java.lang.Object> |
-CompiledStructureModifier.writeGenerated(int index,
- java.lang.Object value) |
-
protected void |
-CompiledStructureModifier.writeReflected(int index,
- java.lang.Object value)
-Write the given field using reflection.
- |
-
Modifier and Type | -Method and Description | -
---|---|
WrappedWatchableObject |
-WrappedWatchableObject.deepClone()
-Clone the current wrapped watchable object, along with any contained objects.
- |
-
java.lang.Byte |
-WrappedDataWatcher.getByte(int index)
-Get a watched byte.
- |
-
WrappedChunkCoordinate |
-WrappedDataWatcher.getChunkCoordinate(int index)
-Get a watched string.
- |
-
boolean |
-WrappedWatchableObject.getDirtyState()
-Retrieve whether or not the value must be synchronized with the client.
- |
-
static WrappedDataWatcher |
-WrappedDataWatcher.getEntityWatcher(org.bukkit.entity.Entity entity)
-Retrieve the data watcher associated with an entity.
- |
-
java.lang.Float |
-WrappedDataWatcher.getFloat(int index)
-Get a watched float.
- |
-
int |
-WrappedWatchableObject.getIndex()
-Retrieve the index of this watchable object.
- |
-
java.lang.Integer |
-WrappedDataWatcher.getInteger(int index)
-Get a watched integer.
- |
-
org.bukkit.inventory.ItemStack |
-WrappedDataWatcher.getItemStack(int index)
-Get a watched string.
- |
-
java.lang.Object |
-WrappedDataWatcher.getObject(int index)
-Retrieve a watchable object by index.
- |
-
protected java.util.concurrent.locks.ReadWriteLock |
-WrappedDataWatcher.getReadWriteLock()
-Retrieve the current read write lock.
- |
-
java.lang.Short |
-WrappedDataWatcher.getShort(int index)
-Get a watched short.
- |
-
java.lang.String |
-WrappedDataWatcher.getString(int index)
-Get a watched string.
- |
-
java.lang.Class<?> |
-WrappedWatchableObject.getType()
-Retrieve the correct super type of the current value.
- |
-
static java.lang.Class<?> |
-WrappedDataWatcher.getTypeClass(int id)
-Retrieve the type of a given ID, if it's allowed to be watched.
- |
-
int |
-WrappedWatchableObject.getTypeID()
-Retrieve the type ID of a watchable object.
- |
-
static java.lang.Integer |
-WrappedDataWatcher.getTypeID(java.lang.Class<?> clazz)
-Retrieve the ID of a given type, if it's allowed to be watched.
- |
-
java.lang.Object |
-WrappedWatchableObject.getValue()
-Read the value field.
- |
-
protected java.util.Map<java.lang.Integer,java.lang.Object> |
-WrappedDataWatcher.getWatchableObjectMap()
-Retrieve the underlying map of key values that stores watchable objects.
- |
-
java.util.List<WrappedWatchableObject> |
-WrappedDataWatcher.getWatchableObjects()
-Retrieve every watchable object in this watcher.
- |
-
java.util.Set<java.lang.Integer> |
-WrappedDataWatcher.indexSet()
-Retrieve a copy of every index associated with a watched object.
- |
-
void |
-WrappedWatchableObject.setDirtyState(boolean dirty)
-Set whether or not the value must be synchronized with the client.
- |
-
void |
-WrappedWatchableObject.setIndex(int index)
-Set the the index of this watchable object.
- |
-
void |
-WrappedDataWatcher.setObject(int index,
- java.lang.Object newValue)
-Set a watched byte.
- |
-
void |
-WrappedDataWatcher.setObject(int index,
- java.lang.Object newValue,
- boolean update)
-Set a watched byte.
- |
-
void |
-WrappedWatchableObject.setTypeID(int id)
-Set the type ID of a watchable object.
- |
-
void |
-WrappedWatchableObject.setValue(java.lang.Object newValue)
-Update the value field.
- |
-
void |
-WrappedWatchableObject.setValue(java.lang.Object newValue,
- boolean updateClient)
-Update the value field.
- |
-
int |
-WrappedDataWatcher.size()
-Retrieve the number of watched objects.
- |
-
Constructor and Description | -
---|
WrappedDataWatcher(java.util.List<WrappedWatchableObject> watchableObjects)
-Create a new data watcher for a list of watchable objects.
- |
-
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 | -
- Contains classes for retrieving the main
-ProtocolMananger 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.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect | -- |
com.comphenix.protocol.reflect.fuzzy | -- |
Modifier and Type | -Method and Description | -
---|---|
static MethodInfo |
-MethodInfo.fromConstructor(java.lang.reflect.Constructor<?> constructor)
-Wraps a constructor as a method information object.
- |
-
static MethodInfo |
-MethodInfo.fromMethod(java.lang.reflect.Method method)
-Wraps a method as a MethodInfo object.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static java.util.List<MethodInfo> |
-MethodInfo.fromConstructors(java.util.Collection<java.lang.reflect.Constructor<?>> constructors)
-Construct a list of method infos from a given collection of constructors.
- |
-
static java.util.Collection<MethodInfo> |
-MethodInfo.fromConstructors(java.lang.reflect.Constructor<?>[] constructors)
-Construct a list of method infos from a given array of constructors.
- |
-
static java.util.List<MethodInfo> |
-MethodInfo.fromMethods(java.util.Collection<java.lang.reflect.Method> methods)
-Construct a list of method infos from a given collection of methods.
- |
-
static java.util.Collection<MethodInfo> |
-MethodInfo.fromMethods(java.lang.reflect.Method[] methods)
-Construct a list of method infos from a given array of methods.
- |
-
Modifier and Type | -Method and Description | -
---|---|
java.lang.reflect.Constructor<?> |
-FuzzyReflection.getConstructor(AbstractFuzzyMatcher<MethodInfo> matcher)
-Retrieve the first constructor that matches.
- |
-
java.util.List<java.lang.reflect.Constructor<?>> |
-FuzzyReflection.getConstructorList(AbstractFuzzyMatcher<MethodInfo> matcher)
-Retrieve a list of every constructor that matches the given matcher.
- |
-
java.lang.reflect.Method |
-FuzzyReflection.getMethod(AbstractFuzzyMatcher<MethodInfo> matcher)
-Retrieve the first method that matches.
- |
-
java.util.List<java.lang.reflect.Method> |
-FuzzyReflection.getMethodList(AbstractFuzzyMatcher<MethodInfo> matcher)
-Retrieve a list of every method that matches the given matcher.
- |
-
Modifier and Type | -Method and Description | -
---|---|
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>> |
-FuzzyClassContract.getConstructorContracts()
-Retrieve an immutable list of every constructor contract.
- |
-
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>> |
-FuzzyClassContract.getMethodContracts()
-Retrieve an immutable list of every method contract.
- |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-FuzzyMethodContract.isMatch(MethodInfo value,
- java.lang.Object parent) |
-
Modifier and Type | -Method and Description | -
---|---|
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.constructor(AbstractFuzzyMatcher<MethodInfo> matcher)
-Add a new constructor contract.
- |
-
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.method(AbstractFuzzyMatcher<MethodInfo> matcher)
-Add a new method contract.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.cloning | -- |
Modifier and Type | -Field and Description | -
---|---|
protected ObjectWriter |
-FieldCloner.writer |
-
Package | -Description | -
---|---|
com.comphenix.protocol.events | -- |
com.comphenix.protocol.reflect | -- |
com.comphenix.protocol.reflect.cloning | -- |
com.comphenix.protocol.reflect.compiler | -- |
com.comphenix.protocol.wrappers | -- |
Modifier and Type | -Field and Description | -
---|---|
protected StructureModifier<java.lang.Object> |
-PacketContainer.structureModifier |
-
Modifier and Type | -Method and Description | -
---|---|
StructureModifier<java.lang.Boolean> |
-PacketContainer.getBooleans()
-Retrieves a read/write structure for every boolean field.
- |
-
StructureModifier<byte[]> |
-PacketContainer.getByteArrays()
-Retrieves a read/write structure for every byte array field.
- |
-
StructureModifier<java.lang.Byte> |
-PacketContainer.getBytes()
-Retrieves a read/write structure for every byte field.
- |
-
StructureModifier<WrappedDataWatcher> |
-PacketContainer.getDataWatcherModifier()
-Retrieves a read/write structure for data watchers.
- |
-
StructureModifier<java.lang.Double> |
-PacketContainer.getDoubles()
-Retrieves a read/write structure for every double field.
- |
-
StructureModifier<org.bukkit.entity.Entity> |
-PacketContainer.getEntityModifier(org.bukkit.World world)
-Retrieves a read/write structure for entity objects.
- |
-
StructureModifier<java.lang.Float> |
-PacketContainer.getFloat()
-Retrieves a read/write structure for every float field.
- |
-
StructureModifier<int[]> |
-PacketContainer.getIntegerArrays()
-Retrieves a read/write structure for every int array field.
- |
-
StructureModifier<java.lang.Integer> |
-PacketContainer.getIntegers()
-Retrieves a read/write structure for every integer field.
- |
-
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.Long> |
-PacketContainer.getLongs()
-Retrieves a read/write structure for every long field.
- |
-
StructureModifier<java.lang.Object> |
-PacketContainer.getModifier()
-Retrieves the generic structure modifier for this packet.
- |
-
StructureModifier<NbtBase<?>> |
-PacketContainer.getNbtModifier()
-Retrieves a read/write structure for NBT classes.
- |
-
StructureModifier<java.util.List<ChunkPosition>> |
-PacketContainer.getPositionCollectionModifier()
-Retrieves a read/write structure for collections of chunk positions.
- |
-
StructureModifier<ChunkPosition> |
-PacketContainer.getPositionModifier()
-Retrieves a read/write structure for chunk positions.
- |
-
StructureModifier<java.lang.Short> |
-PacketContainer.getShorts()
-Retrieves a read/write structure for every short field.
- |
-
<T> StructureModifier<T> |
-PacketContainer.getSpecificModifier(java.lang.Class<T> primitiveType)
-Retrieves a read/write structure for every field with the given type.
- |
-
StructureModifier<java.lang.String[]> |
-PacketContainer.getStringArrays()
-Retrieves a read/write structure for every String array field.
- |
-
StructureModifier<java.lang.String> |
-PacketContainer.getStrings()
-Retrieves a read/write structure for every String field.
- |
-
StructureModifier<java.util.List<WrappedWatchableObject>> |
-PacketContainer.getWatchableCollectionModifier()
-Retrieves a read/write structure for collections of watchable objects.
- |
-
StructureModifier<org.bukkit.WorldType> |
-PacketContainer.getWorldTypeModifier()
-Retrieves a read/write structure for the world type enum.
- |
-
Constructor and Description | -
---|
PacketContainer(int id,
- java.lang.Object handle,
- StructureModifier<java.lang.Object> structure)
-Creates a packet container for an existing packet.
- |
-
Modifier and Type | -Field and Description | -
---|---|
protected java.util.Map<java.lang.Class,StructureModifier> |
-StructureModifier.subtypeCache |
-
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.
- |
-
protected <T> StructureModifier<T> |
-StructureModifier.withFieldType(java.lang.Class fieldType,
- java.util.List<java.lang.reflect.Field> filtered,
- java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaults,
- EquivalentConverter<T> converter)
-Create a new structure modifier for the new field type.
- |
-
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.
- |
-
Modifier and Type | -Method and Description | -
---|---|
protected void |
-StructureModifier.initialize(StructureModifier<TField> other)
-Initialize using the same field types.
- |
-
protected void |
-ObjectWriter.transformField(StructureModifier<java.lang.Object> modifierSource,
- StructureModifier<java.lang.Object> modifierDest,
- int fieldIndex)
-Called for every non-static field that will be copied.
- |
-
protected void |
-ObjectWriter.transformField(StructureModifier<java.lang.Object> modifierSource,
- StructureModifier<java.lang.Object> modifierDest,
- int fieldIndex)
-Called for every non-static field that will be copied.
- |
-
Modifier and Type | -Method and Description | -
---|---|
protected void |
-StructureModifier.initialize(java.lang.Class targetType,
- java.lang.Class fieldType,
- java.util.List<java.lang.reflect.Field> data,
- java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaultFields,
- EquivalentConverter<TField> converter,
- java.util.Map<java.lang.Class,StructureModifier> subTypeCache)
-Initialize every field of this class.
- |
-
protected void |
-StructureModifier.initialize(java.lang.Class targetType,
- java.lang.Class fieldType,
- java.util.List<java.lang.reflect.Field> data,
- java.util.Map<java.lang.reflect.Field,java.lang.Integer> defaultFields,
- EquivalentConverter<TField> converter,
- java.util.Map<java.lang.Class,StructureModifier> subTypeCache,
- boolean useStructureCompiler)
-Initialize every field of this class.
- |
-
Modifier and Type | -Method and Description | -
---|---|
protected void |
-FieldCloner.defaultTransform(StructureModifier<java.lang.Object> modifierSource,
- StructureModifier<java.lang.Object> modifierDest,
- Cloner defaultCloner,
- int fieldIndex)
-Default implementation of the field transform.
- |
-
protected void |
-FieldCloner.defaultTransform(StructureModifier<java.lang.Object> modifierSource,
- StructureModifier<java.lang.Object> modifierDest,
- Cloner defaultCloner,
- int fieldIndex)
-Default implementation of the field transform.
- |
-
Modifier and Type | -Class and Description | -
---|---|
class |
-CompiledStructureModifier
-Represents a compiled structure modifier.
- |
-
Modifier and Type | -Method and Description | -
---|---|
<TField> StructureModifier<TField> |
-StructureCompiler.compile(StructureModifier<TField> source)
-Compiles the given structure modifier.
- |
-
StructureModifier<java.lang.Object> |
-CompiledStructureModifier.withTarget(java.lang.Object target) |
-
StructureModifier<java.lang.Object> |
-CompiledStructureModifier.write(int index,
- java.lang.Object value) |
-
StructureModifier<java.lang.Object> |
-CompiledStructureModifier.writeDefaults() |
-
protected abstract StructureModifier<java.lang.Object> |
-CompiledStructureModifier.writeGenerated(int index,
- java.lang.Object value) |
-
Modifier and Type | -Method and Description | -
---|---|
<TKey> void |
-BackgroundCompiler.addListener(StructureModifier<TKey> uncompiled,
- CompileListener<TKey> listener)
-Add a compile listener if we are still waiting for the structure modifier to be compiled.
- |
-
<TField> StructureModifier<TField> |
-StructureCompiler.compile(StructureModifier<TField> source)
-Compiles the given structure modifier.
- |
-
<TField> boolean |
-StructureCompiler.lookupClassLoader(StructureModifier<TField> source)
-Lookup the current class loader for any previously generated classes before we attempt to generate something.
- |
-
void |
-CompileListener.onCompiled(StructureModifier<TKey> compiledModifier)
-Invoked when a structure modifier has been successfully compiled.
- |
-
<TKey> void |
-BackgroundCompiler.scheduleCompilation(StructureModifier<TKey> uncompiled,
- CompileListener<TKey> listener)
-Ensure that the given structure modifier is eventually compiled.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-BackgroundCompiler.scheduleCompilation(java.util.Map<java.lang.Class,StructureModifier> cache,
- java.lang.Class key)
-Ensure that the indirectly given structure modifier is eventually compiled.
- |
-
Modifier and Type | -Field and Description | -
---|---|
protected StructureModifier<java.lang.Object> |
-WrappedWatchableObject.modifier |
-
public static class AggregateCloner.Builder
-extends java.lang.Object
-Constructor and Description | -
---|
AggregateCloner.Builder()
-Create a new aggregate builder.
- |
-
Modifier and Type | -Method and Description | -
---|---|
AggregateCloner.Builder |
-andThen(java.lang.Class<? extends Cloner> type)
-Add the next cloner that will be considered in turn.
- |
-
AggregateCloner.Builder |
-andThen(com.google.common.base.Function<AggregateCloner.BuilderParameters,Cloner> factory)
-Add the next cloner that will be considered in turn.
- |
-
AggregateCloner |
-build()
-Build a new aggregate cloner using the supplied values.
- |
-
AggregateCloner.Builder |
-instanceProvider(InstanceProvider provider)
-Set the instance provider supplied to all cloners in this builder.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public AggregateCloner.Builder()-
public AggregateCloner.Builder instanceProvider(InstanceProvider provider)-
provider
- - new instance provider.public AggregateCloner.Builder andThen(java.lang.Class<? extends Cloner> type)-
type
- - the type of the next cloner.public AggregateCloner.Builder andThen(com.google.common.base.Function<AggregateCloner.BuilderParameters,Cloner> factory)-
factory
- - factory constructing the next cloner.public AggregateCloner build()-
public static class AggregateCloner.BuilderParameters
-extends java.lang.Object
-Modifier and Type | -Method and Description | -
---|---|
Cloner |
-getAggregateCloner()
-Retrieve the aggregate cloner that is being built.
- |
-
InstanceProvider |
-getInstanceProvider()
-Retrieve the instance provider last set in the builder.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public InstanceProvider getInstanceProvider()-
public Cloner getAggregateCloner()-
Modifier and Type | -Class and Description | -
---|---|
static class |
-AggregateCloner.Builder
-Represents a builder for aggregate (combined) cloners.
- |
-
static class |
-AggregateCloner.BuilderParameters
-Supplies the cloner factories with necessary parameters.
- |
-
Modifier and Type | -Field and Description | -
---|---|
static AggregateCloner |
-DEFAULT
-Represents a default aggregate cloner.
- |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-canClone(java.lang.Object source)
-Determine whether or not the current cloner can clone the given object.
- |
-
java.lang.Object |
-clone(java.lang.Object source)
-Perform the clone.
- |
-
java.util.List<Cloner> |
-getCloners()
-Retrieves a view of the current list of cloners.
- |
-
static AggregateCloner.Builder |
-newBuilder()
-Begins constructing a new aggregate cloner.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final AggregateCloner DEFAULT-
public static AggregateCloner.Builder newBuilder()-
public java.util.List<Cloner> getCloners()-
public boolean canClone(java.lang.Object source)-
Cloner
public java.lang.Object clone(java.lang.Object source)-
Cloner
- This method should never be called unless a corresponding Cloner.canClone(Object)
returns TRUE.
Constructor and Description | -
---|
BukkitCloner() |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-canClone(java.lang.Object source)
-Determine whether or not the current cloner can clone the given object.
- |
-
java.lang.Object |
-clone(java.lang.Object source)
-Perform the clone.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public boolean canClone(java.lang.Object source)-
Cloner
public java.lang.Object clone(java.lang.Object source)-
Cloner
- This method should never be called unless a corresponding Cloner.canClone(Object)
returns TRUE.
public interface Cloner
-boolean canClone(java.lang.Object source)-
source
- - the object that is being considered.java.lang.Object clone(java.lang.Object source)-
- This method should never be called unless a corresponding canClone(Object)
returns TRUE.
source
- - the value to clone.java.lang.IllegalArgumentException
- If this cloner cannot perform the clone.Constructor and Description | -
---|
CollectionCloner(Cloner defaultCloner)
-Constructs a new collection and array cloner with the given inner element cloner.
- |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-canClone(java.lang.Object source)
-Determine whether or not the current cloner can clone the given object.
- |
-
java.lang.Object |
-clone(java.lang.Object source)
-Perform the clone.
- |
-
Cloner |
-getDefaultCloner()
-Retrieve the default cloner used to clone the content of each element in the collection.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public CollectionCloner(Cloner defaultCloner)-
defaultCloner
- - default inner element cloner.public boolean canClone(java.lang.Object source)-
Cloner
public java.lang.Object clone(java.lang.Object source)-
Cloner
- This method should never be called unless a corresponding Cloner.canClone(Object)
returns TRUE.
public Cloner getDefaultCloner()-
Modifier and Type | -Field and Description | -
---|---|
protected Cloner |
-defaultCloner |
-
protected InstanceProvider |
-instanceProvider |
-
protected ObjectWriter |
-writer |
-
Constructor and Description | -
---|
FieldCloner(Cloner defaultCloner,
- InstanceProvider instanceProvider)
-Constructs a field cloner that copies objects by reading and writing the internal fields directly.
- |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-canClone(java.lang.Object source)
-Determine whether or not the current cloner can clone the given object.
- |
-
java.lang.Object |
-clone(java.lang.Object source)
-Perform the clone.
- |
-
protected void |
-defaultTransform(StructureModifier<java.lang.Object> modifierSource,
- StructureModifier<java.lang.Object> modifierDest,
- Cloner defaultCloner,
- int fieldIndex)
-Default implementation of the field transform.
- |
-
Cloner |
-getDefaultCloner()
-Retrieve the default cloner used to clone the content of each field.
- |
-
InstanceProvider |
-getInstanceProvider()
-Retrieve the instance provider this cloner is using to create new, empty classes.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected Cloner defaultCloner-
protected InstanceProvider instanceProvider-
protected ObjectWriter writer-
public FieldCloner(Cloner defaultCloner, - InstanceProvider instanceProvider)-
defaultCloner
- - the default cloner used while copying fields.instanceProvider
- - used to construct new, empty copies of a given type.protected void defaultTransform(StructureModifier<java.lang.Object> modifierSource, - StructureModifier<java.lang.Object> modifierDest, - Cloner defaultCloner, - int fieldIndex)-
modifierSource
- - modifier for the original object.modifierDest
- - modifier for the new cloned object.defaultCloner
- - cloner to use.fieldIndex
- - the current field index.public boolean canClone(java.lang.Object source)-
Cloner
public java.lang.Object clone(java.lang.Object source)-
Cloner
- This method should never be called unless a corresponding Cloner.canClone(Object)
returns TRUE.
public Cloner getDefaultCloner()-
public InstanceProvider getInstanceProvider()-
Constructor and Description | -
---|
ImmutableDetector() |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-canClone(java.lang.Object source)
-Determine whether or not the current cloner can clone the given object.
- |
-
java.lang.Object |
-clone(java.lang.Object source)
-Perform the clone.
- |
-
static boolean |
-isImmutable(java.lang.Class<?> type)
-Determine if the given type is probably immutable.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public boolean canClone(java.lang.Object source)-
Cloner
public static boolean isImmutable(java.lang.Class<?> type)-
type
- - the type to check.public java.lang.Object clone(java.lang.Object source)-
Cloner
- This method should never be called unless a corresponding Cloner.canClone(Object)
returns TRUE.
Modifier and Type | -Field and Description | -
---|---|
protected Cloner |
-wrapped |
-
Constructor and Description | -
---|
NullableCloner(Cloner wrapped) |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-canClone(java.lang.Object source)
-Determine whether or not the current cloner can clone the given object.
- |
-
java.lang.Object |
-clone(java.lang.Object source)
-Perform the clone.
- |
-
Cloner |
-getWrapped() |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public boolean canClone(java.lang.Object source)-
Cloner
public java.lang.Object clone(java.lang.Object source)-
Cloner
- This method should never be called unless a corresponding Cloner.canClone(Object)
returns TRUE.
public Cloner getWrapped()-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.cloning | -- |
Modifier and Type | -Method and Description | -
---|---|
AggregateCloner.Builder |
-AggregateCloner.Builder.andThen(java.lang.Class<? extends Cloner> type)
-Add the next cloner that will be considered in turn.
- |
-
AggregateCloner.Builder |
-AggregateCloner.Builder.andThen(com.google.common.base.Function<AggregateCloner.BuilderParameters,Cloner> factory)
-Add the next cloner that will be considered in turn.
- |
-
AggregateCloner.Builder |
-AggregateCloner.Builder.instanceProvider(InstanceProvider provider)
-Set the instance provider supplied to all cloners in this builder.
- |
-
static AggregateCloner.Builder |
-AggregateCloner.newBuilder()
-Begins constructing a new aggregate cloner.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.cloning | -- |
Modifier and Type | -Method and Description | -
---|---|
AggregateCloner.Builder |
-AggregateCloner.Builder.andThen(com.google.common.base.Function<AggregateCloner.BuilderParameters,Cloner> factory)
-Add the next cloner that will be considered in turn.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.cloning | -- |
Modifier and Type | -Field and Description | -
---|---|
static AggregateCloner |
-AggregateCloner.DEFAULT
-Represents a default aggregate cloner.
- |
-
Modifier and Type | -Method and Description | -
---|---|
AggregateCloner |
-AggregateCloner.Builder.build()
-Build a new aggregate cloner using the supplied values.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.cloning | -- |
Modifier and Type | -Class and Description | -
---|---|
class |
-AggregateCloner
-Implements a cloning procedure by trying multiple methods in turn until one is successful.
- |
-
class |
-BukkitCloner
-Represents an object that can clone a specific list of Bukkit- and Minecraft-related objects.
- |
-
class |
-CollectionCloner
-Attempts to clone collection and array classes.
- |
-
class |
-FieldCloner
-Represents a class capable of cloning objects by deeply copying its fields.
- |
-
class |
-ImmutableDetector
-Detects classes that are immutable, and thus doesn't require cloning.
- |
-
class |
-NullableCloner
-Creates a cloner wrapper that accepts and clones NULL values.
- |
-
Modifier and Type | -Field and Description | -
---|---|
protected Cloner |
-FieldCloner.defaultCloner |
-
protected Cloner |
-NullableCloner.wrapped |
-
Modifier and Type | -Method and Description | -
---|---|
Cloner |
-AggregateCloner.BuilderParameters.getAggregateCloner()
-Retrieve the aggregate cloner that is being built.
- |
-
Cloner |
-FieldCloner.getDefaultCloner()
-Retrieve the default cloner used to clone the content of each field.
- |
-
Cloner |
-CollectionCloner.getDefaultCloner()
-Retrieve the default cloner used to clone the content of each element in the collection.
- |
-
Cloner |
-NullableCloner.getWrapped() |
-
Modifier and Type | -Method and Description | -
---|---|
java.util.List<Cloner> |
-AggregateCloner.getCloners()
-Retrieves a view of the current list of cloners.
- |
-
Modifier and Type | -Method and Description | -
---|---|
protected void |
-FieldCloner.defaultTransform(StructureModifier<java.lang.Object> modifierSource,
- StructureModifier<java.lang.Object> modifierDest,
- Cloner defaultCloner,
- int fieldIndex)
-Default implementation of the field transform.
- |
-
Modifier and Type | -Method and Description | -
---|---|
AggregateCloner.Builder |
-AggregateCloner.Builder.andThen(java.lang.Class<? extends Cloner> type)
-Add the next cloner that will be considered in turn.
- |
-
AggregateCloner.Builder |
-AggregateCloner.Builder.andThen(com.google.common.base.Function<AggregateCloner.BuilderParameters,Cloner> factory)
-Add the next cloner that will be considered in turn.
- |
-
Constructor and Description | -
---|
CollectionCloner(Cloner defaultCloner)
-Constructs a new collection and array cloner with the given inner element cloner.
- |
-
FieldCloner(Cloner defaultCloner,
- InstanceProvider instanceProvider)
-Constructs a field cloner that copies objects by reading and writing the internal fields directly.
- |
-
NullableCloner(Cloner wrapped) |
-
Interface | -Description | -
---|---|
Cloner | -
- Represents an object that is capable of cloning other objects.
- |
-
Class | -Description | -
---|---|
AggregateCloner | -
- Implements a cloning procedure by trying multiple methods in turn until one is successful.
- |
-
AggregateCloner.Builder | -
- Represents a builder for aggregate (combined) cloners.
- |
-
AggregateCloner.BuilderParameters | -
- Supplies the cloner factories with necessary parameters.
- |
-
BukkitCloner | -
- Represents an object that can clone a specific list of Bukkit- and Minecraft-related objects.
- |
-
CollectionCloner | -
- Attempts to clone collection and array classes.
- |
-
FieldCloner | -
- Represents a class capable of cloning objects by deeply copying its fields.
- |
-
ImmutableDetector | -
- Detects classes that are immutable, and thus doesn't require cloning.
- |
-
NullableCloner | -
- Creates a cloner wrapper that accepts and clones NULL values.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.cloning | -- |
Class and Description | -
---|
AggregateCloner
- Implements a cloning procedure by trying multiple methods in turn until one is successful.
- |
-
AggregateCloner.Builder
- Represents a builder for aggregate (combined) cloners.
- |
-
AggregateCloner.BuilderParameters
- Supplies the cloner factories with necessary parameters.
- |
-
Cloner
- Represents an object that is capable of cloning other objects.
- |
-
public class BackgroundCompiler
-extends java.lang.Object
-- This is necessary as we cannot block the main thread.
Modifier and Type | -Field and Description | -
---|---|
static double |
-DEFAULT_DISABLE_AT_PERM_GEN
-The default fraction of perm gen space after which the background compiler will be disabled.
- |
-
static ReportType |
-REPORT_CANNOT_COMPILE_STRUCTURE_MODIFIER |
-
static ReportType |
-REPORT_CANNOT_SCHEDULE_COMPILATION |
-
static int |
-SHUTDOWN_DELAY_MS |
-
static java.lang.String |
-THREAD_FORMAT
-The default format for the name of new worker threads.
- |
-
Constructor and Description | -
---|
BackgroundCompiler(java.lang.ClassLoader loader,
- ErrorReporter reporter)
-Initialize a background compiler.
- |
-
BackgroundCompiler(java.lang.ClassLoader loader,
- ErrorReporter reporter,
- java.util.concurrent.ExecutorService executor)
-Initialize a background compiler utilizing the given thread pool.
- |
-
Modifier and Type | -Method and Description | -
---|---|
<TKey> void |
-addListener(StructureModifier<TKey> uncompiled,
- CompileListener<TKey> listener)
-Add a compile listener if we are still waiting for the structure modifier to be compiled.
- |
-
StructureCompiler |
-getCompiler()
-Retrieve the current structure compiler.
- |
-
double |
-getDisablePermGenFraction()
-Retrieve the fraction of perm gen space used after which the background compiler will be disabled.
- |
-
static BackgroundCompiler |
-getInstance()
-Retrieves the current background compiler.
- |
-
boolean |
-isEnabled()
-Retrieve whether or not the background compiler is enabled.
- |
-
void |
-scheduleCompilation(java.util.Map<java.lang.Class,StructureModifier> cache,
- java.lang.Class key)
-Ensure that the indirectly given structure modifier is eventually compiled.
- |
-
<TKey> void |
-scheduleCompilation(StructureModifier<TKey> uncompiled,
- CompileListener<TKey> listener)
-Ensure that the given structure modifier is eventually compiled.
- |
-
void |
-setDisablePermGenFraction(double fraction)
-Set the fraction of perm gen space used after which the background compiler will be disabled.
- |
-
void |
-setEnabled(boolean enabled)
-Sets whether or not the background compiler is enabled.
- |
-
static void |
-setInstance(BackgroundCompiler backgroundCompiler)
-Sets the single background compiler we're using.
- |
-
void |
-shutdownAll()
-Clean up after ourselves using the default timeout.
- |
-
void |
-shutdownAll(long timeout,
- java.util.concurrent.TimeUnit unit)
-Clean up after ourselves.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final ReportType REPORT_CANNOT_COMPILE_STRUCTURE_MODIFIER-
public static final ReportType REPORT_CANNOT_SCHEDULE_COMPILATION-
public static final java.lang.String THREAD_FORMAT-
public static final int SHUTDOWN_DELAY_MS-
public static final double DEFAULT_DISABLE_AT_PERM_GEN-
public BackgroundCompiler(java.lang.ClassLoader loader, - ErrorReporter reporter)-
- Uses the default THREAD_FORMAT
to name worker threads.
loader
- - class loader from Bukkit.reporter
- - current error reporter.public BackgroundCompiler(java.lang.ClassLoader loader, - ErrorReporter reporter, - java.util.concurrent.ExecutorService executor)-
loader
- - class loader from Bukkit.reporter
- - current error reporter.executor
- - thread pool we'll use.public static BackgroundCompiler getInstance()-
public static void setInstance(BackgroundCompiler backgroundCompiler)-
backgroundCompiler
- - current background compiler, or NULL if the library is not loaded.public void scheduleCompilation(java.util.Map<java.lang.Class,StructureModifier> cache, - java.lang.Class key)-
cache
- - store of structure modifiers.key
- - key of the structure modifier to compile.public <TKey> void scheduleCompilation(StructureModifier<TKey> uncompiled, - CompileListener<TKey> listener)-
uncompiled
- - structure modifier to compile.listener
- - listener responsible for responding to the compilation.public <TKey> void addListener(StructureModifier<TKey> uncompiled, - CompileListener<TKey> listener)-
uncompiled
- - the structure modifier that may get compiled.listener
- - the listener to invoke in that case.public void shutdownAll()-
public void shutdownAll(long timeout, - java.util.concurrent.TimeUnit unit)-
timeout
- - the maximum time to wait.unit
- - the time unit of the timeout argument.public boolean isEnabled()-
public void setEnabled(boolean enabled)-
enabled
- - TRUE to enable it, FALSE otherwise.public double getDisablePermGenFraction()-
public void setDisablePermGenFraction(double fraction)-
fraction
- - the maximum use of perm gen space.public StructureCompiler getCompiler()-
TKey
- - type of the structure modifier field.public interface CompileListener<TKey>
-Modifier and Type | -Method and Description | -
---|---|
void |
-onCompiled(StructureModifier<TKey> compiledModifier)
-Invoked when a structure modifier has been successfully compiled.
- |
-
void onCompiled(StructureModifier<TKey> compiledModifier)-
compiledModifier
- - the compiled structure modifier.public abstract class CompiledStructureModifier -extends StructureModifier<java.lang.Object>-
Modifier and Type | -Field and Description | -
---|---|
protected StructureCompiler |
-compiler |
-
converter, customConvertHandling, data, defaultFields, fieldType, subtypeCache, target, targetType, useStructureCompiler
Constructor and Description | -
---|
CompiledStructureModifier() |
-
Modifier and Type | -Method and Description | -
---|---|
java.lang.Object |
-read(int fieldIndex)
-Reads the value of a field given its index.
- |
-
protected abstract java.lang.Object |
-readGenerated(int fieldIndex) |
-
protected java.lang.Object |
-readReflected(int index)
-Read the given field index using reflection.
- |
-
void |
-setReadOnly(int fieldIndex,
- boolean value)
-Set whether or not a field should be treated as read only.
- |
-
StructureModifier<java.lang.Object> |
-withTarget(java.lang.Object target)
-Retrieves a structure modifier of the same type for a different object target.
- |
-
StructureModifier<java.lang.Object> |
-write(int index,
- java.lang.Object value)
-Writes the value of a field given its index.
- |
-
StructureModifier<java.lang.Object> |
-writeDefaults()
-Sets all non-primitive fields to a more fitting default value.
- |
-
protected abstract StructureModifier<java.lang.Object> |
-writeGenerated(int index,
- java.lang.Object value) |
-
protected void |
-writeReflected(int index,
- java.lang.Object value)
-Write the given field using reflection.
- |
-
getField, getFields, getFieldType, getFieldType, getTarget, getTargetType, getValues, initialize, initialize, initialize, isPublic, isReadOnly, modify, readSafely, setConverter, setFinalState, size, withFieldType, withType, withType, writeSafely
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected StructureCompiler compiler-
public CompiledStructureModifier()-
public void setReadOnly(int fieldIndex, - boolean value) - throws FieldAccessException-
StructureModifier
- Note that changing the read-only state to TRUE will only work if the current - field was recently read-only or the current structure modifier hasn't been compiled yet.
setReadOnly
in class StructureModifier<java.lang.Object>
fieldIndex
- - index of the field.value
- - TRUE if this field should be read only, FALSE otherwise.FieldAccessException
- If we cannot modify the read-only status.public StructureModifier<java.lang.Object> writeDefaults() - throws FieldAccessException-
StructureModifier
DefaultInstances.getDefault(Class)
.writeDefaults
in class StructureModifier<java.lang.Object>
FieldAccessException
- If we're unable to write to the fields due to a security limitation.public final java.lang.Object read(int fieldIndex) - throws FieldAccessException-
StructureModifier
read
in class StructureModifier<java.lang.Object>
fieldIndex
- - index of the field.FieldAccessException
- The field doesn't exist, or it cannot be accessed under the current security contraints.protected java.lang.Object readReflected(int index) - throws FieldAccessException-
index
- - index of field.FieldAccessException
- The field doesn't exist, or it cannot be accessed under the current security contraints.protected abstract java.lang.Object readGenerated(int fieldIndex) - throws FieldAccessException-
FieldAccessException
public StructureModifier<java.lang.Object> write(int index, - java.lang.Object value) - throws FieldAccessException-
StructureModifier
write
in class StructureModifier<java.lang.Object>
index
- - 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.protected void writeReflected(int index, - java.lang.Object value) - throws FieldAccessException-
index
- - index of field.value
- - new value.FieldAccessException
- The field doesn't exist, or it cannot be accessed under the current security contraints.protected abstract StructureModifier<java.lang.Object> writeGenerated(int index, - java.lang.Object value) - throws FieldAccessException-
FieldAccessException
public StructureModifier<java.lang.Object> withTarget(java.lang.Object target)-
StructureModifier
withTarget
in class StructureModifier<java.lang.Object>
target
- - different target of the same type.public final class StructureCompiler
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
static ReportType |
-REPORT_TOO_MANY_GENERATED_CLASSES |
-
Modifier and Type | -Method and Description | -
---|---|
<TField> StructureModifier<TField> |
-compile(StructureModifier<TField> source)
-Compiles the given structure modifier.
- |
-
<TField> boolean |
-lookupClassLoader(StructureModifier<TField> source)
-Lookup the current class loader for any previously generated classes before we attempt to generate something.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final ReportType REPORT_TOO_MANY_GENERATED_CLASSES-
public <TField> boolean lookupClassLoader(StructureModifier<TField> source)-
source
- - the structure modifier to look up.public <TField> StructureModifier<TField> compile(StructureModifier<TField> source)-
- WARNING: Do NOT call this method in the main thread. Compiling may easily take 10 ms, which is already - over 1/4 of a tick (50 ms). Let the background thread automatically compile the structure modifiers instead.
source
- - structure modifier to compile.Package | -Description | -
---|---|
com.comphenix.protocol.reflect.compiler | -- |
Modifier and Type | -Method and Description | -
---|---|
static BackgroundCompiler |
-BackgroundCompiler.getInstance()
-Retrieves the current background compiler.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static void |
-BackgroundCompiler.setInstance(BackgroundCompiler backgroundCompiler)
-Sets the single background compiler we're using.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.compiler | -- |
Modifier and Type | -Method and Description | -
---|---|
<TKey> void |
-BackgroundCompiler.addListener(StructureModifier<TKey> uncompiled,
- CompileListener<TKey> listener)
-Add a compile listener if we are still waiting for the structure modifier to be compiled.
- |
-
<TKey> void |
-BackgroundCompiler.scheduleCompilation(StructureModifier<TKey> uncompiled,
- CompileListener<TKey> listener)
-Ensure that the given structure modifier is eventually compiled.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.compiler | -- |
Modifier and Type | -Field and Description | -
---|---|
protected StructureCompiler |
-CompiledStructureModifier.compiler |
-
Modifier and Type | -Method and Description | -
---|---|
StructureCompiler |
-BackgroundCompiler.getCompiler()
-Retrieve the current structure compiler.
- |
-
Interface | -Description | -
---|---|
CompileListener<TKey> | -
- Used to save the result of an compilation.
- |
-
Class | -Description | -
---|---|
BackgroundCompiler | -
- Compiles structure modifiers on a background thread.
- |
-
CompiledStructureModifier | -
- Represents a compiled structure modifier.
- |
-
StructureCompiler | -
- Represents a StructureModifier compiler.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.compiler | -- |
Class and Description | -
---|
BackgroundCompiler
- Compiles structure modifiers on a background thread.
- |
-
CompileListener
- Used to save the result of an compilation.
- |
-
StructureCompiler
- Represents a StructureModifier compiler.
- |
-
public abstract class AbstractFuzzyMatcher<T> -extends java.lang.Object -implements java.lang.Comparable<AbstractFuzzyMatcher<T>>-
- This class should ideally never expose mutable state. Its round number must be immutable.
Constructor and Description | -
---|
AbstractFuzzyMatcher() |
-
Modifier and Type | -Method and Description | -
---|---|
AbstractFuzzyMatcher<T> |
-and(AbstractFuzzyMatcher<T> other)
-Require that this and the given matcher be TRUE.
- |
-
protected abstract int |
-calculateRoundNumber()
-Calculate the round number indicating when this matcher should be applied.
- |
-
protected int |
-combineRounds(java.lang.Integer... rounds)
-Combine n round numbers by taking the highest non-zero number, or return zero.
- |
-
protected int |
-combineRounds(int roundA,
- int roundB)
-Combine two round numbers by taking the highest non-zero number, or return zero.
- |
-
int |
-compareTo(AbstractFuzzyMatcher<T> obj) |
-
int |
-getRoundNumber()
-Retrieve the cached round number.
- |
-
AbstractFuzzyMatcher<T> |
-inverted()
-Create a fuzzy matcher that returns the opposite result of the current matcher.
- |
-
abstract boolean |
-isMatch(T value,
- java.lang.Object parent)
-Determine if the given value is a match.
- |
-
AbstractFuzzyMatcher<T> |
-or(AbstractFuzzyMatcher<T> other)
-Require that either this or the other given matcher be TRUE.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public abstract boolean isMatch(T value, - java.lang.Object parent)-
value
- - the value to match.parent
- - the parent container, or NULL if this value is the root.protected abstract int calculateRoundNumber()-
- Matchers with a lower round number are applied before matchers with a higher round number. -
- By convention, this round number should be negative, except for zero in the case of a matcher
- that accepts any value. A good implementation should return the inverted tree depth (class hierachy)
- of the least specified type used in the matching. Thus Integer
will have a lower round number than
- Number
.
public final int getRoundNumber()-
- Matchers with a lower round number are applied before matchers with a higher round number.
#calculateRoundNumber()}
protected final int combineRounds(int roundA, - int roundB)-
roundA
- - the first round number.roundB
- - the second round number.protected final int combineRounds(java.lang.Integer... rounds)-
rounds
- - the round numbers.public int compareTo(AbstractFuzzyMatcher<T> obj)-
compareTo
in interface java.lang.Comparable<AbstractFuzzyMatcher<T>>
public AbstractFuzzyMatcher<T> inverted()-
public AbstractFuzzyMatcher<T> and(AbstractFuzzyMatcher<T> other)-
other
- - the other fuzzy matcher.public AbstractFuzzyMatcher<T> or(AbstractFuzzyMatcher<T> other)-
other
- - the other fuzzy matcher.public abstract static class AbstractFuzzyMember.Builder<T extends AbstractFuzzyMember<?>>
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
protected T |
-member |
-
Constructor and Description | -
---|
AbstractFuzzyMember.Builder() |
-
Modifier and Type | -Method and Description | -
---|---|
AbstractFuzzyMember.Builder<T> |
-banModifier(int modifier)
-Add a given bit-field of modifers that will skip or ignore members.
- |
-
abstract T |
-build()
-Build a new instance of this type.
- |
-
AbstractFuzzyMember.Builder<T> |
-declaringClassDerivedOf(java.lang.Class<?> declaringClass)
-Require that a member is defined by this exact class, or any super class.
- |
-
AbstractFuzzyMember.Builder<T> |
-declaringClassExactType(java.lang.Class<?> declaringClass)
-Require that a member is defined by this exact class.
- |
-
AbstractFuzzyMember.Builder<T> |
-declaringClassMatching(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
-Require that a member is defined by a class that matches the given matcher.
- |
-
AbstractFuzzyMember.Builder<T> |
-declaringClassSuperOf(java.lang.Class<?> declaringClass)
-Require that a member is defined by this exact class, or any super class.
- |
-
protected abstract T |
-initialMember()
-Construct a new instance of the current type.
- |
-
AbstractFuzzyMember.Builder<T> |
-nameExact(java.lang.String name)
-Set the exact name of the member we are matching.
- |
-
AbstractFuzzyMember.Builder<T> |
-nameRegex(java.util.regex.Pattern pattern)
-Set the regular expression pattern that matches a members name.
- |
-
AbstractFuzzyMember.Builder<T> |
-nameRegex(java.lang.String regex)
-Set the regular expresson that matches a members name.
- |
-
AbstractFuzzyMember.Builder<T> |
-requireModifier(int modifier)
-Add a given bit-field of required modifiers for every matching member.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected T extends AbstractFuzzyMember<?> member-
public AbstractFuzzyMember.Builder()-
public AbstractFuzzyMember.Builder<T> requireModifier(int modifier)-
modifier
- - bit-field of modifiers that are required.public AbstractFuzzyMember.Builder<T> banModifier(int modifier)-
modifier
- - bit-field of modifiers to skip or ignore.public AbstractFuzzyMember.Builder<T> nameRegex(java.lang.String regex)-
regex
- - new regular expression of valid names.public AbstractFuzzyMember.Builder<T> nameRegex(java.util.regex.Pattern pattern)-
pattern
- - regular expression pattern for a valid name.public AbstractFuzzyMember.Builder<T> nameExact(java.lang.String name)-
-
name
- - exact name.public AbstractFuzzyMember.Builder<T> declaringClassExactType(java.lang.Class<?> declaringClass)-
declaringClass
- - the declaring class of any matching member.public AbstractFuzzyMember.Builder<T> declaringClassSuperOf(java.lang.Class<?> declaringClass)-
declaringClass
- - the declaring class.public AbstractFuzzyMember.Builder<T> declaringClassDerivedOf(java.lang.Class<?> declaringClass)-
declaringClass
- - the declaring class.public AbstractFuzzyMember.Builder<T> declaringClassMatching(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)-
classMatcher
- - class matcher.@Nonnull -protected abstract T initialMember()-
public abstract T build()-
- Builders should call AbstractFuzzyMember.prepareBuild()
when constructing new objects.
T
- - type that it matches.public abstract class AbstractFuzzyMember<T extends java.lang.reflect.Member> -extends AbstractFuzzyMatcher<T>-
Modifier and Type | -Class and Description | -
---|---|
static class |
-AbstractFuzzyMember.Builder<T extends AbstractFuzzyMember<?>>
-Represents a builder of a fuzzy member contract.
- |
-
Modifier and Type | -Field and Description | -
---|---|
protected AbstractFuzzyMatcher<java.lang.Class<?>> |
-declaringMatcher |
-
protected int |
-modifiersBanned |
-
protected int |
-modifiersRequired |
-
protected java.util.regex.Pattern |
-nameRegex |
-
protected boolean |
-sealed
-Whether or not this contract can be modified.
- |
-
Modifier | -Constructor and Description | -
---|---|
protected |
-AbstractFuzzyMember() |
-
protected |
-AbstractFuzzyMember(AbstractFuzzyMember<T> other) |
-
Modifier and Type | -Method and Description | -
---|---|
protected int |
-calculateRoundNumber()
-Calculate the round number indicating when this matcher should be applied.
- |
-
boolean |
-equals(java.lang.Object obj) |
-
AbstractFuzzyMatcher<java.lang.Class<?>> |
-getDeclaringMatcher()
-Retrieve a class matcher for the declaring class of the member.
- |
-
protected java.util.Map<java.lang.String,java.lang.Object> |
-getKeyValueView()
-Generate a view of this matcher as a key-value map.
- |
-
int |
-getModifiersBanned()
-Retrieve a bit field of every
-Modifier that must not be present for the member to match. |
-
int |
-getModifiersRequired()
-Retrieve a bit field of every
-Modifier that is required for the member to match. |
-
java.util.regex.Pattern |
-getNameRegex()
-Retrieve the regular expression pattern that is used to match the name of a member.
- |
-
int |
-hashCode() |
-
boolean |
-isMatch(T value,
- java.lang.Object parent)
-Determine if the given value is a match.
- |
-
protected void |
-prepareBuild()
-Called before a builder is building a member and copying its state.
- |
-
java.lang.String |
-toString() |
-
and, combineRounds, combineRounds, compareTo, getRoundNumber, inverted, or
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
protected int modifiersRequired-
protected int modifiersBanned-
protected java.util.regex.Pattern nameRegex-
protected AbstractFuzzyMatcher<java.lang.Class<?>> declaringMatcher-
protected transient boolean sealed-
protected AbstractFuzzyMember()-
protected AbstractFuzzyMember(AbstractFuzzyMember<T> other)-
protected void prepareBuild()-
- Use this to prepare any special values.
public int getModifiersRequired()-
Modifier
that is required for the member to match.public int getModifiersBanned()-
Modifier
that must not be present for the member to match.public java.util.regex.Pattern getNameRegex()-
public AbstractFuzzyMatcher<java.lang.Class<?>> getDeclaringMatcher()-
public boolean isMatch(T value, - java.lang.Object parent)-
AbstractFuzzyMatcher
isMatch
in class AbstractFuzzyMatcher<T extends java.lang.reflect.Member>
value
- - the value to match.parent
- - the parent container, or NULL if this value is the root.protected int calculateRoundNumber()-
AbstractFuzzyMatcher
- Matchers with a lower round number are applied before matchers with a higher round number. -
- By convention, this round number should be negative, except for zero in the case of a matcher
- that accepts any value. A good implementation should return the inverted tree depth (class hierachy)
- of the least specified type used in the matching. Thus Integer
will have a lower round number than
- Number
.
calculateRoundNumber
in class AbstractFuzzyMatcher<T extends java.lang.reflect.Member>
public java.lang.String toString()-
toString
in class java.lang.Object
protected java.util.Map<java.lang.String,java.lang.Object> getKeyValueView()-
- Used by toString()
to print a representation of this object.
public boolean equals(java.lang.Object obj)-
equals
in class java.lang.Object
public int hashCode()-
hashCode
in class java.lang.Object
public static class FuzzyClassContract.Builder
-extends java.lang.Object
-Constructor and Description | -
---|
FuzzyClassContract.Builder() |
-
Modifier and Type | -Method and Description | -
---|---|
FuzzyClassContract.Builder |
-baseclass(AbstractFuzzyMatcher<java.lang.Class<?>> matcher)
-Add a new base class contract.
- |
-
FuzzyClassContract.Builder |
-baseclass(FuzzyClassContract.Builder builder)
-Add a new base class contract.
- |
-
FuzzyClassContract |
-build() |
-
FuzzyClassContract.Builder |
-constructor(AbstractFuzzyMatcher<MethodInfo> matcher)
-Add a new constructor contract.
- |
-
FuzzyClassContract.Builder |
-constructor(FuzzyMethodContract.Builder builder)
-Add a new constructor contract via a builder.
- |
-
FuzzyClassContract.Builder |
-field(AbstractFuzzyMatcher<java.lang.reflect.Field> matcher)
-Add a new field contract.
- |
-
FuzzyClassContract.Builder |
-field(FuzzyFieldContract.Builder builder)
-Add a new field contract via a builder.
- |
-
FuzzyClassContract.Builder |
-interfaces(AbstractFuzzyMatcher<java.lang.Class<?>> matcher)
-Add a new interface contract.
- |
-
FuzzyClassContract.Builder |
-interfaces(FuzzyClassContract.Builder builder)
-Add a new interface contract.
- |
-
FuzzyClassContract.Builder |
-method(AbstractFuzzyMatcher<MethodInfo> matcher)
-Add a new method contract.
- |
-
FuzzyClassContract.Builder |
-method(FuzzyMethodContract.Builder builder)
-Add a new method contract via a builder.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public FuzzyClassContract.Builder()-
public FuzzyClassContract.Builder field(AbstractFuzzyMatcher<java.lang.reflect.Field> matcher)-
matcher
- - new field contract.public FuzzyClassContract.Builder field(FuzzyFieldContract.Builder builder)-
builder
- - builder for the new field contract.public FuzzyClassContract.Builder method(AbstractFuzzyMatcher<MethodInfo> matcher)-
matcher
- - new method contract.public FuzzyClassContract.Builder method(FuzzyMethodContract.Builder builder)-
builder
- - builder for the new method contract.public FuzzyClassContract.Builder constructor(AbstractFuzzyMatcher<MethodInfo> matcher)-
matcher
- - new constructor contract.public FuzzyClassContract.Builder constructor(FuzzyMethodContract.Builder builder)-
builder
- - builder for the new constructor contract.public FuzzyClassContract.Builder baseclass(AbstractFuzzyMatcher<java.lang.Class<?>> matcher)-
matcher
- - new base class contract.public FuzzyClassContract.Builder baseclass(FuzzyClassContract.Builder builder)-
matcher
- - builder for the new base class contract.public FuzzyClassContract.Builder interfaces(AbstractFuzzyMatcher<java.lang.Class<?>> matcher)-
matcher
- - new interface contract.public FuzzyClassContract.Builder interfaces(FuzzyClassContract.Builder builder)-
matcher
- - builder for the new interface contract.public FuzzyClassContract build()-
public class FuzzyClassContract -extends AbstractFuzzyMatcher<java.lang.Class<?>>-
Modifier and Type | -Class and Description | -
---|---|
static class |
-FuzzyClassContract.Builder
-Represents a class contract builder.
- |
-
Modifier and Type | -Method and Description | -
---|---|
protected int |
-calculateRoundNumber()
-Calculate the round number indicating when this matcher should be applied.
- |
-
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.Class<?>>> |
-getBaseclassContracts()
-Retrieve an immutable list of every baseclass contract.
- |
-
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>> |
-getConstructorContracts()
-Retrieve an immutable list of every constructor contract.
- |
-
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.reflect.Field>> |
-getFieldContracts()
-Retrieve an immutable list of every field contract.
- |
-
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.Class<?>>> |
-getInterfaceContracts()
-Retrieve an immutable list of every interface contract.
- |
-
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>> |
-getMethodContracts()
-Retrieve an immutable list of every method contract.
- |
-
boolean |
-isMatch(java.lang.Class<?> value,
- java.lang.Object parent)
-Determine if the given value is a match.
- |
-
static FuzzyClassContract.Builder |
-newBuilder()
-Construct a new fuzzy class contract builder.
- |
-
java.lang.String |
-toString() |
-
and, combineRounds, combineRounds, compareTo, getRoundNumber, inverted, or
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public static FuzzyClassContract.Builder newBuilder()-
public com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.reflect.Field>> getFieldContracts()-
- This list is ordered in descending order of priority.
public com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>> getMethodContracts()-
- This list is ordered in descending order of priority.
public com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>> getConstructorContracts()-
- This list is ordered in descending order of priority.
public com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.Class<?>>> getBaseclassContracts()-
- This list is ordered in descending order of priority.
public com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.Class<?>>> getInterfaceContracts()-
- This list is ordered in descending order of priority.
protected int calculateRoundNumber()-
AbstractFuzzyMatcher
- Matchers with a lower round number are applied before matchers with a higher round number. -
- By convention, this round number should be negative, except for zero in the case of a matcher
- that accepts any value. A good implementation should return the inverted tree depth (class hierachy)
- of the least specified type used in the matching. Thus Integer
will have a lower round number than
- Number
.
calculateRoundNumber
in class AbstractFuzzyMatcher<java.lang.Class<?>>
public boolean isMatch(java.lang.Class<?> value, - java.lang.Object parent)-
AbstractFuzzyMatcher
isMatch
in class AbstractFuzzyMatcher<java.lang.Class<?>>
value
- - the value to match.parent
- - the parent container, or NULL if this value is the root.public java.lang.String toString()-
toString
in class java.lang.Object
public static class FuzzyFieldContract.Builder -extends AbstractFuzzyMember.Builder<FuzzyFieldContract>-
member
Constructor and Description | -
---|
FuzzyFieldContract.Builder() |
-
Modifier and Type | -Method and Description | -
---|---|
FuzzyFieldContract.Builder |
-banModifier(int modifier)
-Add a given bit-field of modifers that will skip or ignore members.
- |
-
FuzzyFieldContract |
-build()
-Build a new instance of this type.
- |
-
FuzzyFieldContract.Builder |
-declaringClassDerivedOf(java.lang.Class<?> declaringClass)
-Require that a member is defined by this exact class, or any super class.
- |
-
FuzzyFieldContract.Builder |
-declaringClassExactType(java.lang.Class<?> declaringClass)
-Require that a member is defined by this exact class.
- |
-
FuzzyFieldContract.Builder |
-declaringClassMatching(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
-Require that a member is defined by a class that matches the given matcher.
- |
-
FuzzyFieldContract.Builder |
-declaringClassSuperOf(java.lang.Class<?> declaringClass)
-Require that a member is defined by this exact class, or any super class.
- |
-
protected FuzzyFieldContract |
-initialMember()
-Construct a new instance of the current type.
- |
-
FuzzyFieldContract.Builder |
-nameExact(java.lang.String name)
-Set the exact name of the member we are matching.
- |
-
FuzzyFieldContract.Builder |
-nameRegex(java.util.regex.Pattern pattern)
-Set the regular expression pattern that matches a members name.
- |
-
FuzzyFieldContract.Builder |
-nameRegex(java.lang.String regex)
-Set the regular expresson that matches a members name.
- |
-
FuzzyFieldContract.Builder |
-requireModifier(int modifier)
-Add a given bit-field of required modifiers for every matching member.
- |
-
FuzzyFieldContract.Builder |
-typeDerivedOf(java.lang.Class<?> type) |
-
FuzzyFieldContract.Builder |
-typeExact(java.lang.Class<?> type) |
-
FuzzyFieldContract.Builder |
-typeMatches(AbstractFuzzyMatcher<java.lang.Class<?>> matcher) |
-
FuzzyFieldContract.Builder |
-typeSuperOf(java.lang.Class<?> type) |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public FuzzyFieldContract.Builder()-
public FuzzyFieldContract.Builder requireModifier(int modifier)-
AbstractFuzzyMember.Builder
requireModifier
in class AbstractFuzzyMember.Builder<FuzzyFieldContract>
modifier
- - bit-field of modifiers that are required.public FuzzyFieldContract.Builder banModifier(int modifier)-
AbstractFuzzyMember.Builder
banModifier
in class AbstractFuzzyMember.Builder<FuzzyFieldContract>
modifier
- - bit-field of modifiers to skip or ignore.public FuzzyFieldContract.Builder nameRegex(java.lang.String regex)-
AbstractFuzzyMember.Builder
nameRegex
in class AbstractFuzzyMember.Builder<FuzzyFieldContract>
regex
- - new regular expression of valid names.public FuzzyFieldContract.Builder nameRegex(java.util.regex.Pattern pattern)-
AbstractFuzzyMember.Builder
nameRegex
in class AbstractFuzzyMember.Builder<FuzzyFieldContract>
pattern
- - regular expression pattern for a valid name.public FuzzyFieldContract.Builder nameExact(java.lang.String name)-
AbstractFuzzyMember.Builder
-
nameExact
in class AbstractFuzzyMember.Builder<FuzzyFieldContract>
name
- - exact name.public FuzzyFieldContract.Builder declaringClassExactType(java.lang.Class<?> declaringClass)-
AbstractFuzzyMember.Builder
declaringClassExactType
in class AbstractFuzzyMember.Builder<FuzzyFieldContract>
declaringClass
- - the declaring class of any matching member.public FuzzyFieldContract.Builder declaringClassSuperOf(java.lang.Class<?> declaringClass)-
AbstractFuzzyMember.Builder
declaringClassSuperOf
in class AbstractFuzzyMember.Builder<FuzzyFieldContract>
declaringClass
- - the declaring class.public FuzzyFieldContract.Builder declaringClassDerivedOf(java.lang.Class<?> declaringClass)-
AbstractFuzzyMember.Builder
declaringClassDerivedOf
in class AbstractFuzzyMember.Builder<FuzzyFieldContract>
declaringClass
- - the declaring class.public FuzzyFieldContract.Builder declaringClassMatching(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)-
AbstractFuzzyMember.Builder
declaringClassMatching
in class AbstractFuzzyMember.Builder<FuzzyFieldContract>
classMatcher
- - class matcher.@Nonnull -protected FuzzyFieldContract initialMember()-
AbstractFuzzyMember.Builder
initialMember
in class AbstractFuzzyMember.Builder<FuzzyFieldContract>
public FuzzyFieldContract.Builder typeExact(java.lang.Class<?> type)-
public FuzzyFieldContract.Builder typeSuperOf(java.lang.Class<?> type)-
public FuzzyFieldContract.Builder typeDerivedOf(java.lang.Class<?> type)-
public FuzzyFieldContract.Builder typeMatches(AbstractFuzzyMatcher<java.lang.Class<?>> matcher)-
public FuzzyFieldContract build()-
AbstractFuzzyMember.Builder
- Builders should call AbstractFuzzyMember.prepareBuild()
when constructing new objects.
build
in class AbstractFuzzyMember.Builder<FuzzyFieldContract>
public class FuzzyFieldContract -extends AbstractFuzzyMember<java.lang.reflect.Field>-
Modifier and Type | -Class and Description | -
---|---|
static class |
-FuzzyFieldContract.Builder
-Represents a builder for a field matcher.
- |
-
declaringMatcher, modifiersBanned, modifiersRequired, nameRegex, sealed
Modifier and Type | -Method and Description | -
---|---|
protected int |
-calculateRoundNumber()
-Calculate the round number indicating when this matcher should be applied.
- |
-
boolean |
-equals(java.lang.Object obj) |
-
protected java.util.Map<java.lang.String,java.lang.Object> |
-getKeyValueView()
-Generate a view of this matcher as a key-value map.
- |
-
AbstractFuzzyMatcher<java.lang.Class<?>> |
-getTypeMatcher()
-Retrieve the class matcher that matches the type of a field.
- |
-
int |
-hashCode() |
-
boolean |
-isMatch(java.lang.reflect.Field value,
- java.lang.Object parent)
-Determine if the given value is a match.
- |
-
static FuzzyFieldContract.Builder |
-newBuilder()
-Return a new fuzzy field contract builder.
- |
-
getDeclaringMatcher, getModifiersBanned, getModifiersRequired, getNameRegex, prepareBuild, toString
and, combineRounds, combineRounds, compareTo, getRoundNumber, inverted, or
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public static FuzzyFieldContract.Builder newBuilder()-
public AbstractFuzzyMatcher<java.lang.Class<?>> getTypeMatcher()-
public boolean isMatch(java.lang.reflect.Field value, - java.lang.Object parent)-
AbstractFuzzyMatcher
isMatch
in class AbstractFuzzyMember<java.lang.reflect.Field>
value
- - the value to match.parent
- - the parent container, or NULL if this value is the root.protected int calculateRoundNumber()-
AbstractFuzzyMatcher
- Matchers with a lower round number are applied before matchers with a higher round number. -
- By convention, this round number should be negative, except for zero in the case of a matcher
- that accepts any value. A good implementation should return the inverted tree depth (class hierachy)
- of the least specified type used in the matching. Thus Integer
will have a lower round number than
- Number
.
calculateRoundNumber
in class AbstractFuzzyMember<java.lang.reflect.Field>
protected java.util.Map<java.lang.String,java.lang.Object> getKeyValueView()-
AbstractFuzzyMember
- Used by AbstractFuzzyMember.toString()
to print a representation of this object.
getKeyValueView
in class AbstractFuzzyMember<java.lang.reflect.Field>
public int hashCode()-
hashCode
in class AbstractFuzzyMember<java.lang.reflect.Field>
public boolean equals(java.lang.Object obj)-
equals
in class AbstractFuzzyMember<java.lang.reflect.Field>
public class FuzzyMatchers
-extends java.lang.Object
-Modifier and Type | -Method and Description | -
---|---|
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-matchAnyOf(java.lang.Class<?>... classes)
-Construct a class matcher that matches any of the given classes exactly.
- |
-
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-matchAnyOf(java.util.Set<java.lang.Class<?>> classes)
-Construct a class matcher that matches any of the given classes exactly.
- |
-
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-matchDerived(java.lang.Class<?> matcher)
-Construct a class matcher that matches derived types of the given class.
- |
-
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-matchExact(java.lang.Class<?> matcher)
-Construct a class matcher that matches types exactly.
- |
-
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-matchParent()
-Match the parent class of a method, field or constructor.
- |
-
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-matchRegex(java.util.regex.Pattern regex,
- int priority)
-Construct a class matcher based on the canonical names of classes.
- |
-
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-matchRegex(java.lang.String regex,
- int priority)
-Construct a class matcher based on the canonical names of classes.
- |
-
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-matchSuper(java.lang.Class<?> matcher)
-Construct a class matcher that matches super types of the given class.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static AbstractFuzzyMatcher<java.lang.Class<?>> matchExact(java.lang.Class<?> matcher)-
matcher
- - the matching class.public static AbstractFuzzyMatcher<java.lang.Class<?>> matchAnyOf(java.lang.Class<?>... classes)-
classes
- - list of classes to match.public static AbstractFuzzyMatcher<java.lang.Class<?>> matchAnyOf(java.util.Set<java.lang.Class<?>> classes)-
classes
- - set of classes to match.public static AbstractFuzzyMatcher<java.lang.Class<?>> matchSuper(java.lang.Class<?> matcher)-
matcher
- - the matching type must be a super class of this type.public static AbstractFuzzyMatcher<java.lang.Class<?>> matchDerived(java.lang.Class<?> matcher)-
matcher
- - the matching type must be a derived class of this type.public static AbstractFuzzyMatcher<java.lang.Class<?>> matchRegex(java.util.regex.Pattern regex, - int priority)-
regex
- - regular expression pattern matching class names.priority
- - the priority this matcher takes - higher is better.public static AbstractFuzzyMatcher<java.lang.Class<?>> matchRegex(java.lang.String regex, - int priority)-
regex
- - regular expression matching class names.priority
- - the priority this matcher takes - higher is better.public static AbstractFuzzyMatcher<java.lang.Class<?>> matchParent()-
public static class FuzzyMethodContract.Builder -extends AbstractFuzzyMember.Builder<FuzzyMethodContract>-
member
Constructor and Description | -
---|
FuzzyMethodContract.Builder() |
-
Modifier and Type | -Method and Description | -
---|---|
FuzzyMethodContract.Builder |
-banModifier(int modifier)
-Add a given bit-field of modifers that will skip or ignore members.
- |
-
FuzzyMethodContract |
-build()
-Build a new instance of this type.
- |
-
FuzzyMethodContract.Builder |
-declaringClassDerivedOf(java.lang.Class<?> declaringClass)
-Require that a member is defined by this exact class, or any super class.
- |
-
FuzzyMethodContract.Builder |
-declaringClassExactType(java.lang.Class<?> declaringClass)
-Require that a member is defined by this exact class.
- |
-
FuzzyMethodContract.Builder |
-declaringClassMatching(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
-Require that a member is defined by a class that matches the given matcher.
- |
-
FuzzyMethodContract.Builder |
-declaringClassSuperOf(java.lang.Class<?> declaringClass)
-Require that a member is defined by this exact class, or any super class.
- |
-
FuzzyMethodContract.Builder |
-exceptionExactType(java.lang.Class<?> type)
-Add a throwable exception that must match the given type exactly.
- |
-
FuzzyMethodContract.Builder |
-exceptionExactType(java.lang.Class<?> type,
- int index)
-Add a throwable exception that must match the given type exactly and index.
- |
-
FuzzyMethodContract.Builder |
-exceptionMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
-Add a throwable exception that must match the given matcher,
- |
-
FuzzyMethodContract.Builder |
-exceptionMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher,
- int index)
-Add a throwable exception that must match the given matcher and index.
- |
-
FuzzyMethodContract.Builder |
-exceptionSuperOf(java.lang.Class<?> type)
-Add a throwable exception that must match the given type or be derived.
- |
-
FuzzyMethodContract.Builder |
-exceptionSuperOf(java.lang.Class<?> type,
- int index)
-Add a throwable exception that must match the given type or be derived and index.
- |
-
protected FuzzyMethodContract |
-initialMember()
-Construct a new instance of the current type.
- |
-
FuzzyMethodContract.Builder |
-nameExact(java.lang.String name)
-Set the exact name of the member we are matching.
- |
-
FuzzyMethodContract.Builder |
-nameRegex(java.util.regex.Pattern pattern)
-Set the regular expression pattern that matches a members name.
- |
-
FuzzyMethodContract.Builder |
-nameRegex(java.lang.String regex)
-Set the regular expresson that matches a members name.
- |
-
FuzzyMethodContract.Builder |
-parameterCount(int expectedCount)
-Set the expected number of parameters in the matching method.
- |
-
FuzzyMethodContract.Builder |
-parameterExactType(java.lang.Class<?> type)
-Add a new required parameter by type for any matching method.
- |
-
FuzzyMethodContract.Builder |
-parameterExactType(java.lang.Class<?> type,
- int index)
-Add a new required parameter by type and position for any matching method.
- |
-
FuzzyMethodContract.Builder |
-parameterMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
-Add a new required parameter whose type must match the given class matcher.
- |
-
FuzzyMethodContract.Builder |
-parameterMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher,
- int index)
-Add a new required parameter whose type must match the given class matcher and index.
- |
-
FuzzyMethodContract.Builder |
-parameterSuperOf(java.lang.Class<?> type)
-Add a new required parameter whose type must be a superclass of the given type.
- |
-
FuzzyMethodContract.Builder |
-parameterSuperOf(java.lang.Class<?> type,
- int index)
-Add a new required parameter whose type must be a superclass of the given type.
- |
-
FuzzyMethodContract.Builder |
-requireModifier(int modifier)
-Add a given bit-field of required modifiers for every matching member.
- |
-
FuzzyMethodContract.Builder |
-returnDerivedOf(java.lang.Class<?> type)
-Set the expected super class of the return type for every matching method.
- |
-
FuzzyMethodContract.Builder |
-returnTypeExact(java.lang.Class<?> type)
-Set the return type of a matching method exactly.
- |
-
FuzzyMethodContract.Builder |
-returnTypeMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
-Set a matcher that must match the return type of a matching method.
- |
-
FuzzyMethodContract.Builder |
-returnTypeVoid()
-Require a void method.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public FuzzyMethodContract.Builder()-
public FuzzyMethodContract.Builder requireModifier(int modifier)-
AbstractFuzzyMember.Builder
requireModifier
in class AbstractFuzzyMember.Builder<FuzzyMethodContract>
modifier
- - bit-field of modifiers that are required.public FuzzyMethodContract.Builder banModifier(int modifier)-
AbstractFuzzyMember.Builder
banModifier
in class AbstractFuzzyMember.Builder<FuzzyMethodContract>
modifier
- - bit-field of modifiers to skip or ignore.public FuzzyMethodContract.Builder nameRegex(java.lang.String regex)-
AbstractFuzzyMember.Builder
nameRegex
in class AbstractFuzzyMember.Builder<FuzzyMethodContract>
regex
- - new regular expression of valid names.public FuzzyMethodContract.Builder nameRegex(java.util.regex.Pattern pattern)-
AbstractFuzzyMember.Builder
nameRegex
in class AbstractFuzzyMember.Builder<FuzzyMethodContract>
pattern
- - regular expression pattern for a valid name.public FuzzyMethodContract.Builder nameExact(java.lang.String name)-
AbstractFuzzyMember.Builder
-
nameExact
in class AbstractFuzzyMember.Builder<FuzzyMethodContract>
name
- - exact name.public FuzzyMethodContract.Builder declaringClassExactType(java.lang.Class<?> declaringClass)-
AbstractFuzzyMember.Builder
declaringClassExactType
in class AbstractFuzzyMember.Builder<FuzzyMethodContract>
declaringClass
- - the declaring class of any matching member.public FuzzyMethodContract.Builder declaringClassSuperOf(java.lang.Class<?> declaringClass)-
AbstractFuzzyMember.Builder
declaringClassSuperOf
in class AbstractFuzzyMember.Builder<FuzzyMethodContract>
declaringClass
- - the declaring class.public FuzzyMethodContract.Builder declaringClassDerivedOf(java.lang.Class<?> declaringClass)-
AbstractFuzzyMember.Builder
declaringClassDerivedOf
in class AbstractFuzzyMember.Builder<FuzzyMethodContract>
declaringClass
- - the declaring class.public FuzzyMethodContract.Builder declaringClassMatching(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)-
AbstractFuzzyMember.Builder
declaringClassMatching
in class AbstractFuzzyMember.Builder<FuzzyMethodContract>
classMatcher
- - class matcher.public FuzzyMethodContract.Builder parameterExactType(java.lang.Class<?> type)-
type
- - the exact type this parameter must match.public FuzzyMethodContract.Builder parameterSuperOf(java.lang.Class<?> type)-
- If a parameter is of type Number, any derived class (Integer, Long, etc.) will match it.
type
- - a type or derived type of the matching parameter.public FuzzyMethodContract.Builder parameterMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)-
classMatcher
- - the class matcher.public FuzzyMethodContract.Builder parameterExactType(java.lang.Class<?> type, - int index)-
type
- - the exact type this parameter must match.index
- - the expected position in the parameter list.public FuzzyMethodContract.Builder parameterSuperOf(java.lang.Class<?> type, - int index)-
- If a parameter is of type Number, any derived class (Integer, Long, etc.) will match it.
type
- - a type or derived type of the matching parameter.index
- - the expected position in the parameter list.public FuzzyMethodContract.Builder parameterMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher, - int index)-
classMatcher
- - the class matcher.index
- - the expected position in the parameter list.public FuzzyMethodContract.Builder parameterCount(int expectedCount)-
expectedCount
- - the number of parameters to expect.public FuzzyMethodContract.Builder returnTypeVoid()-
public FuzzyMethodContract.Builder returnTypeExact(java.lang.Class<?> type)-
type
- - the exact return type.public FuzzyMethodContract.Builder returnDerivedOf(java.lang.Class<?> type)-
type
- - the return type, or a super class of it.public FuzzyMethodContract.Builder returnTypeMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)-
classMatcher
- - the exact return type.public FuzzyMethodContract.Builder exceptionExactType(java.lang.Class<?> type)-
type
- - exception type.public FuzzyMethodContract.Builder exceptionSuperOf(java.lang.Class<?> type)-
type
- - exception type.public FuzzyMethodContract.Builder exceptionMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)-
classMatcher
- - the class matcher that must match.public FuzzyMethodContract.Builder exceptionExactType(java.lang.Class<?> type, - int index)-
type
- - exception type.index
- - the position in the throwable list.public FuzzyMethodContract.Builder exceptionSuperOf(java.lang.Class<?> type, - int index)-
type
- - exception type.index
- - the position in the throwable list.public FuzzyMethodContract.Builder exceptionMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher, - int index)-
classMatcher
- - the class matcher that must match.index
- - the position in the throwable list.@Nonnull -protected FuzzyMethodContract initialMember()-
AbstractFuzzyMember.Builder
initialMember
in class AbstractFuzzyMember.Builder<FuzzyMethodContract>
public FuzzyMethodContract build()-
AbstractFuzzyMember.Builder
- Builders should call AbstractFuzzyMember.prepareBuild()
when constructing new objects.
build
in class AbstractFuzzyMember.Builder<FuzzyMethodContract>
public class FuzzyMethodContract -extends AbstractFuzzyMember<MethodInfo>-
Modifier and Type | -Class and Description | -
---|---|
static class |
-FuzzyMethodContract.Builder
-Represents a builder for a fuzzy method contract.
- |
-
declaringMatcher, modifiersBanned, modifiersRequired, nameRegex, sealed
Modifier and Type | -Method and Description | -
---|---|
protected int |
-calculateRoundNumber()
-Calculate the round number indicating when this matcher should be applied.
- |
-
boolean |
-equals(java.lang.Object obj) |
-
java.util.List<com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract.ParameterClassMatcher> |
-getExceptionMatchers()
-Retrieve an immutable list of every exception matcher for this method.
- |
-
protected java.util.Map<java.lang.String,java.lang.Object> |
-getKeyValueView()
-Generate a view of this matcher as a key-value map.
- |
-
java.lang.Integer |
-getParamCount()
-Retrieve the expected parameter count for this method.
- |
-
com.google.common.collect.ImmutableList<com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract.ParameterClassMatcher> |
-getParamMatchers()
-Retrieve an immutable list of every parameter matcher for this method.
- |
-
AbstractFuzzyMatcher<java.lang.Class<?>> |
-getReturnMatcher()
-Retrieve the class matcher for the return type.
- |
-
int |
-hashCode() |
-
boolean |
-isMatch(MethodInfo value,
- java.lang.Object parent)
-Determine if the given value is a match.
- |
-
static FuzzyMethodContract.Builder |
-newBuilder()
-Return a method contract builder.
- |
-
protected void |
-prepareBuild()
-Called before a builder is building a member and copying its state.
- |
-
getDeclaringMatcher, getModifiersBanned, getModifiersRequired, getNameRegex, toString
and, combineRounds, combineRounds, compareTo, getRoundNumber, inverted, or
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public static FuzzyMethodContract.Builder newBuilder()-
public AbstractFuzzyMatcher<java.lang.Class<?>> getReturnMatcher()-
public com.google.common.collect.ImmutableList<com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract.ParameterClassMatcher> getParamMatchers()-
public java.util.List<com.comphenix.protocol.reflect.fuzzy.FuzzyMethodContract.ParameterClassMatcher> getExceptionMatchers()-
public java.lang.Integer getParamCount()-
protected void prepareBuild()-
AbstractFuzzyMember
- Use this to prepare any special values.
prepareBuild
in class AbstractFuzzyMember<MethodInfo>
public boolean isMatch(MethodInfo value, - java.lang.Object parent)-
AbstractFuzzyMatcher
isMatch
in class AbstractFuzzyMember<MethodInfo>
value
- - the value to match.parent
- - the parent container, or NULL if this value is the root.protected int calculateRoundNumber()-
AbstractFuzzyMatcher
- Matchers with a lower round number are applied before matchers with a higher round number. -
- By convention, this round number should be negative, except for zero in the case of a matcher
- that accepts any value. A good implementation should return the inverted tree depth (class hierachy)
- of the least specified type used in the matching. Thus Integer
will have a lower round number than
- Number
.
calculateRoundNumber
in class AbstractFuzzyMember<MethodInfo>
protected java.util.Map<java.lang.String,java.lang.Object> getKeyValueView()-
AbstractFuzzyMember
- Used by AbstractFuzzyMember.toString()
to print a representation of this object.
getKeyValueView
in class AbstractFuzzyMember<MethodInfo>
public int hashCode()-
hashCode
in class AbstractFuzzyMember<MethodInfo>
public boolean equals(java.lang.Object obj)-
equals
in class AbstractFuzzyMember<MethodInfo>
Package | -Description | -
---|---|
com.comphenix.protocol.reflect | -- |
com.comphenix.protocol.reflect.fuzzy | -- |
com.comphenix.protocol.reflect.instances | -- |
com.comphenix.protocol.utility | -- |
Modifier and Type | -Method and Description | -
---|---|
java.lang.reflect.Constructor<?> |
-FuzzyReflection.getConstructor(AbstractFuzzyMatcher<MethodInfo> matcher)
-Retrieve the first constructor that matches.
- |
-
java.util.List<java.lang.reflect.Constructor<?>> |
-FuzzyReflection.getConstructorList(AbstractFuzzyMatcher<MethodInfo> matcher)
-Retrieve a list of every constructor that matches the given matcher.
- |
-
java.lang.reflect.Field |
-FuzzyReflection.getField(AbstractFuzzyMatcher<java.lang.reflect.Field> matcher)
-Retrieve the first field that matches.
- |
-
java.util.List<java.lang.reflect.Field> |
-FuzzyReflection.getFieldList(AbstractFuzzyMatcher<java.lang.reflect.Field> matcher)
-Retrieve a list of every field that matches the given matcher.
- |
-
java.lang.reflect.Method |
-FuzzyReflection.getMethod(AbstractFuzzyMatcher<MethodInfo> matcher)
-Retrieve the first method that matches.
- |
-
java.util.List<java.lang.reflect.Method> |
-FuzzyReflection.getMethodList(AbstractFuzzyMatcher<MethodInfo> matcher)
-Retrieve a list of every method that matches the given matcher.
- |
-
Modifier and Type | -Class and Description | -
---|---|
class |
-AbstractFuzzyMember<T extends java.lang.reflect.Member>
-Represents a matcher that matches members.
- |
-
class |
-FuzzyClassContract
-Determine if a given class implements a given fuzzy (duck typed) contract.
- |
-
class |
-FuzzyFieldContract
-Represents a field matcher.
- |
-
class |
-FuzzyMethodContract
-Represents a contract for matching methods or constructors.
- |
-
Modifier and Type | -Field and Description | -
---|---|
protected AbstractFuzzyMatcher<java.lang.Class<?>> |
-AbstractFuzzyMember.declaringMatcher |
-
Modifier and Type | -Method and Description | -
---|---|
AbstractFuzzyMatcher<T> |
-AbstractFuzzyMatcher.and(AbstractFuzzyMatcher<T> other)
-Require that this and the given matcher be TRUE.
- |
-
AbstractFuzzyMatcher<java.lang.Class<?>> |
-AbstractFuzzyMember.getDeclaringMatcher()
-Retrieve a class matcher for the declaring class of the member.
- |
-
AbstractFuzzyMatcher<java.lang.Class<?>> |
-FuzzyMethodContract.getReturnMatcher()
-Retrieve the class matcher for the return type.
- |
-
AbstractFuzzyMatcher<java.lang.Class<?>> |
-FuzzyFieldContract.getTypeMatcher()
-Retrieve the class matcher that matches the type of a field.
- |
-
AbstractFuzzyMatcher<T> |
-AbstractFuzzyMatcher.inverted()
-Create a fuzzy matcher that returns the opposite result of the current matcher.
- |
-
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-FuzzyMatchers.matchAnyOf(java.lang.Class<?>... classes)
-Construct a class matcher that matches any of the given classes exactly.
- |
-
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-FuzzyMatchers.matchAnyOf(java.util.Set<java.lang.Class<?>> classes)
-Construct a class matcher that matches any of the given classes exactly.
- |
-
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-FuzzyMatchers.matchDerived(java.lang.Class<?> matcher)
-Construct a class matcher that matches derived types of the given class.
- |
-
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-FuzzyMatchers.matchExact(java.lang.Class<?> matcher)
-Construct a class matcher that matches types exactly.
- |
-
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-FuzzyMatchers.matchParent()
-Match the parent class of a method, field or constructor.
- |
-
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-FuzzyMatchers.matchRegex(java.util.regex.Pattern regex,
- int priority)
-Construct a class matcher based on the canonical names of classes.
- |
-
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-FuzzyMatchers.matchRegex(java.lang.String regex,
- int priority)
-Construct a class matcher based on the canonical names of classes.
- |
-
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-FuzzyMatchers.matchSuper(java.lang.Class<?> matcher)
-Construct a class matcher that matches super types of the given class.
- |
-
AbstractFuzzyMatcher<T> |
-AbstractFuzzyMatcher.or(AbstractFuzzyMatcher<T> other)
-Require that either this or the other given matcher be TRUE.
- |
-
Modifier and Type | -Method and Description | -
---|---|
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.Class<?>>> |
-FuzzyClassContract.getBaseclassContracts()
-Retrieve an immutable list of every baseclass contract.
- |
-
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>> |
-FuzzyClassContract.getConstructorContracts()
-Retrieve an immutable list of every constructor contract.
- |
-
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.reflect.Field>> |
-FuzzyClassContract.getFieldContracts()
-Retrieve an immutable list of every field contract.
- |
-
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.Class<?>>> |
-FuzzyClassContract.getInterfaceContracts()
-Retrieve an immutable list of every interface contract.
- |
-
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>> |
-FuzzyClassContract.getMethodContracts()
-Retrieve an immutable list of every method contract.
- |
-
Modifier and Type | -Method and Description | -
---|---|
AbstractFuzzyMatcher<T> |
-AbstractFuzzyMatcher.and(AbstractFuzzyMatcher<T> other)
-Require that this and the given matcher be TRUE.
- |
-
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.baseclass(AbstractFuzzyMatcher<java.lang.Class<?>> matcher)
-Add a new base class contract.
- |
-
int |
-AbstractFuzzyMatcher.compareTo(AbstractFuzzyMatcher<T> obj) |
-
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.constructor(AbstractFuzzyMatcher<MethodInfo> matcher)
-Add a new constructor contract.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.declaringClassMatching(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher) |
-
FuzzyFieldContract.Builder |
-FuzzyFieldContract.Builder.declaringClassMatching(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher) |
-
AbstractFuzzyMember.Builder<T> |
-AbstractFuzzyMember.Builder.declaringClassMatching(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
-Require that a member is defined by a class that matches the given matcher.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.exceptionMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
-Add a throwable exception that must match the given matcher,
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.exceptionMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher,
- int index)
-Add a throwable exception that must match the given matcher and index.
- |
-
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.field(AbstractFuzzyMatcher<java.lang.reflect.Field> matcher)
-Add a new field contract.
- |
-
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.interfaces(AbstractFuzzyMatcher<java.lang.Class<?>> matcher)
-Add a new interface contract.
- |
-
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.method(AbstractFuzzyMatcher<MethodInfo> matcher)
-Add a new method contract.
- |
-
AbstractFuzzyMatcher<T> |
-AbstractFuzzyMatcher.or(AbstractFuzzyMatcher<T> other)
-Require that either this or the other given matcher be TRUE.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.parameterMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
-Add a new required parameter whose type must match the given class matcher.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.parameterMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher,
- int index)
-Add a new required parameter whose type must match the given class matcher and index.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.returnTypeMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
-Set a matcher that must match the return type of a matching method.
- |
-
FuzzyFieldContract.Builder |
-FuzzyFieldContract.Builder.typeMatches(AbstractFuzzyMatcher<java.lang.Class<?>> matcher) |
-
Constructor and Description | -
---|
BannedGenerator(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
-Construct a generator that ensures any class that matches the given matcher is never constructed.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-MinecraftReflection.getMinecraftObjectMatcher()
-Retrieve a abstract fuzzy class matcher for Minecraft objects.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.fuzzy | -- |
Modifier and Type | -Class and Description | -
---|---|
static class |
-FuzzyFieldContract.Builder
-Represents a builder for a field matcher.
- |
-
static class |
-FuzzyMethodContract.Builder
-Represents a builder for a fuzzy method contract.
- |
-
Modifier and Type | -Method and Description | -
---|---|
AbstractFuzzyMember.Builder<T> |
-AbstractFuzzyMember.Builder.banModifier(int modifier)
-Add a given bit-field of modifers that will skip or ignore members.
- |
-
AbstractFuzzyMember.Builder<T> |
-AbstractFuzzyMember.Builder.declaringClassDerivedOf(java.lang.Class<?> declaringClass)
-Require that a member is defined by this exact class, or any super class.
- |
-
AbstractFuzzyMember.Builder<T> |
-AbstractFuzzyMember.Builder.declaringClassExactType(java.lang.Class<?> declaringClass)
-Require that a member is defined by this exact class.
- |
-
AbstractFuzzyMember.Builder<T> |
-AbstractFuzzyMember.Builder.declaringClassMatching(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
-Require that a member is defined by a class that matches the given matcher.
- |
-
AbstractFuzzyMember.Builder<T> |
-AbstractFuzzyMember.Builder.declaringClassSuperOf(java.lang.Class<?> declaringClass)
-Require that a member is defined by this exact class, or any super class.
- |
-
AbstractFuzzyMember.Builder<T> |
-AbstractFuzzyMember.Builder.nameExact(java.lang.String name)
-Set the exact name of the member we are matching.
- |
-
AbstractFuzzyMember.Builder<T> |
-AbstractFuzzyMember.Builder.nameRegex(java.util.regex.Pattern pattern)
-Set the regular expression pattern that matches a members name.
- |
-
AbstractFuzzyMember.Builder<T> |
-AbstractFuzzyMember.Builder.nameRegex(java.lang.String regex)
-Set the regular expresson that matches a members name.
- |
-
AbstractFuzzyMember.Builder<T> |
-AbstractFuzzyMember.Builder.requireModifier(int modifier)
-Add a given bit-field of required modifiers for every matching member.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.fuzzy | -- |
Modifier and Type | -Class and Description | -
---|---|
static class |
-AbstractFuzzyMember.Builder<T extends AbstractFuzzyMember<?>>
-Represents a builder of a fuzzy member contract.
- |
-
Modifier and Type | -Class and Description | -
---|---|
class |
-FuzzyFieldContract
-Represents a field matcher.
- |
-
class |
-FuzzyMethodContract
-Represents a contract for matching methods or constructors.
- |
-
Modifier and Type | -Field and Description | -
---|---|
protected T |
-AbstractFuzzyMember.Builder.member |
-
Constructor and Description | -
---|
AbstractFuzzyMember(AbstractFuzzyMember<T> other) |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.fuzzy | -- |
Modifier and Type | -Method and Description | -
---|---|
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.baseclass(AbstractFuzzyMatcher<java.lang.Class<?>> matcher)
-Add a new base class contract.
- |
-
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.baseclass(FuzzyClassContract.Builder builder)
-Add a new base class contract.
- |
-
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.constructor(AbstractFuzzyMatcher<MethodInfo> matcher)
-Add a new constructor contract.
- |
-
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.constructor(FuzzyMethodContract.Builder builder)
-Add a new constructor contract via a builder.
- |
-
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.field(AbstractFuzzyMatcher<java.lang.reflect.Field> matcher)
-Add a new field contract.
- |
-
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.field(FuzzyFieldContract.Builder builder)
-Add a new field contract via a builder.
- |
-
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.interfaces(AbstractFuzzyMatcher<java.lang.Class<?>> matcher)
-Add a new interface contract.
- |
-
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.interfaces(FuzzyClassContract.Builder builder)
-Add a new interface contract.
- |
-
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.method(AbstractFuzzyMatcher<MethodInfo> matcher)
-Add a new method contract.
- |
-
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.method(FuzzyMethodContract.Builder builder)
-Add a new method contract via a builder.
- |
-
static FuzzyClassContract.Builder |
-FuzzyClassContract.newBuilder()
-Construct a new fuzzy class contract builder.
- |
-
Modifier and Type | -Method and Description | -
---|---|
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.baseclass(FuzzyClassContract.Builder builder)
-Add a new base class contract.
- |
-
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.interfaces(FuzzyClassContract.Builder builder)
-Add a new interface contract.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.fuzzy | -- |
Modifier and Type | -Method and Description | -
---|---|
FuzzyClassContract |
-FuzzyClassContract.Builder.build() |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.fuzzy | -- |
Modifier and Type | -Method and Description | -
---|---|
FuzzyFieldContract.Builder |
-FuzzyFieldContract.Builder.banModifier(int modifier) |
-
FuzzyFieldContract.Builder |
-FuzzyFieldContract.Builder.declaringClassDerivedOf(java.lang.Class<?> declaringClass) |
-
FuzzyFieldContract.Builder |
-FuzzyFieldContract.Builder.declaringClassExactType(java.lang.Class<?> declaringClass) |
-
FuzzyFieldContract.Builder |
-FuzzyFieldContract.Builder.declaringClassMatching(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher) |
-
FuzzyFieldContract.Builder |
-FuzzyFieldContract.Builder.declaringClassSuperOf(java.lang.Class<?> declaringClass) |
-
FuzzyFieldContract.Builder |
-FuzzyFieldContract.Builder.nameExact(java.lang.String name) |
-
FuzzyFieldContract.Builder |
-FuzzyFieldContract.Builder.nameRegex(java.util.regex.Pattern pattern) |
-
FuzzyFieldContract.Builder |
-FuzzyFieldContract.Builder.nameRegex(java.lang.String regex) |
-
static FuzzyFieldContract.Builder |
-FuzzyFieldContract.newBuilder()
-Return a new fuzzy field contract builder.
- |
-
FuzzyFieldContract.Builder |
-FuzzyFieldContract.Builder.requireModifier(int modifier) |
-
FuzzyFieldContract.Builder |
-FuzzyFieldContract.Builder.typeDerivedOf(java.lang.Class<?> type) |
-
FuzzyFieldContract.Builder |
-FuzzyFieldContract.Builder.typeExact(java.lang.Class<?> type) |
-
FuzzyFieldContract.Builder |
-FuzzyFieldContract.Builder.typeMatches(AbstractFuzzyMatcher<java.lang.Class<?>> matcher) |
-
FuzzyFieldContract.Builder |
-FuzzyFieldContract.Builder.typeSuperOf(java.lang.Class<?> type) |
-
Modifier and Type | -Method and Description | -
---|---|
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.field(FuzzyFieldContract.Builder builder)
-Add a new field contract via a builder.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.fuzzy | -- |
Modifier and Type | -Method and Description | -
---|---|
FuzzyFieldContract |
-FuzzyFieldContract.Builder.build() |
-
protected FuzzyFieldContract |
-FuzzyFieldContract.Builder.initialMember() |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.fuzzy | -- |
Modifier and Type | -Method and Description | -
---|---|
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.banModifier(int modifier) |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.declaringClassDerivedOf(java.lang.Class<?> declaringClass) |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.declaringClassExactType(java.lang.Class<?> declaringClass) |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.declaringClassMatching(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher) |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.declaringClassSuperOf(java.lang.Class<?> declaringClass) |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.exceptionExactType(java.lang.Class<?> type)
-Add a throwable exception that must match the given type exactly.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.exceptionExactType(java.lang.Class<?> type,
- int index)
-Add a throwable exception that must match the given type exactly and index.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.exceptionMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
-Add a throwable exception that must match the given matcher,
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.exceptionMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher,
- int index)
-Add a throwable exception that must match the given matcher and index.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.exceptionSuperOf(java.lang.Class<?> type)
-Add a throwable exception that must match the given type or be derived.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.exceptionSuperOf(java.lang.Class<?> type,
- int index)
-Add a throwable exception that must match the given type or be derived and index.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.nameExact(java.lang.String name) |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.nameRegex(java.util.regex.Pattern pattern) |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.nameRegex(java.lang.String regex) |
-
static FuzzyMethodContract.Builder |
-FuzzyMethodContract.newBuilder()
-Return a method contract builder.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.parameterCount(int expectedCount)
-Set the expected number of parameters in the matching method.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.parameterExactType(java.lang.Class<?> type)
-Add a new required parameter by type for any matching method.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.parameterExactType(java.lang.Class<?> type,
- int index)
-Add a new required parameter by type and position for any matching method.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.parameterMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
-Add a new required parameter whose type must match the given class matcher.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.parameterMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher,
- int index)
-Add a new required parameter whose type must match the given class matcher and index.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.parameterSuperOf(java.lang.Class<?> type)
-Add a new required parameter whose type must be a superclass of the given type.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.parameterSuperOf(java.lang.Class<?> type,
- int index)
-Add a new required parameter whose type must be a superclass of the given type.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.requireModifier(int modifier) |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.returnDerivedOf(java.lang.Class<?> type)
-Set the expected super class of the return type for every matching method.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.returnTypeExact(java.lang.Class<?> type)
-Set the return type of a matching method exactly.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.returnTypeMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
-Set a matcher that must match the return type of a matching method.
- |
-
FuzzyMethodContract.Builder |
-FuzzyMethodContract.Builder.returnTypeVoid()
-Require a void method.
- |
-
Modifier and Type | -Method and Description | -
---|---|
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.constructor(FuzzyMethodContract.Builder builder)
-Add a new constructor contract via a builder.
- |
-
FuzzyClassContract.Builder |
-FuzzyClassContract.Builder.method(FuzzyMethodContract.Builder builder)
-Add a new method contract via a builder.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.fuzzy | -- |
Modifier and Type | -Method and Description | -
---|---|
FuzzyMethodContract |
-FuzzyMethodContract.Builder.build() |
-
protected FuzzyMethodContract |
-FuzzyMethodContract.Builder.initialMember() |
-
Class | -Description | -
---|---|
AbstractFuzzyMatcher<T> | -
- Represents a matcher for fields, methods, constructors and classes.
- |
-
AbstractFuzzyMember<T extends java.lang.reflect.Member> | -
- Represents a matcher that matches members.
- |
-
AbstractFuzzyMember.Builder<T extends AbstractFuzzyMember<?>> | -
- Represents a builder of a fuzzy member contract.
- |
-
FuzzyClassContract | -
- Determine if a given class implements a given fuzzy (duck typed) contract.
- |
-
FuzzyClassContract.Builder | -
- Represents a class contract builder.
- |
-
FuzzyFieldContract | -
- Represents a field matcher.
- |
-
FuzzyFieldContract.Builder | -
- Represents a builder for a field matcher.
- |
-
FuzzyMatchers | -
- Contains factory methods for matching classes.
- |
-
FuzzyMethodContract | -
- Represents a contract for matching methods or constructors.
- |
-
FuzzyMethodContract.Builder | -
- Represents a builder for a fuzzy method contract.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect | -- |
com.comphenix.protocol.reflect.fuzzy | -- |
com.comphenix.protocol.reflect.instances | -- |
com.comphenix.protocol.utility | -- |
Class and Description | -
---|
AbstractFuzzyMatcher
- Represents a matcher for fields, methods, constructors and classes.
- |
-
Class and Description | -
---|
AbstractFuzzyMatcher
- Represents a matcher for fields, methods, constructors and classes.
- |
-
AbstractFuzzyMember
- Represents a matcher that matches members.
- |
-
AbstractFuzzyMember.Builder
- Represents a builder of a fuzzy member contract.
- |
-
FuzzyClassContract
- Determine if a given class implements a given fuzzy (duck typed) contract.
- |
-
FuzzyClassContract.Builder
- Represents a class contract builder.
- |
-
FuzzyFieldContract
- Represents a field matcher.
- |
-
FuzzyFieldContract.Builder
- Represents a builder for a field matcher.
- |
-
FuzzyMethodContract
- Represents a contract for matching methods or constructors.
- |
-
FuzzyMethodContract.Builder
- Represents a builder for a fuzzy method contract.
- |
-
Class and Description | -
---|
AbstractFuzzyMatcher
- Represents a matcher for fields, methods, constructors and classes.
- |
-
Class and Description | -
---|
AbstractFuzzyMatcher
- Represents a matcher for fields, methods, constructors and classes.
- |
-
public class BannedGenerator -extends java.lang.Object -implements InstanceProvider-
Constructor and Description | -
---|
BannedGenerator(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
-Construct a generator that ensures any class that matches the given matcher is never constructed.
- |
-
BannedGenerator(java.lang.Class<?>... classes) |
-
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 BannedGenerator(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)-
classMatcher
- - a class matcher.public BannedGenerator(java.lang.Class<?>... classes)-
public java.lang.Object create(@Nullable - java.lang.Class<?> type)-
InstanceProvider
create
in interface InstanceProvider
type
- - type to create.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 final 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 -implements InstanceProvider-
Modifier and Type | -Field and Description | -
---|---|
static DefaultInstances |
-DEFAULT
-Standard default instance provider.
- |
-
Constructor and Description | -
---|
DefaultInstances(DefaultInstances other)
-Copy a given instance provider.
- |
-
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) |
-
java.lang.Object |
-create(java.lang.Class<?> type)
-Create an instance given a type, if possible.
- |
-
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.
- |
-
DefaultInstances |
-forEnhancer(net.sf.cglib.proxy.Enhancer enhancer)
-Construct default instances using the CGLIB enhancer object instead.
- |
-
static DefaultInstances |
-fromArray(InstanceProvider... instanceProviders)
-Construct a default instance generator using the given instance providers.
- |
-
static DefaultInstances |
-fromCollection(java.util.Collection<InstanceProvider> instanceProviders)
-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.
- |
-
int |
-getMaximumRecursion()
-Retrieve the the maximum height of the hierachy of creates types.
- |
-
<T> java.lang.reflect.Constructor<T> |
-getMinimumConstructor(java.lang.Class<T> type)
-Retrieve the constructor with the fewest number of parameters.
- |
-
com.google.common.collect.ImmutableList<InstanceProvider> |
-getRegistered()
-Retrieves a immutable list of every default object providers that generates instances.
- |
-
boolean |
-isNonNull()
-Retrieve whether or not the constructor's parameters must be non-null.
- |
-
void |
-setMaximumRecursion(int maximumRecursion)
-Set the maximum height of the hierachy of creates types.
- |
-
void |
-setNonNull(boolean nonNull)
-Set whether or not the constructor's parameters must be non-null.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final DefaultInstances DEFAULT-
public DefaultInstances(com.google.common.collect.ImmutableList<InstanceProvider> registered)-
registered
- - list of instance providers.public DefaultInstances(DefaultInstances other)-
other
- - instance provider to copy.public DefaultInstances(InstanceProvider... instaceProviders)-
instaceProviders
- - array of instance providers.public static DefaultInstances fromArray(InstanceProvider... instanceProviders)-
instaceProviders
- - array of instance providers.public static DefaultInstances fromCollection(java.util.Collection<InstanceProvider> instanceProviders)-
instaceProviders
- - collection of instance providers.public com.google.common.collect.ImmutableList<InstanceProvider> getRegistered()-
public boolean isNonNull()-
public void setNonNull(boolean nonNull)-
nonNull
- - TRUE if they must be non-null, FALSE otherwise.public int getMaximumRecursion()-
public void setMaximumRecursion(int maximumRecursion)-
maximumRecursion
- - maximum recursion height.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> java.lang.reflect.Constructor<T> getMinimumConstructor(java.lang.Class<T> type)-
type
- - type to construct.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 the construction.public DefaultInstances forEnhancer(net.sf.cglib.proxy.Enhancer enhancer)-
enhancer
- - a CGLIB enhancer to use.protected <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 java.lang.Object create(@Nullable - java.lang.Class<?> type)-
InstanceProvider
create
in interface InstanceProvider
type
- - type to create.public class ExistingGenerator -extends java.lang.Object -implements InstanceProvider-
- Only one instance per individual class.
Modifier and Type | -Method and Description | -
---|---|
java.lang.Object |
-create(java.lang.Class<?> type)
-Create an instance given a type, if possible.
- |
-
static ExistingGenerator |
-fromObjectArray(java.lang.Object[] values)
-Create an instance generator from a pre-defined array of values.
- |
-
static ExistingGenerator |
-fromObjectFields(java.lang.Object object)
-Automatically create an instance provider from a objects public and private fields.
- |
-
static ExistingGenerator |
-fromObjectFields(java.lang.Object object,
- java.lang.Class<?> type)
-Automatically create an instance provider from a objects public and private fields.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static ExistingGenerator fromObjectFields(java.lang.Object object)-
- If two or more fields share the same type, the last declared non-null field will take - precedent.
object
- - object to create an instance generator from.public static ExistingGenerator fromObjectFields(java.lang.Object object, - java.lang.Class<?> type)-
- If two or more fields share the same type, the last declared non-null field will take - precedent.
object
- - object to create an instance generator from.type
- - the type to cast the object.public static ExistingGenerator fromObjectArray(java.lang.Object[] values)-
values
- - values to provide.public java.lang.Object create(@Nullable - java.lang.Class<?> type)-
InstanceProvider
create
in interface InstanceProvider
type
- - type to create.public interface InstanceProvider
-java.lang.Object create(@Nullable - java.lang.Class<?> type)-
type
- - type to create.NotConstructableException
- Thrown to indicate that this type cannot or should never be constructed.public class NotConstructableException
-extends java.lang.IllegalArgumentException
-Constructor and Description | -
---|
NotConstructableException()
-Construct a new not constructable exception.
- |
-
NotConstructableException(java.lang.String message)
-Construct a new not constructable exception with a custom message.
- |
-
NotConstructableException(java.lang.String message,
- java.lang.Throwable cause)
-Construct a new not constructable exception with a custom message and cause.
- |
-
NotConstructableException(java.lang.Throwable cause)
-Construct a new not constructable exception with a custom cause.
- |
-
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public NotConstructableException()-
public NotConstructableException(java.lang.String message)-
public NotConstructableException(java.lang.String message, - java.lang.Throwable cause)-
public NotConstructableException(java.lang.Throwable cause)-
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 | -
---|---|
DefaultInstances |
-DefaultInstances.forEnhancer(net.sf.cglib.proxy.Enhancer enhancer)
-Construct default instances using the CGLIB enhancer object instead.
- |
-
static DefaultInstances |
-DefaultInstances.fromArray(InstanceProvider... instanceProviders)
-Construct a default instance generator using the given instance providers.
- |
-
static DefaultInstances |
-DefaultInstances.fromCollection(java.util.Collection<InstanceProvider> instanceProviders)
-Construct a default instance generator using the given instance providers.
- |
-
Constructor and Description | -
---|
DefaultInstances(DefaultInstances other)
-Copy a given instance provider.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.instances | -- |
Modifier and Type | -Method and Description | -
---|---|
static ExistingGenerator |
-ExistingGenerator.fromObjectArray(java.lang.Object[] values)
-Create an instance generator from a pre-defined array of values.
- |
-
static ExistingGenerator |
-ExistingGenerator.fromObjectFields(java.lang.Object object)
-Automatically create an instance provider from a objects public and private fields.
- |
-
static ExistingGenerator |
-ExistingGenerator.fromObjectFields(java.lang.Object object,
- java.lang.Class<?> type)
-Automatically create an instance provider from a objects public and private fields.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.cloning | -- |
com.comphenix.protocol.reflect.instances | -- |
Modifier and Type | -Field and Description | -
---|---|
protected InstanceProvider |
-FieldCloner.instanceProvider |
-
Modifier and Type | -Method and Description | -
---|---|
InstanceProvider |
-FieldCloner.getInstanceProvider()
-Retrieve the instance provider this cloner is using to create new, empty classes.
- |
-
InstanceProvider |
-AggregateCloner.BuilderParameters.getInstanceProvider()
-Retrieve the instance provider last set in the builder.
- |
-
Modifier and Type | -Method and Description | -
---|---|
AggregateCloner.Builder |
-AggregateCloner.Builder.instanceProvider(InstanceProvider provider)
-Set the instance provider supplied to all cloners in this builder.
- |
-
Constructor and Description | -
---|
FieldCloner(Cloner defaultCloner,
- InstanceProvider instanceProvider)
-Constructs a field cloner that copies objects by reading and writing the internal fields directly.
- |
-
Modifier and Type | -Class and Description | -
---|---|
class |
-BannedGenerator
-Generator that ensures certain types will never be created.
- |
-
class |
-CollectionGenerator
-Provides simple constructors for collection interfaces.
- |
-
class |
-DefaultInstances
-Used to construct default instances of any type.
- |
-
class |
-ExistingGenerator
-Provides instance constructors using a list of existing values.
- |
-
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... instanceProviders)
-Construct a default instance generator using the given instance providers.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static DefaultInstances |
-DefaultInstances.fromCollection(java.util.Collection<InstanceProvider> instanceProviders)
-Construct a default instance generator using the given instance providers.
- |
-
<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 | -
---|---|
BannedGenerator | -
- Generator that ensures certain types will never be created.
- |
-
CollectionGenerator | -
- Provides simple constructors for collection interfaces.
- |
-
DefaultInstances | -
- Used to construct default instances of any type.
- |
-
ExistingGenerator | -
- Provides instance constructors using a list of existing values.
- |
-
PrimitiveGenerator | -
- Provides constructors for primtive types, wrappers, arrays and strings.
- |
-
Exception | -Description | -
---|---|
NotConstructableException | -
- Invoked when a instance provider indicates that a given type cannot or should not be
- constructed under any circumstances.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.reflect.cloning | -- |
com.comphenix.protocol.reflect.instances | -- |
Class and Description | -
---|
InstanceProvider
- Represents a type generator for specific types.
- |
-
Class and Description | -
---|
CollectionGenerator
- Provides simple constructors for collection interfaces.
- |
-
DefaultInstances
- Used to construct default instances of any type.
- |
-
ExistingGenerator
- Provides instance constructors using a list of existing values.
- |
-
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.
- |
-
MethodInfo | -
- Represents a method or a constructor.
- |
-
MethodUtils | -
- Utility reflection methods focussed on methods in general rather than properties in particular.
- |
-
ObjectWriter | -
- Can copy an object field by field.
- |
-
PrettyPrinter | -
- Used to print the content of an arbitrary class.
- |
-
StructureModifier<TField> | -
- Provides list-oriented access to the fields of a Minecraft packet.
- |
-
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 | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.async | -- |
com.comphenix.protocol.events | -- |
com.comphenix.protocol.reflect | -- |
com.comphenix.protocol.reflect.cloning | -- |
com.comphenix.protocol.reflect.compiler | -- |
com.comphenix.protocol.reflect.fuzzy | -- |
com.comphenix.protocol.wrappers | -- |
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 | -
---|
FieldAccessException
- Invoked when a field is inaccessible due to security limitations, or when it simply doesn't exist.
- |
-
Class and Description | -
---|
StructureModifier
- Provides list-oriented access to the fields of a Minecraft packet.
- |
-
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.
- |
-
MethodInfo
- Represents a method or a constructor.
- |
-
StructureModifier
- Provides list-oriented access to the fields of a Minecraft packet.
- |
-
Class and Description | -
---|
ObjectWriter
- Can copy an object field by field.
- |
-
StructureModifier
- Provides list-oriented access to the fields of a Minecraft packet.
- |
-
Class and Description | -
---|
FieldAccessException
- Invoked when a field is inaccessible due to security limitations, or when it simply doesn't exist.
- |
-
StructureModifier
- Provides list-oriented access to the fields of a Minecraft packet.
- |
-
Class and Description | -
---|
MethodInfo
- Represents a method or a constructor.
- |
-
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.
- |
-
StructureModifier
- Provides list-oriented access to the fields of a Minecraft packet.
- |
-
public class ChatExtensions
-extends java.lang.Object
-Constructor and Description | -
---|
ChatExtensions(ProtocolManager manager) |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-broadcastMessageSilently(java.lang.String message,
- java.lang.String permission)
-Broadcast a message without invoking any packet listeners.
- |
-
void |
-sendMessageSilently(org.bukkit.command.CommandSender receiver,
- java.lang.String message)
-Send a message without invoking the packet listeners.
- |
-
static java.lang.String[] |
-toFlowerBox(java.lang.String[] message,
- java.lang.String marginChar,
- int marginWidth,
- int marginHeight)
-Print a flower box around a given message.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public ChatExtensions(ProtocolManager manager)-
public void sendMessageSilently(org.bukkit.command.CommandSender receiver, - java.lang.String message) - throws java.lang.reflect.InvocationTargetException-
receiver
- - the receiver.message
- - the message to send.java.lang.reflect.InvocationTargetException
- If we were unable to send the message.public void broadcastMessageSilently(java.lang.String message, - java.lang.String permission) - throws java.lang.reflect.InvocationTargetException-
message
- - message to send.permission
- - permission required to receieve the message. NULL to target everyone.java.lang.reflect.InvocationTargetException
- If we were unable to send the message.public static java.lang.String[] toFlowerBox(java.lang.String[] message, - java.lang.String marginChar, - int marginWidth, - int marginHeight)-
message
- - the message to print.marginChar
- - the character to use as margin.marginWidth
- - the width (in characters) of the left and right margin.marginHeight
- - the height (in characters) of the top and buttom margin.public class MinecraftMethods
-extends java.lang.Object
-Constructor and Description | -
---|
MinecraftMethods() |
-
Modifier and Type | -Method and Description | -
---|---|
static java.lang.reflect.Method |
-getSendPacketMethod()
-Retrieve the send packet method in PlayerConnection/NetServerHandler.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public class MinecraftReflection
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
static java.lang.String |
-MINECRAFT_OBJECT
-Deprecated.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static java.lang.Class<?> |
-getArrayClass(java.lang.Class<?> componentType)
-Retrieve the array class of a given component type.
- |
-
static java.lang.Class<?> |
-getBlockClass()
-Retrieve the Block (NMS) class.
- |
-
static java.lang.Object |
-getBukkitEntity(java.lang.Object nmsObject)
-Dynamically retrieve the Bukkit entity from a given entity.
- |
-
static org.bukkit.inventory.ItemStack |
-getBukkitItemStack(org.bukkit.inventory.ItemStack bukkitItemStack)
-Retrieve a CraftItemStack from a given ItemStack.
- |
-
static org.bukkit.inventory.ItemStack |
-getBukkitItemStack(java.lang.Object minecraftItemStack)
-Retrieve the Bukkit ItemStack from a given net.minecraft.server ItemStack.
- |
-
static java.lang.Class<?> |
-getChunkCoordinatesClass()
-Retrieve the ChunkPosition class.
- |
-
static java.lang.Class<?> |
-getChunkPositionClass()
-Retrieve the ChunkPosition class.
- |
-
static java.lang.Class |
-getCraftBukkitClass(java.lang.String className)
-Retrieve the class object of a specific CraftBukkit class.
- |
-
static java.lang.String |
-getCraftBukkitPackage()
-Retrieve the name of the root CraftBukkit package.
- |
-
static java.lang.Class<?> |
-getCraftEntityClass()
-Retrieve the CraftEntity class.
- |
-
static java.lang.Class<?> |
-getCraftItemStackClass()
-Retrieve the CraftItemStack class.
- |
-
static java.lang.Class<?> |
-getCraftPlayerClass()
-Retrieve the CraftPlayer class.
- |
-
static java.lang.Class<?> |
-getDataWatcherClass()
-Retrieve the DataWatcher class.
- |
-
static java.lang.Class<?> |
-getEntityClass()
-Retrieve the entity (NMS) class.
- |
-
static java.lang.Class<?> |
-getEntityPlayerClass()
-Retrieve the EntityPlayer (NMS) class.
- |
-
static java.lang.Class<?> |
-getEntityTrackerClass()
-Retrieve the EntityTracker (NMS) class.
- |
-
static java.lang.Class<?> |
-getItemStackArrayClass()
-Retrieve the ItemStack[] class.
- |
-
static java.lang.Class<?> |
-getItemStackClass()
-Retrieve the NMS ItemStack class.
- |
-
static java.lang.Class<?> |
-getMinecraftClass(java.lang.String className)
-Retrieve the class object of a specific Minecraft class.
- |
-
static java.lang.Class<?> |
-getMinecraftClass(java.lang.String className,
- java.lang.String... aliases)
-Retrieve the first class that matches a specified Minecraft name.
- |
-
static java.lang.Object |
-getMinecraftItemStack(org.bukkit.inventory.ItemStack stack)
-Retrieve the net.minecraft.server ItemStack from a Bukkit ItemStack.
- |
-
static AbstractFuzzyMatcher<java.lang.Class<?>> |
-getMinecraftObjectMatcher()
-Retrieve a abstract fuzzy class matcher for Minecraft objects.
- |
-
static java.lang.String |
-getMinecraftObjectRegex()
-Retrieve a regular expression that can match Minecraft package objects.
- |
-
static java.lang.String |
-getMinecraftPackage()
-Retrieve the name of the Minecraft server package.
- |
-
static java.lang.Class<?> |
-getMinecraftServerClass()
-Retrieve the MinecraftServer class.
- |
-
static java.lang.Class<?> |
-getNBTBaseClass()
-Retrieve the NBT base class.
- |
-
static java.lang.Class<?> |
-getNetHandlerClass()
-Retrieve the NetHandler class (or Connection)
- |
-
static java.lang.Class<?> |
-getNetLoginHandlerClass()
-Retrieve the NetLoginHandler class (or PendingConnection)
- |
-
static java.lang.String |
-getNetLoginHandlerName()
-Dynamically retrieve the name of the current NetLoginHandler.
- |
-
static java.lang.Class<?> |
-getNetServerHandlerClass()
-Retrieve the NetServerHandler class (or PlayerConnection)
- |
-
static java.lang.Class<?> |
-getNetworkListenThreadClass()
-Retrieve the NetworkListenThread class (NMS).
- |
-
static java.lang.Class<?> |
-getNetworkManagerClass()
-Retrieve the NetworkManager class or its interface.
- |
-
static java.lang.String |
-getNetworkManagerName()
-Dynamically retrieve the NetworkManager name.
- |
-
static java.lang.Class<?> |
-getPacketClass()
-Retrieve the packet class.
- |
-
static java.lang.Class<?> |
-getPlayerListClass()
-Retrieve the player list class (or ServerConfigurationManager),
- |
-
static java.lang.Class<?> |
-getServerConnectionClass()
-Retrieve the ServerConnection abstract class.
- |
-
static java.lang.Class<?> |
-getWatchableObjectClass()
-Retrieve the WatchableObject class.
- |
-
static java.lang.Class<?> |
-getWorldServerClass()
-Retrieve the WorldServer (NMS) class.
- |
-
static java.lang.Class<?> |
-getWorldTypeClass()
-Retrieve the WorldType class.
- |
-
static boolean |
-isChunkCoordinates(java.lang.Object obj)
-Determine if a given object is a ChunkCoordinate.
- |
-
static boolean |
-isChunkPosition(java.lang.Object obj)
-Determine if a given object is a ChunkPosition.
- |
-
static boolean |
-isCraftItemStack(java.lang.Object obj)
-Determine if the given object is a CraftItemStack instancey.
- |
-
static boolean |
-isCraftPlayer(java.lang.Object value)
-Determine if the given object is a CraftPlayer class.
- |
-
static boolean |
-isDataWatcher(java.lang.Object obj)
-Determine if the given object is a data watcher object.
- |
-
static boolean |
-isItemStack(java.lang.Object value)
-Determine if the given object is a NMS ItemStack.
- |
-
static boolean |
-isLoginHandler(java.lang.Object obj)
-Determine if the given object is a NetLoginHandler (PendingConnection)
- |
-
static boolean |
-isMinecraftClass(java.lang.Class<?> clazz)
-Determine if the given class is found within the package net.minecraft.server, or any equivalent package.
- |
-
static boolean |
-isMinecraftEntity(java.lang.Object obj)
-Determine if the given object is actually a Minecraft packet.
- |
-
static boolean |
-isMinecraftObject(java.lang.Object obj)
-Determine if a given object can be found within the package net.minecraft.server.
- |
-
static boolean |
-isMinecraftObject(java.lang.Object obj,
- java.lang.String className)
-Determine if a given object is found in net.minecraft.server, and has the given name.
- |
-
static boolean |
-isMinecraftPlayer(java.lang.Object obj)
-Determine if the given object is a Minecraft player entity.
- |
-
static boolean |
-isPacketClass(java.lang.Object obj)
-Determine if the given object is actually a Minecraft packet.
- |
-
static boolean |
-isServerHandler(java.lang.Object obj)
-Determine if the given object is assignable to a NetServerHandler (PlayerConnection)
- |
-
static boolean |
-isWatchableObject(java.lang.Object obj)
-Determine if the given object is a watchable object.
- |
-
static void |
-setMinecraftPackage(java.lang.String minecraftPackage,
- java.lang.String craftBukkitPackage)
-Used during debugging and testing.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
@Deprecated -public static final java.lang.String MINECRAFT_OBJECT-
- Replaced by the method getMinecraftObjectRegex()
.
public static java.lang.String getMinecraftObjectRegex()-
public static AbstractFuzzyMatcher<java.lang.Class<?>> getMinecraftObjectMatcher()-
public static java.lang.String getMinecraftPackage()-
public static void setMinecraftPackage(java.lang.String minecraftPackage, - java.lang.String craftBukkitPackage)-
minecraftPackage
- - the current Minecraft package.craftBukkitPackage
- - the current CraftBukkit package.public static java.lang.String getCraftBukkitPackage()-
public static java.lang.Object getBukkitEntity(java.lang.Object nmsObject)-
nmsObject
- - the NMS entity.java.lang.RuntimeException
- If we were unable to retrieve the Bukkit entity.public static boolean isMinecraftObject(@Nonnull - java.lang.Object obj)-
obj
- - the object to test.public static boolean isMinecraftClass(@Nonnull - java.lang.Class<?> clazz)-
clazz
- - the class to test.public static boolean isMinecraftObject(@Nonnull - java.lang.Object obj, - java.lang.String className)-
obj
- - the object to test.className
- - the class name to test.public static boolean isChunkPosition(java.lang.Object obj)-
obj
- - the object to test.public static boolean isChunkCoordinates(java.lang.Object obj)-
obj
- - the object to test.public static boolean isPacketClass(java.lang.Object obj)-
obj
- - the given object.public static boolean isLoginHandler(java.lang.Object obj)-
obj
- - the given object.public static boolean isServerHandler(java.lang.Object obj)-
obj
- - the given object.public static boolean isMinecraftEntity(java.lang.Object obj)-
obj
- - the given object.public static boolean isItemStack(java.lang.Object value)-
value
- - the given object.public static boolean isCraftPlayer(java.lang.Object value)-
value
- - the given object.public static boolean isMinecraftPlayer(java.lang.Object obj)-
obj
- - the given object.public static boolean isWatchableObject(java.lang.Object obj)-
obj
- - the given object.public static boolean isDataWatcher(java.lang.Object obj)-
obj
- - the given object.public static boolean isCraftItemStack(java.lang.Object obj)-
obj
- - the given object.public static java.lang.Class<?> getEntityPlayerClass()-
public static java.lang.Class<?> getEntityClass()-
public static java.lang.Class<?> getWorldServerClass()-
public static java.lang.Class<?> getPacketClass()-
public static java.lang.Class<?> getMinecraftServerClass()-
public static java.lang.Class<?> getPlayerListClass()-
public static java.lang.Class<?> getNetLoginHandlerClass()-
public static java.lang.Class<?> getNetServerHandlerClass()-
public static java.lang.Class<?> getNetworkManagerClass()-
public static java.lang.Class<?> getNetHandlerClass()-
public static java.lang.Class<?> getItemStackClass()-
public static java.lang.Class<?> getBlockClass()-
public static java.lang.Class<?> getWorldTypeClass()-
public static java.lang.Class<?> getDataWatcherClass()-
public static java.lang.Class<?> getChunkPositionClass()-
public static java.lang.Class<?> getChunkCoordinatesClass()-
public static java.lang.Class<?> getWatchableObjectClass()-
public static java.lang.Class<?> getServerConnectionClass()-
public static java.lang.Class<?> getNBTBaseClass()-
public static java.lang.Class<?> getEntityTrackerClass()-
public static java.lang.Class<?> getNetworkListenThreadClass()-
- Note that this class was removed after Minecraft 1.3.1.
public static java.lang.Class<?> getItemStackArrayClass()-
public static java.lang.Class<?> getArrayClass(java.lang.Class<?> componentType)-
componentType
- - type of each element in the array.public static java.lang.Class<?> getCraftItemStackClass()-
public static java.lang.Class<?> getCraftPlayerClass()-
public static java.lang.Class<?> getCraftEntityClass()-
public static org.bukkit.inventory.ItemStack getBukkitItemStack(org.bukkit.inventory.ItemStack bukkitItemStack)-
bukkitItemStack
- - the Bukkit ItemStack to convert.public static org.bukkit.inventory.ItemStack getBukkitItemStack(java.lang.Object minecraftItemStack)-
minecraftItemStack
- - the NMS ItemStack to wrap.public static java.lang.Object getMinecraftItemStack(org.bukkit.inventory.ItemStack stack)-
stack
- - the Bukkit ItemStack to convert.public static java.lang.Class getCraftBukkitClass(java.lang.String className)-
className
- - the specific CraftBukkit class.java.lang.RuntimeException
- If we are unable to find the given class.public static java.lang.Class<?> getMinecraftClass(java.lang.String className)-
className
- - the specific Minecraft class.java.lang.RuntimeException
- If we are unable to find the given class.public static java.lang.Class<?> getMinecraftClass(java.lang.String className, - java.lang.String... aliases)-
className
- - the specific Minecraft class.aliases
- - alternative names for this Minecraft class.java.lang.RuntimeException
- If we are unable to find any of the given classes.public static java.lang.String getNetworkManagerName()-
public static java.lang.String getNetLoginHandlerName()-
public class MinecraftVersion -extends java.lang.Object -implements java.lang.Comparable<MinecraftVersion>-
Constructor and Description | -
---|
MinecraftVersion(int major,
- int minor,
- int build)
-Construct a version object directly.
- |
-
MinecraftVersion(int major,
- int minor,
- int build,
- java.lang.String development)
-Construct a version object directly.
- |
-
MinecraftVersion(org.bukkit.Server server)
-Determine the current Minecraft version.
- |
-
MinecraftVersion(java.lang.String versionOnly)
-Construct a version object from the format major.minor.build.
- |
-
Modifier and Type | -Method and Description | -
---|---|
int |
-compareTo(MinecraftVersion o) |
-
boolean |
-equals(java.lang.Object obj) |
-
static java.lang.String |
-extractVersion(java.lang.String text)
-Extract the Minecraft version from CraftBukkit itself.
- |
-
int |
-getBuild()
-Build version number
- |
-
java.lang.String |
-getDevelopmentStage()
-Retrieve the development stage.
- |
-
int |
-getMajor()
-Major version number
- |
-
int |
-getMinor()
-Minor version number
- |
-
java.lang.String |
-getVersion()
-Retrieve the version String (major.minor.build) only.
- |
-
int |
-hashCode() |
-
java.lang.String |
-toString() |
-
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public MinecraftVersion(org.bukkit.Server server)-
server
- - the Bukkit server that will be used to examine the MC version.public MinecraftVersion(java.lang.String versionOnly)-
versionOnly
- - the version in text form.public MinecraftVersion(int major, - int minor, - int build)-
major
- - major version number.minor
- - minor version number.build
- - build version number.public MinecraftVersion(int major, - int minor, - int build, - java.lang.String development)-
major
- - major version number.minor
- - minor version number.build
- - build version number.development
- - development stage.public int getMajor()-
public int getMinor()-
public int getBuild()-
public java.lang.String getDevelopmentStage()-
public java.lang.String getVersion()-
public int compareTo(MinecraftVersion o)-
compareTo
in interface java.lang.Comparable<MinecraftVersion>
public boolean equals(java.lang.Object obj)-
equals
in class java.lang.Object
public int hashCode()-
hashCode
in class java.lang.Object
public java.lang.String toString()-
toString
in class java.lang.Object
public static java.lang.String extractVersion(java.lang.String text)-
server
- - the server object representing CraftBukkit.java.lang.IllegalStateException
- If we could not parse the version string.public class StreamSerializer
-extends java.lang.Object
-Constructor and Description | -
---|
StreamSerializer() |
-
Modifier and Type | -Method and Description | -
---|---|
org.bukkit.inventory.ItemStack |
-deserializeItemStack(java.io.DataInputStream input)
-Read or deserialize an item stack from an underlying input stream.
- |
-
org.bukkit.inventory.ItemStack |
-deserializeItemStack(java.lang.String input)
-Deserialize an item stack from a base-64 encoded string.
- |
-
void |
-serializeItemStack(java.io.DataOutputStream output,
- org.bukkit.inventory.ItemStack stack)
-Write or serialize an item stack to the given output stream.
- |
-
java.lang.String |
-serializeItemStack(org.bukkit.inventory.ItemStack stack)
-Serialize an item stack as a base-64 encoded string.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public org.bukkit.inventory.ItemStack deserializeItemStack(@Nonnull - java.io.DataInputStream input) - throws java.io.IOException-
- To supply a byte array, wrap it in a ByteArrayInputStream
- and DataInputStream
.
input
- - the target input stream.java.io.IOException
- If the operation failed due to reflection or corrupt data.public org.bukkit.inventory.ItemStack deserializeItemStack(@Nonnull - java.lang.String input) - throws java.io.IOException-
input
- - base-64 encoded string.java.io.IOException
- If the operation failed due to reflection or corrupt data.public void serializeItemStack(@Nonnull - java.io.DataOutputStream output, - org.bukkit.inventory.ItemStack stack) - throws java.io.IOException-
- To supply a byte array, wrap it in a ByteArrayOutputStream
- and DataOutputStream
.
-
- Note: An ItemStack can be written to a stream even if it's NULL.
output
- - the target output stream.stack
- - the item stack that will be written, or NULL to represent air/nothing.java.io.IOException
- If the operation fails due to reflection problems.public java.lang.String serializeItemStack(org.bukkit.inventory.ItemStack stack) - throws java.io.IOException-
- Note: An ItemStack can be written to the serialized text even if it's NULL.
stack
- - the item stack to serialize, or NULL to represent air/nothing.java.io.IOException
- If the operation fails due to reflection problems.public static interface WrappedScheduler.TaskWrapper
-public class WrappedScheduler
-extends java.lang.Object
-Modifier and Type | -Class and Description | -
---|---|
static interface |
-WrappedScheduler.TaskWrapper
-Represents a backwards compatible Bukkit task.
- |
-
Constructor and Description | -
---|
WrappedScheduler() |
-
Modifier and Type | -Method and Description | -
---|---|
static WrappedScheduler.TaskWrapper |
-runAsynchronouslyOnce(org.bukkit.plugin.Plugin plugin,
- java.lang.Runnable runnable,
- long firstDelay)
-Schedule a given task for a single asynchronous execution.
- |
-
static WrappedScheduler.TaskWrapper |
-runAsynchronouslyRepeat(org.bukkit.plugin.Plugin plugin,
- org.bukkit.scheduler.BukkitScheduler scheduler,
- java.lang.Runnable runnable,
- long firstDelay,
- long repeatDelay)
-Schedule a given task for asynchronous execution.
- |
-
static WrappedScheduler.TaskWrapper |
-runAsynchronouslyRepeat(org.bukkit.plugin.Plugin plugin,
- java.lang.Runnable runnable,
- long firstDelay,
- long repeatDelay)
-Schedule a given task for multiple asynchronous executions.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static WrappedScheduler.TaskWrapper runAsynchronouslyOnce(org.bukkit.plugin.Plugin plugin, - java.lang.Runnable runnable, - long firstDelay)-
plugin
- - the owner plugin.runnable
- - the task to run.firstDelay
- - the amount of time to wait until executing the task.public static WrappedScheduler.TaskWrapper runAsynchronouslyRepeat(org.bukkit.plugin.Plugin plugin, - java.lang.Runnable runnable, - long firstDelay, - long repeatDelay)-
plugin
- - the owner plugin.runnable
- - the task to run.firstDelay
- - the amount of time to wait until executing the task for the first time.repeatDelay
- - the amount of time inbetween each execution. If less than zero, the task is only executed once.public static WrappedScheduler.TaskWrapper runAsynchronouslyRepeat(org.bukkit.plugin.Plugin plugin, - org.bukkit.scheduler.BukkitScheduler scheduler, - java.lang.Runnable runnable, - long firstDelay, - long repeatDelay)-
plugin
- - the owner plugin.scheduler
- - the current Bukkit scheduler.runnable
- - the task to run.firstDelay
- - the amount of time to wait until executing the task for the first time.repeatDelay
- - the amount of time inbetween each execution. If less than zero, the task is only executed once.Package | -Description | -
---|---|
com.comphenix.protocol.utility | -- |
Modifier and Type | -Method and Description | -
---|---|
int |
-MinecraftVersion.compareTo(MinecraftVersion o) |
-
Package | -Description | -
---|---|
com.comphenix.protocol.events | -- |
Modifier and Type | -Method and Description | -
---|---|
StreamSerializer |
-PacketContainer.getByteArraySerializer()
-Retrieve a serializer for reading and writing ItemStacks stored in a byte array.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.utility | -- |
Modifier and Type | -Method and Description | -
---|---|
static WrappedScheduler.TaskWrapper |
-WrappedScheduler.runAsynchronouslyOnce(org.bukkit.plugin.Plugin plugin,
- java.lang.Runnable runnable,
- long firstDelay)
-Schedule a given task for a single asynchronous execution.
- |
-
static WrappedScheduler.TaskWrapper |
-WrappedScheduler.runAsynchronouslyRepeat(org.bukkit.plugin.Plugin plugin,
- org.bukkit.scheduler.BukkitScheduler scheduler,
- java.lang.Runnable runnable,
- long firstDelay,
- long repeatDelay)
-Schedule a given task for asynchronous execution.
- |
-
static WrappedScheduler.TaskWrapper |
-WrappedScheduler.runAsynchronouslyRepeat(org.bukkit.plugin.Plugin plugin,
- java.lang.Runnable runnable,
- long firstDelay,
- long repeatDelay)
-Schedule a given task for multiple asynchronous executions.
- |
-
Interface | -Description | -
---|---|
WrappedScheduler.TaskWrapper | -
- Represents a backwards compatible Bukkit task.
- |
-
Class | -Description | -
---|---|
ChatExtensions | -
- Utility methods for sending chat messages.
- |
-
MinecraftMethods | -
- Static methods for accessing Minecraft methods.
- |
-
MinecraftReflection | -
- Methods and constants specifically used in conjuction with reflecting Minecraft object.
- |
-
MinecraftVersion | -
- Determine the current Minecraft version.
- |
-
StreamSerializer | -
- Utility methods for reading and writing Minecraft objects to streams.
- |
-
WrappedScheduler | -
- Allows us to stay backwards compatible with older versions of Bukkit.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.events | -- |
com.comphenix.protocol.utility | -- |
Class and Description | -
---|
StreamSerializer
- Utility methods for reading and writing Minecraft objects to streams.
- |
-
Class and Description | -
---|
MinecraftVersion
- Determine the current Minecraft version.
- |
-
WrappedScheduler.TaskWrapper
- Represents a backwards compatible Bukkit task.
- |
-
public class BukkitConverters
-extends java.lang.Object
-Constructor and Description | -
---|
BukkitConverters() |
-
Modifier and Type | -Method and Description | -
---|---|
static EquivalentConverter<WrappedDataWatcher> |
-getDataWatcherConverter()
-Retrieve a converter for the NMS DataWatcher class and our wrapper.
- |
-
static EquivalentConverter<org.bukkit.entity.Entity> |
-getEntityConverter(org.bukkit.World world)
-Retrieve a converter for NMS entities and Bukkit entities.
- |
-
static <TType> EquivalentConverter<TType> |
-getIgnoreNull(EquivalentConverter<TType> delegate)
-Wraps a given equivalent converter in NULL checks, ensuring that such values are ignored.
- |
-
static EquivalentConverter<org.bukkit.inventory.ItemStack> |
-getItemStackConverter()
-Retrieve the converter used to convert NMS ItemStacks to Bukkit's ItemStack.
- |
-
static <T> EquivalentConverter<java.util.List<T>> |
-getListConverter(java.lang.Class<?> genericItemType,
- EquivalentConverter<T> itemConverter) |
-
static EquivalentConverter<NbtBase<?>> |
-getNbtConverter()
-Retrieve an equivalent converter for net.minecraft.server NBT classes and their wrappers.
- |
-
static EquivalentConverter<WrappedWatchableObject> |
-getWatchableObjectConverter()
-Retrieve a converter for watchable objects and the respective wrapper.
- |
-
static EquivalentConverter<org.bukkit.WorldType> |
-getWorldTypeConverter()
-Retrieve a converter for Bukkit's world type enum and the NMS equivalent.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static <T> EquivalentConverter<java.util.List<T>> getListConverter(java.lang.Class<?> genericItemType, - EquivalentConverter<T> itemConverter)-
public static EquivalentConverter<WrappedWatchableObject> getWatchableObjectConverter()-
public static EquivalentConverter<WrappedDataWatcher> getDataWatcherConverter()-
public static EquivalentConverter<org.bukkit.WorldType> getWorldTypeConverter()-
public static EquivalentConverter<NbtBase<?>> getNbtConverter()-
public static EquivalentConverter<org.bukkit.entity.Entity> getEntityConverter(org.bukkit.World world)-
world
- - the current world.public static EquivalentConverter<org.bukkit.inventory.ItemStack> getItemStackConverter()-
public static <TType> EquivalentConverter<TType> getIgnoreNull(EquivalentConverter<TType> delegate)-
delegate
- - the underlying equivalent converter.public class ChunkPosition
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
static ChunkPosition |
-ORIGIN
-Represents the null (0, 0, 0) origin.
- |
-
protected int |
-x |
-
protected int |
-y |
-
protected int |
-z |
-
Constructor and Description | -
---|
ChunkPosition(int x,
- int y,
- int z)
-Construct an immutable 3D vector.
- |
-
ChunkPosition(org.bukkit.util.Vector vector)
-Construct an immutable integer 3D vector from a mutable Bukkit vector.
- |
-
Modifier and Type | -Method and Description | -
---|---|
ChunkPosition |
-add(ChunkPosition other)
-Adds the current position and a given position together, producing a result position.
- |
-
ChunkPosition |
-divide(int divisor)
-Divide each dimension in the current position by the given divisor.
- |
-
boolean |
-equals(java.lang.Object obj) |
-
static EquivalentConverter<ChunkPosition> |
-getConverter()
-Used to convert between NMS ChunkPosition and the wrapper instance.
- |
-
int |
-getX()
-Retrieve the x-coordinate.
- |
-
int |
-getY()
-Retrieve the y-coordinate.
- |
-
int |
-getZ()
-Retrieve the z-coordinate.
- |
-
int |
-hashCode() |
-
ChunkPosition |
-multiply(int factor)
-Multiply each dimension in the current position by the given factor.
- |
-
ChunkPosition |
-subtract(ChunkPosition other)
-Adds the current position and a given position together, producing a result position.
- |
-
org.bukkit.util.Vector |
-toVector()
-Convert this instance to an equivalent real 3D vector.
- |
-
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
public static ChunkPosition ORIGIN-
protected final int x-
protected final int y-
protected final int z-
public ChunkPosition(int x, - int y, - int z)-
public ChunkPosition(org.bukkit.util.Vector vector)-
vector
- - the mutable real Bukkit vector to copy.public org.bukkit.util.Vector toVector()-
public int getX()-
public int getY()-
public int getZ()-
public ChunkPosition add(ChunkPosition other)-
other
- - the other position.public ChunkPosition subtract(ChunkPosition other)-
other
- - the other position.public ChunkPosition multiply(int factor)-
factor
- - multiplier.public ChunkPosition divide(int divisor)-
divisor
- - the divisor.public static EquivalentConverter<ChunkPosition> getConverter()-
public boolean equals(java.lang.Object obj)-
equals
in class java.lang.Object
public int hashCode()-
hashCode
in class java.lang.Object
public class TroveWrapper
-extends java.lang.Object
-Constructor and Description | -
---|
TroveWrapper() |
-
Modifier and Type | -Method and Description | -
---|---|
static <TValue> java.util.List<TValue> |
-getDecoratedList(java.lang.Object troveList)
-Retrieve a Java wrapper for the corresponding Trove list.
- |
-
static <TKey,TValue> |
-getDecoratedMap(java.lang.Object troveMap)
-Retrieve a Java wrapper for the corresponding Trove map.
- |
-
static <TValue> java.util.Set<TValue> |
-getDecoratedSet(java.lang.Object troveSet)
-Retrieve a Java wrapper for the corresponding Trove set.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static <TKey,TValue> java.util.Map<TKey,TValue> getDecoratedMap(@Nonnull - java.lang.Object troveMap)-
troveMap
- - the trove map to wrap.java.lang.IllegalStateException
- If GNU Trove cannot be found in the class map.java.lang.IllegalArgumentException
- If troveMap is NULL.FieldAccessException
- Error in wrapper method or lack of reflection permissions.public static <TValue> java.util.Set<TValue> getDecoratedSet(@Nonnull - java.lang.Object troveSet)-
troveSet
- - the trove set to wrap.java.lang.IllegalStateException
- If GNU Trove cannot be found in the class map.java.lang.IllegalArgumentException
- If troveSet is NULL.FieldAccessException
- Error in wrapper method or lack of reflection permissions.public static <TValue> java.util.List<TValue> getDecoratedList(@Nonnull - java.lang.Object troveList)-
troveList
- - the trove list to wrap.java.lang.IllegalStateException
- If GNU Trove cannot be found in the class map.java.lang.IllegalArgumentException
- If troveList is NULL.FieldAccessException
- Error in wrapper method or lack of reflection permissions.public class WrappedChunkCoordinate -extends java.lang.Object -implements java.lang.Comparable<WrappedChunkCoordinate>-
Modifier and Type | -Field and Description | -
---|---|
protected java.lang.Comparable |
-handle |
-
Constructor and Description | -
---|
WrappedChunkCoordinate()
-Create a new empty wrapper.
- |
-
WrappedChunkCoordinate(ChunkPosition position)
-Create a chunk coordinate wrapper from a given position.
- |
-
WrappedChunkCoordinate(java.lang.Comparable handle)
-Create a wrapper for a specific chunk coordinates.
- |
-
WrappedChunkCoordinate(int x,
- int y,
- int z)
-Create a wrapper with specific values.
- |
-
Modifier and Type | -Method and Description | -
---|---|
int |
-compareTo(WrappedChunkCoordinate other) |
-
boolean |
-equals(java.lang.Object other) |
-
java.lang.Object |
-getHandle() |
-
int |
-getX()
-Retrieve the x coordinate of the underlying coordinate.
- |
-
int |
-getY()
-Retrieve the y coordinate of the underlying coordinate.
- |
-
int |
-getZ()
-Retrieve the z coordinate of the underlying coordinate.
- |
-
int |
-hashCode() |
-
void |
-setX(int newX)
-Set the x coordinate of the underlying coordinate.
- |
-
void |
-setY(int newY)
-Set the y coordinate of the underlying coordinate.
- |
-
void |
-setZ(int newZ)
-Set the z coordinate of the underlying coordiate.
- |
-
ChunkPosition |
-toPosition()
-Create an immutable chunk position from this coordinate.
- |
-
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
public WrappedChunkCoordinate()-
public WrappedChunkCoordinate(java.lang.Comparable handle)-
handle
- - the NMS chunk coordinates.public WrappedChunkCoordinate(int x, - int y, - int z)-
x
- - the x coordinate.y
- - the y coordinate.z
- - the z coordinate.public WrappedChunkCoordinate(ChunkPosition position)-
position
- - the given position.public java.lang.Object getHandle()-
public int getX()-
public void setX(int newX)-
newX
- - the new x coordinate.public int getY()-
public void setY(int newY)-
newY
- - the new y coordinate.public int getZ()-
public void setZ(int newZ)-
newZ
- - the new z coordinate.public ChunkPosition toPosition()-
public int compareTo(WrappedChunkCoordinate other)-
compareTo
in interface java.lang.Comparable<WrappedChunkCoordinate>
public boolean equals(java.lang.Object other)-
equals
in class java.lang.Object
public int hashCode()-
hashCode
in class java.lang.Object
public class WrappedDataWatcher -extends java.lang.Object -implements java.lang.Iterable<WrappedWatchableObject>-
Modifier and Type | -Field and Description | -
---|---|
protected java.lang.Object |
-handle |
-
Constructor and Description | -
---|
WrappedDataWatcher()
-Initialize a new data watcher.
- |
-
WrappedDataWatcher(java.util.List<WrappedWatchableObject> watchableObjects)
-Create a new data watcher for a list of watchable objects.
- |
-
WrappedDataWatcher(java.lang.Object handle)
-Create a wrapper for a given data watcher.
- |
-
Modifier and Type | -Method and Description | -
---|---|
WrappedDataWatcher |
-deepClone()
-Clone the content of the current DataWatcher.
- |
-
boolean |
-equals(java.lang.Object obj) |
-
java.lang.Byte |
-getByte(int index)
-Get a watched byte.
- |
-
WrappedChunkCoordinate |
-getChunkCoordinate(int index)
-Get a watched string.
- |
-
static WrappedDataWatcher |
-getEntityWatcher(org.bukkit.entity.Entity entity)
-Retrieve the data watcher associated with an entity.
- |
-
java.lang.Float |
-getFloat(int index)
-Get a watched float.
- |
-
java.lang.Object |
-getHandle()
-Retrieves the underlying data watcher.
- |
-
java.lang.Integer |
-getInteger(int index)
-Get a watched integer.
- |
-
org.bukkit.inventory.ItemStack |
-getItemStack(int index)
-Get a watched string.
- |
-
java.lang.Object |
-getObject(int index)
-Retrieve a watchable object by index.
- |
-
protected java.util.concurrent.locks.ReadWriteLock |
-getReadWriteLock()
-Retrieve the current read write lock.
- |
-
java.lang.Short |
-getShort(int index)
-Get a watched short.
- |
-
java.lang.String |
-getString(int index)
-Get a watched string.
- |
-
static java.lang.Class<?> |
-getTypeClass(int id)
-Retrieve the type of a given ID, if it's allowed to be watched.
- |
-
static java.lang.Integer |
-getTypeID(java.lang.Class<?> clazz)
-Retrieve the ID of a given type, if it's allowed to be watched.
- |
-
protected java.util.Map<java.lang.Integer,java.lang.Object> |
-getWatchableObjectMap()
-Retrieve the underlying map of key values that stores watchable objects.
- |
-
java.util.List<WrappedWatchableObject> |
-getWatchableObjects()
-Retrieve every watchable object in this watcher.
- |
-
int |
-hashCode() |
-
java.util.Set<java.lang.Integer> |
-indexSet()
-Retrieve a copy of every index associated with a watched object.
- |
-
java.util.Iterator<WrappedWatchableObject> |
-iterator() |
-
WrappedWatchableObject |
-removeObject(int index)
-Remove a given object from the underlying DataWatcher.
- |
-
void |
-setObject(int index,
- java.lang.Object newValue)
-Set a watched byte.
- |
-
void |
-setObject(int index,
- java.lang.Object newValue,
- boolean update)
-Set a watched byte.
- |
-
int |
-size()
-Retrieve the number of watched objects.
- |
-
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
public WrappedDataWatcher()-
FieldAccessException
- If we're unable to wrap a DataWatcher.public WrappedDataWatcher(java.lang.Object handle)-
handle
- - the data watcher to wrap.FieldAccessException
- If we're unable to wrap a DataWatcher.public WrappedDataWatcher(java.util.List<WrappedWatchableObject> watchableObjects) - throws FieldAccessException-
- Note that the watchable objects are not cloned, and will be modified in place. Use "deepClone" if - that is not desirable. -
- The removeObject(int)
method will not modify the given list, however.
watchableObjects
- - list of watchable objects that will be copied.FieldAccessException
- Unable to read watchable objects.public java.lang.Object getHandle()-
public static java.lang.Integer getTypeID(java.lang.Class<?> clazz) - throws FieldAccessException-
FieldAccessException
- If we cannot initialize the reflection machinery.public static java.lang.Class<?> getTypeClass(int id) - throws FieldAccessException-
FieldAccessException
- If we cannot initialize the reflection machinery.public java.lang.Byte getByte(int index) - throws FieldAccessException-
index
- - index of the watched byte.FieldAccessException
- Cannot read underlying field.public java.lang.Short getShort(int index) - throws FieldAccessException-
index
- - index of the watched short.FieldAccessException
- Cannot read underlying field.public java.lang.Integer getInteger(int index) - throws FieldAccessException-
index
- - index of the watched integer.FieldAccessException
- Cannot read underlying field.public java.lang.Float getFloat(int index) - throws FieldAccessException-
index
- - index of the watched float.FieldAccessException
- Cannot read underlying field.public java.lang.String getString(int index) - throws FieldAccessException-
index
- - index of the watched string.FieldAccessException
- Cannot read underlying field.public org.bukkit.inventory.ItemStack getItemStack(int index) - throws FieldAccessException-
index
- - index of the watched string.FieldAccessException
- Cannot read underlying field.public WrappedChunkCoordinate getChunkCoordinate(int index) - throws FieldAccessException-
index
- - index of the watched string.FieldAccessException
- Cannot read underlying field.public java.lang.Object getObject(int index) - throws FieldAccessException-
index
- - index of the object to retrieve.FieldAccessException
- Cannot read underlying field.public java.util.List<WrappedWatchableObject> getWatchableObjects() - throws FieldAccessException-
FieldAccessException
- If reflection failed.public boolean equals(java.lang.Object obj)-
equals
in class java.lang.Object
public int hashCode()-
hashCode
in class java.lang.Object
public java.util.Set<java.lang.Integer> indexSet() - throws FieldAccessException-
FieldAccessException
- If we're unable to read the underlying object.public WrappedDataWatcher deepClone()-
public int size() - throws FieldAccessException-
FieldAccessException
- If we're unable to read the underlying object.public WrappedWatchableObject removeObject(int index)-
index
- - index of the object to remove.public void setObject(int index, - java.lang.Object newValue) - throws FieldAccessException-
index
- - index of the watched byte.newValue
- - the new watched value.FieldAccessException
- Cannot read underlying field.public void setObject(int index, - java.lang.Object newValue, - boolean update) - throws FieldAccessException-
index
- - index of the watched byte.newValue
- - the new watched value.update
- - whether or not to refresh every listening clients.FieldAccessException
- Cannot read underlying field.protected java.util.concurrent.locks.ReadWriteLock getReadWriteLock() - throws FieldAccessException-
FieldAccessException
- If we're unable to read the underlying field.protected java.util.Map<java.lang.Integer,java.lang.Object> getWatchableObjectMap() - throws FieldAccessException-
FieldAccessException
- If we don't have permission to perform reflection.public static WrappedDataWatcher getEntityWatcher(org.bukkit.entity.Entity entity) - throws FieldAccessException-
entity
- - the entity to read from.FieldAccessException
- Reflection failed.public java.util.Iterator<WrappedWatchableObject> iterator()-
iterator
in interface java.lang.Iterable<WrappedWatchableObject>
public class WrappedWatchableObject
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
protected java.lang.Object |
-handle |
-
protected StructureModifier<java.lang.Object> |
-modifier |
-
Constructor and Description | -
---|
WrappedWatchableObject(int index,
- java.lang.Object value)
-Construct a watchable object from an index and a given value.
- |
-
WrappedWatchableObject(java.lang.Object handle)
-Wrap a given raw Minecraft watchable object.
- |
-
Modifier and Type | -Method and Description | -
---|---|
WrappedWatchableObject |
-deepClone()
-Clone the current wrapped watchable object, along with any contained objects.
- |
-
boolean |
-equals(java.lang.Object obj) |
-
boolean |
-getDirtyState()
-Retrieve whether or not the value must be synchronized with the client.
- |
-
java.lang.Object |
-getHandle()
-Retrieves the underlying watchable object.
- |
-
int |
-getIndex()
-Retrieve the index of this watchable object.
- |
-
java.lang.Class<?> |
-getType()
-Retrieve the correct super type of the current value.
- |
-
int |
-getTypeID()
-Retrieve the type ID of a watchable object.
- |
-
java.lang.Object |
-getValue()
-Read the value field.
- |
-
int |
-hashCode() |
-
void |
-setDirtyState(boolean dirty)
-Set whether or not the value must be synchronized with the client.
- |
-
void |
-setIndex(int index)
-Set the the index of this watchable object.
- |
-
void |
-setTypeID(int id)
-Set the type ID of a watchable object.
- |
-
void |
-setValue(java.lang.Object newValue)
-Update the value field.
- |
-
void |
-setValue(java.lang.Object newValue,
- boolean updateClient)
-Update the value field.
- |
-
java.lang.String |
-toString() |
-
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
protected java.lang.Object handle-
protected StructureModifier<java.lang.Object> modifier-
public WrappedWatchableObject(java.lang.Object handle)-
handle
- - the raw watchable object to wrap.public WrappedWatchableObject(int index, - java.lang.Object value)-
index
- - the index.value
- - non-null value of specific types.public java.lang.Object getHandle()-
public java.lang.Class<?> getType() - throws FieldAccessException-
FieldAccessException
- Unable to read values.public int getIndex() - throws FieldAccessException-
FieldAccessException
- Reflection failed.public void setIndex(int index) - throws FieldAccessException-
index
- - the new object index.FieldAccessException
- Reflection failed.public int getTypeID() - throws FieldAccessException-
FieldAccessException
- Reflection failed.public void setTypeID(int id) - throws FieldAccessException-
id
- - the new ID.FieldAccessException
- Reflection failed.public void setValue(java.lang.Object newValue) - throws FieldAccessException-
newValue
- - new value.FieldAccessException
- Unable to use reflection.public void setValue(java.lang.Object newValue, - boolean updateClient) - throws FieldAccessException-
newValue
- - new value.updateClient
- - whether or not to update listening clients.FieldAccessException
- Unable to use reflection.public java.lang.Object getValue() - throws FieldAccessException-
FieldAccessException
- Unable to use reflection.public void setDirtyState(boolean dirty) - throws FieldAccessException-
dirty
- - TRUE if the value should be synchronized, FALSE otherwise.FieldAccessException
- Unable to use reflection.public boolean getDirtyState() - throws FieldAccessException-
FieldAccessException
- Unable to use reflection.public WrappedWatchableObject deepClone() - throws FieldAccessException-
FieldAccessException
- If we're unable to use reflection.public boolean equals(java.lang.Object obj)-
equals
in class java.lang.Object
public int hashCode()-
hashCode
in class java.lang.Object
public java.lang.String toString()-
toString
in class java.lang.Object
Package | -Description | -
---|---|
com.comphenix.protocol.events | -- |
com.comphenix.protocol.wrappers | -- |
Modifier and Type | -Method and Description | -
---|---|
StructureModifier<java.util.List<ChunkPosition>> |
-PacketContainer.getPositionCollectionModifier()
-Retrieves a read/write structure for collections of chunk positions.
- |
-
StructureModifier<ChunkPosition> |
-PacketContainer.getPositionModifier()
-Retrieves a read/write structure for chunk positions.
- |
-
Modifier and Type | -Field and Description | -
---|---|
static ChunkPosition |
-ChunkPosition.ORIGIN
-Represents the null (0, 0, 0) origin.
- |
-
Modifier and Type | -Method and Description | -
---|---|
ChunkPosition |
-ChunkPosition.add(ChunkPosition other)
-Adds the current position and a given position together, producing a result position.
- |
-
ChunkPosition |
-ChunkPosition.divide(int divisor)
-Divide each dimension in the current position by the given divisor.
- |
-
ChunkPosition |
-ChunkPosition.multiply(int factor)
-Multiply each dimension in the current position by the given factor.
- |
-
ChunkPosition |
-ChunkPosition.subtract(ChunkPosition other)
-Adds the current position and a given position together, producing a result position.
- |
-
ChunkPosition |
-WrappedChunkCoordinate.toPosition()
-Create an immutable chunk position from this coordinate.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static EquivalentConverter<ChunkPosition> |
-ChunkPosition.getConverter()
-Used to convert between NMS ChunkPosition and the wrapper instance.
- |
-
Modifier and Type | -Method and Description | -
---|---|
ChunkPosition |
-ChunkPosition.add(ChunkPosition other)
-Adds the current position and a given position together, producing a result position.
- |
-
ChunkPosition |
-ChunkPosition.subtract(ChunkPosition other)
-Adds the current position and a given position together, producing a result position.
- |
-
Constructor and Description | -
---|
WrappedChunkCoordinate(ChunkPosition position)
-Create a chunk coordinate wrapper from a given position.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.wrappers | -- |
Modifier and Type | -Method and Description | -
---|---|
WrappedChunkCoordinate |
-WrappedDataWatcher.getChunkCoordinate(int index)
-Get a watched string.
- |
-
Modifier and Type | -Method and Description | -
---|---|
int |
-WrappedChunkCoordinate.compareTo(WrappedChunkCoordinate other) |
-
Package | -Description | -
---|---|
com.comphenix.protocol.events | -- |
com.comphenix.protocol.wrappers | -- |
Modifier and Type | -Method and Description | -
---|---|
StructureModifier<WrappedDataWatcher> |
-PacketContainer.getDataWatcherModifier()
-Retrieves a read/write structure for data watchers.
- |
-
Modifier and Type | -Method and Description | -
---|---|
WrappedDataWatcher |
-WrappedDataWatcher.deepClone()
-Clone the content of the current DataWatcher.
- |
-
static WrappedDataWatcher |
-WrappedDataWatcher.getEntityWatcher(org.bukkit.entity.Entity entity)
-Retrieve the data watcher associated with an entity.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static EquivalentConverter<WrappedDataWatcher> |
-BukkitConverters.getDataWatcherConverter()
-Retrieve a converter for the NMS DataWatcher class and our wrapper.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.events | -- |
com.comphenix.protocol.wrappers | -- |
Modifier and Type | -Method and Description | -
---|---|
StructureModifier<java.util.List<WrappedWatchableObject>> |
-PacketContainer.getWatchableCollectionModifier()
-Retrieves a read/write structure for collections of watchable objects.
- |
-
Modifier and Type | -Method and Description | -
---|---|
WrappedWatchableObject |
-WrappedWatchableObject.deepClone()
-Clone the current wrapped watchable object, along with any contained objects.
- |
-
WrappedWatchableObject |
-WrappedDataWatcher.removeObject(int index)
-Remove a given object from the underlying DataWatcher.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static EquivalentConverter<WrappedWatchableObject> |
-BukkitConverters.getWatchableObjectConverter()
-Retrieve a converter for watchable objects and the respective wrapper.
- |
-
java.util.List<WrappedWatchableObject> |
-WrappedDataWatcher.getWatchableObjects()
-Retrieve every watchable object in this watcher.
- |
-
java.util.Iterator<WrappedWatchableObject> |
-WrappedDataWatcher.iterator() |
-
Constructor and Description | -
---|
WrappedDataWatcher(java.util.List<WrappedWatchableObject> watchableObjects)
-Create a new data watcher for a list of watchable objects.
- |
-
TType
- - type of the value that is stored.public interface NbtBase<TType>
-
- Use NbtFactory
to load or create an instance.
Modifier and Type | -Method and Description | -
---|---|
boolean |
-accept(NbtVisitor visitor)
-Accepts a NBT visitor.
- |
-
NbtBase<TType> |
-deepClone()
-Clone the current NBT tag.
- |
-
java.lang.String |
-getName()
-Retrieve the name of this NBT tag.
- |
-
NbtType |
-getType()
-Retrieve the type of this NBT element.
- |
-
TType |
-getValue()
-Retrieve the value of this NBT tag.
- |
-
void |
-setName(java.lang.String name)
-Set the name of this NBT tag.
- |
-
void |
-setValue(TType newValue)
-Set the value of this NBT tag.
- |
-
boolean accept(NbtVisitor visitor)-
visitor
- - the hierarchical NBT visitor.NbtType getType()-
java.lang.String getName()-
- This will be an empty string if the NBT tag is stored in a list.
void setName(java.lang.String name)-
- This will be ignored if the NBT tag is stored in a list.
name
- - name of the tag.TType getValue()-
- Is either a primitive wrapper
, String
,
- List
or a Map
.
-
- Users are encouraged to cast an NBT compound to NbtCompound
and use its put and get-methods
- instead of accessing its content from getValue().
-
- All operations that modify collections directly, such as List.add(Object)
or
- Map.clear()
, are considered optional. This also include members in Iterator
and
- ListIterator
. Operations that are not implemented throw a
- UnsupportedOperationException
.
void setValue(TType newValue)-
newValue
- - the new value of this tag.public interface NbtCompound -extends NbtBase<java.util.Map<java.lang.String,NbtBase<?>>>, java.lang.Iterable<NbtBase<?>>-
- Use NbtFactory
to load or create an instance.
-
- The NbtBase.getValue()
method returns a Map
that will return the full content
- of this NBT compound, but may throw an UnsupportedOperationException
for any of the write operations.
Modifier and Type | -Method and Description | -
---|---|
boolean |
-containsKey(java.lang.String key)
-Determine if an entry with the given key exists or not.
- |
-
byte |
-getByte(java.lang.String key)
-Retrieve the byte value of an entry identified by a given key.
- |
-
byte[] |
-getByteArray(java.lang.String key)
-Retrieve the byte array value of an entry identified by a given key.
- |
-
byte |
-getByteOrDefault(java.lang.String key)
-Retrieve the byte value of an existing entry, or from a new default entry if it doesn't exist.
- |
-
NbtCompound |
-getCompound(java.lang.String key)
-Retrieve the compound (map) value of an entry identified by a given key.
- |
-
NbtCompound |
-getCompoundOrDefault(java.lang.String key)
-Retrieve a compound (map) value by its key, or create a new compound if it doesn't exist.
- |
-
double |
-getDouble(java.lang.String key)
-Retrieve the double value of an entry identified by a given key.
- |
-
double |
-getDoubleOrDefault(java.lang.String key)
-Retrieve the double value of an existing entry, or from a new default entry if it doesn't exist.
- |
-
float |
-getFloat(java.lang.String key)
-Retrieve the float value of an entry identified by a given key.
- |
-
float |
-getFloatOrDefault(java.lang.String key)
-Retrieve the float value of an existing entry, or from a new default entry if it doesn't exist.
- |
-
int |
-getInteger(java.lang.String key)
-Retrieve the integer value of an entry identified by a given key.
- |
-
int[] |
-getIntegerArray(java.lang.String key)
-Retrieve the integer array value of an entry identified by a given key.
- |
-
int |
-getIntegerOrDefault(java.lang.String key)
-Retrieve the integer value of an existing entry, or from a new default entry if it doesn't exist.
- |
-
java.util.Set<java.lang.String> |
-getKeys()
-Retrieve a Set view of the keys of each entry in this compound.
- |
-
<T> NbtList<T> |
-getList(java.lang.String key)
-Retrieve the NBT list value of an entry identified by a given key.
- |
-
<T> NbtList<T> |
-getListOrDefault(java.lang.String key)
-Retrieve a NBT list value by its key, or create a new list if it doesn't exist.
- |
-
long |
-getLong(java.lang.String key)
-Retrieve the long value of an entry identified by a given key.
- |
-
long |
-getLongOrDefault(java.lang.String key)
-Retrieve the long value of an existing entry, or from a new default entry if it doesn't exist.
- |
-
java.lang.Object |
-getObject(java.lang.String key)
-Retrieve the primitive object, NbtList or NbtCompound associated with the given key.
- |
-
java.lang.Short |
-getShort(java.lang.String key)
-Retrieve the short value of an entry identified by a given key.
- |
-
short |
-getShortOrDefault(java.lang.String key)
-Retrieve the short value of an existing entry, or from a new default entry if it doesn't exist.
- |
-
java.lang.String |
-getString(java.lang.String key)
-Retrieve the string value of an entry identified by a given key.
- |
-
java.lang.String |
-getStringOrDefault(java.lang.String key)
-Retrieve the string value of an existing entry, or from a new default entry if it doesn't exist.
- |
-
java.util.Map<java.lang.String,NbtBase<?>> |
-getValue()
-Deprecated.
- |
-
<T> NbtBase<T> |
-getValue(java.lang.String key)
-Retrieve the value of a given entry.
- |
-
NbtBase<?> |
-getValueOrDefault(java.lang.String key,
- NbtType type)
-Retrieve a value by its key, or assign and return a new NBT element if it doesn't exist.
- |
-
java.util.Iterator<NbtBase<?>> |
-iterator()
-Retrieve an iterator view of the NBT tags stored in this compound.
- |
-
<T> NbtCompound |
-put(NbtBase<T> entry)
-Set a entry based on its name.
- |
-
NbtCompound |
-put(NbtCompound compound)
-Associate a NBT compound with its name as key.
- |
-
<T> NbtCompound |
-put(NbtList<T> list)
-Associate a NBT list with the given key.
- |
-
NbtCompound |
-put(java.lang.String key,
- byte value)
-Associate a NBT byte value with the given key.
- |
-
NbtCompound |
-put(java.lang.String key,
- byte[] value)
-Associate a NBT byte array value with the given key.
- |
-
<T> NbtCompound |
-put(java.lang.String key,
- java.util.Collection<? extends NbtBase<T>> list)
-Associate a new NBT list with the given key.
- |
-
NbtCompound |
-put(java.lang.String key,
- double value)
-Associate a NBT double value with the given key.
- |
-
NbtCompound |
-put(java.lang.String key,
- float value)
-Associate a NBT float value with the given key.
- |
-
NbtCompound |
-put(java.lang.String key,
- int value)
-Associate a NBT integer value with the given key.
- |
-
NbtCompound |
-put(java.lang.String key,
- int[] value)
-Associate a NBT integer array value with the given key.
- |
-
NbtCompound |
-put(java.lang.String key,
- long value)
-Associate a NBT long value with the given key.
- |
-
NbtCompound |
-put(java.lang.String key,
- NbtBase<?> entry)
-Inserts an entry after cloning it and renaming it to "key".
- |
-
NbtCompound |
-put(java.lang.String key,
- short value)
-Associate a NBT short value with the given key.
- |
-
NbtCompound |
-put(java.lang.String key,
- java.lang.String value)
-Associate a NBT string value with the given key.
- |
-
NbtCompound |
-putObject(java.lang.String key,
- java.lang.Object value)
-Associates a given Java primitive value, list, map or NbtBase> with a certain key.
- |
-
<T> NbtBase<?> |
-remove(java.lang.String key)
-Remove the NBT element that is associated with the given key.
- |
-
@Deprecated -java.util.Map<java.lang.String,NbtBase<?>> getValue()-
NbtBase
- Is either a primitive wrapper
, String
,
- List
or a Map
.
-
- Users are encouraged to cast an NBT compound to NbtCompound
and use its put and get-methods
- instead of accessing its content from getValue().
-
- All operations that modify collections directly, such as List.add(Object)
or
- Map.clear()
, are considered optional. This also include members in Iterator
and
- ListIterator
. Operations that are not implemented throw a
- UnsupportedOperationException
.
boolean containsKey(java.lang.String key)-
key
- - the key to lookup.java.util.Set<java.lang.String> getKeys()-
<T> NbtBase<T> getValue(java.lang.String key)-
key
- - key of the entry to retrieve.NbtBase<?> getValueOrDefault(java.lang.String key, - NbtType type)-
key
- - the key of the entry to find or create.type
- - the NBT element we will create if not found.<T> NbtCompound put(@Nonnull - NbtBase<T> entry)-
entry
- - entry with a name and value.java.lang.IllegalArgumentException
- If entry is NULL.java.lang.String getString(java.lang.String key)-
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.java.lang.String getStringOrDefault(java.lang.String key)-
key
- - the key of the entry.NbtCompound put(java.lang.String key, - java.lang.String value)-
key
- - the key and NBT name.value
- - the value.NbtCompound put(java.lang.String key, - NbtBase<?> entry)-
key
- - the name of the entry.entry
- - the entry to insert.byte getByte(java.lang.String key)-
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.byte getByteOrDefault(java.lang.String key)-
key
- - the key of the entry.NbtCompound put(java.lang.String key, - byte value)-
key
- - the key and NBT name.value
- - the value.java.lang.Short getShort(java.lang.String key)-
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.short getShortOrDefault(java.lang.String key)-
key
- - the key of the entry.NbtCompound put(java.lang.String key, - short value)-
key
- - the key and NBT name.value
- - the value.int getInteger(java.lang.String key)-
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.int getIntegerOrDefault(java.lang.String key)-
key
- - the key of the entry.NbtCompound put(java.lang.String key, - int value)-
key
- - the key and NBT name.value
- - the value.long getLong(java.lang.String key)-
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.long getLongOrDefault(java.lang.String key)-
key
- - the key of the entry.NbtCompound put(java.lang.String key, - long value)-
key
- - the key and NBT name.value
- - the value.float getFloat(java.lang.String key)-
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.float getFloatOrDefault(java.lang.String key)-
key
- - the key of the entry.NbtCompound put(java.lang.String key, - float value)-
key
- - the key and NBT name.value
- - the value.double getDouble(java.lang.String key)-
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.double getDoubleOrDefault(java.lang.String key)-
key
- - the key of the entry.NbtCompound put(java.lang.String key, - double value)-
key
- - the key and NBT name.value
- - the value.byte[] getByteArray(java.lang.String key)-
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.NbtCompound put(java.lang.String key, - byte[] value)-
key
- - the key and NBT name.value
- - the value.int[] getIntegerArray(java.lang.String key)-
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.NbtCompound put(java.lang.String key, - int[] value)-
key
- - the key and NBT name.value
- - the value.NbtCompound putObject(java.lang.String key, - java.lang.Object value)-
- If the value is NULL, the corresponding key is removed. Any Map or List will be converted - to a corresponding NbtCompound or NbtList.
key
- - the name of the new entry,value
- - the value of the new entry, or NULL to remove the current value.java.lang.Object getObject(java.lang.String key)-
key
- - the key of the object to find.NbtCompound getCompound(java.lang.String key)-
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.NbtCompound getCompoundOrDefault(java.lang.String key)-
key
- - the key of the entry to find or create.NbtCompound put(NbtCompound compound)-
compound
- - the compound value.<T> NbtList<T> getList(java.lang.String key)-
key
- - the key of the entry.java.lang.IllegalArgumentException
- If the key doesn't exist.<T> NbtList<T> getListOrDefault(java.lang.String key)-
key
- - the key of the entry to find or create.<T> NbtCompound put(NbtList<T> list)-
list
- - the list value.<T> NbtCompound put(java.lang.String key, - java.util.Collection<? extends NbtBase<T>> list)-
key
- - the key and name of the new NBT list.list
- - the list of NBT elements.<T> NbtBase<?> remove(java.lang.String key)-
key
- - the key of the element to remove.TValue
- - the value of the tag.public static class NbtCompoundTest.NbtCustomTag<TValue> -extends java.lang.Object -implements NbtBase<TValue>-
Constructor and Description | -
---|
NbtCompoundTest.NbtCustomTag(java.lang.String name,
- TValue value) |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-accept(NbtVisitor visitor)
-Accepts a NBT visitor.
- |
-
NbtBase<TValue> |
-deepClone()
-Clone the current NBT tag.
- |
-
java.lang.String |
-getName()
-Retrieve the name of this NBT tag.
- |
-
NbtType |
-getType()
-Retrieve the type of this NBT element.
- |
-
TValue |
-getValue()
-Retrieve the value of this NBT tag.
- |
-
void |
-setName(java.lang.String name)
-Set the name of this NBT tag.
- |
-
void |
-setValue(TValue newValue)
-Set the value of this NBT tag.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public NbtCompoundTest.NbtCustomTag(java.lang.String name, - TValue value)-
public NbtType getType()-
NbtBase
public java.lang.String getName()-
NbtBase
- This will be an empty string if the NBT tag is stored in a list.
public void setName(java.lang.String name)-
NbtBase
- This will be ignored if the NBT tag is stored in a list.
public TValue getValue()-
NbtBase
- Is either a primitive wrapper
, String
,
- List
or a Map
.
-
- Users are encouraged to cast an NBT compound to NbtCompound
and use its put and get-methods
- instead of accessing its content from getValue().
-
- All operations that modify collections directly, such as List.add(Object)
or
- Map.clear()
, are considered optional. This also include members in Iterator
and
- ListIterator
. Operations that are not implemented throw a
- UnsupportedOperationException
.
public void setValue(TValue newValue)-
NbtBase
public NbtBase<TValue> deepClone()-
NbtBase
public boolean accept(NbtVisitor visitor)-
NbtBase
public class NbtCompoundTest
-extends java.lang.Object
-Modifier and Type | -Class and Description | -
---|---|
static class |
-NbtCompoundTest.NbtCustomTag<TValue>
-Represents a custom NBT tag.
- |
-
Constructor and Description | -
---|
NbtCompoundTest() |
-
Modifier and Type | -Method and Description | -
---|---|
static void |
-initializeBukkit() |
-
void |
-testCustomTags() |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public class NbtFactory
-extends java.lang.Object
-Constructor and Description | -
---|
NbtFactory() |
-
Modifier and Type | -Method and Description | -
---|---|
static NbtCompound |
-asCompound(NbtBase<?> tag)
-Attempt to cast this NBT tag as a compund.
- |
-
static NbtList<?> |
-asList(NbtBase<?> tag)
-Attempt to cast this NBT tag as a list.
- |
-
static <T> NbtWrapper<T> |
-fromBase(NbtBase<T> base)
-Get a NBT wrapper from a NBT base.
- |
-
static NbtWrapper<?> |
-fromItemTag(org.bukkit.inventory.ItemStack stack)
-Construct a wrapper for an NBT tag stored (in memory) in an item stack.
- |
-
static <T> NbtWrapper<T> |
-fromNMS(java.lang.Object handle)
-Initialize a NBT wrapper.
- |
-
static NbtBase<java.lang.Byte> |
-of(java.lang.String name,
- byte value)
-Constructs a NBT tag of type byte.
- |
-
static NbtBase<byte[]> |
-of(java.lang.String name,
- byte[] value)
-Constructs a NBT tag of type byte array.
- |
-
static NbtBase<java.lang.Double> |
-of(java.lang.String name,
- double value)
-Constructs a NBT tag of type double.
- |
-
static NbtBase<java.lang.Float> |
-of(java.lang.String name,
- float value)
-Constructs a NBT tag of type float.
- |
-
static NbtBase<java.lang.Integer> |
-of(java.lang.String name,
- int value)
-Constructs a NBT tag of type int.
- |
-
static NbtBase<int[]> |
-of(java.lang.String name,
- int[] value)
-Constructs a NBT tag of type int array.
- |
-
static NbtBase<java.lang.Long> |
-of(java.lang.String name,
- long value)
-Constructs a NBT tag of type long.
- |
-
static NbtBase<java.lang.Short> |
-of(java.lang.String name,
- short value)
-Constructs a NBT tag of type short.
- |
-
static NbtBase<java.lang.String> |
-of(java.lang.String name,
- java.lang.String value)
-Constructs a NBT tag of type string.
- |
-
static NbtCompound |
-ofCompound(java.lang.String name)
-Construct a new NBT compound wrapper.
- |
-
static NbtCompound |
-ofCompound(java.lang.String name,
- java.util.Collection<? extends NbtBase<?>> list)
-Construct a new NBT compound initialized with a given list of NBT values.
- |
-
static <T> NbtList<T> |
-ofList(java.lang.String name,
- java.util.Collection<? extends T> elements)
-Construct a NBT list of out a list of values.
- |
-
static <T> NbtList<T> |
-ofList(java.lang.String name,
- T... elements)
-Construct a NBT list of out an array of values.
- |
-
static <T> NbtWrapper<T> |
-ofWrapper(java.lang.Class<?> type,
- java.lang.String name,
- T value)
-Create a new NBT wrapper from a given type.
- |
-
static <T> NbtWrapper<T> |
-ofWrapper(NbtType type,
- java.lang.String name)
-Create a new NBT wrapper from a given type.
- |
-
static <T> NbtWrapper<T> |
-ofWrapper(NbtType type,
- java.lang.String name,
- T value)
-Create a new NBT wrapper from a given type.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static NbtCompound asCompound(NbtBase<?> tag)-
tag
- - the NBT tag to cast.java.lang.UnsupportedOperationException
- If this is not a compound.public static NbtList<?> asList(NbtBase<?> tag)-
tag
- - the NBT tag to cast.java.lang.UnsupportedOperationException
- If this is not a list.public static <T> NbtWrapper<T> fromBase(NbtBase<T> base)-
- This may clone the content if the NbtBase is not a NbtWrapper.
base
- - the base class.public static NbtWrapper<?> fromItemTag(org.bukkit.inventory.ItemStack stack)-
- The item stack must be a wrapper for a CraftItemStack. Use
- MinecraftReflection.getBukkitItemStack(ItemStack)
if not.
stack
- - the item stack.public static <T> NbtWrapper<T> fromNMS(java.lang.Object handle)-
handle
- - the underlying net.minecraft.server object to wrap.public static NbtBase<java.lang.String> of(java.lang.String name, - java.lang.String value)-
name
- - name of the tag.value
- - value of the tag.public static NbtBase<java.lang.Byte> of(java.lang.String name, - byte value)-
name
- - name of the tag.value
- - value of the tag.public static NbtBase<java.lang.Short> of(java.lang.String name, - short value)-
name
- - name of the tag.value
- - value of the tag.public static NbtBase<java.lang.Integer> of(java.lang.String name, - int value)-
name
- - name of the tag.value
- - value of the tag.public static NbtBase<java.lang.Long> of(java.lang.String name, - long value)-
name
- - name of the tag.value
- - value of the tag.public static NbtBase<java.lang.Float> of(java.lang.String name, - float value)-
name
- - name of the tag.value
- - value of the tag.public static NbtBase<java.lang.Double> of(java.lang.String name, - double value)-
name
- - name of the tag.value
- - value of the tag.public static NbtBase<byte[]> of(java.lang.String name, - byte[] value)-
name
- - name of the tag.value
- - value of the tag.public static NbtBase<int[]> of(java.lang.String name, - int[] value)-
name
- - name of the tag.value
- - value of the tag.public static NbtCompound ofCompound(java.lang.String name, - java.util.Collection<? extends NbtBase<?>> list)-
name
- - the name of the compound wrapper.list
- - the list of elements to add.public static NbtCompound ofCompound(java.lang.String name)-
name
- - the name of the compound wrapper.public static <T> NbtList<T> ofList(java.lang.String name, - T... elements)-
name
- - name of this list.elements
- - elements to add.public static <T> NbtList<T> ofList(java.lang.String name, - java.util.Collection<? extends T> elements)-
name
- - name of this list.elements
- - elements to add.public static <T> NbtWrapper<T> ofWrapper(NbtType type, - java.lang.String name)-
type
- - the NBT type.name
- - the name of the NBT tag.FieldAccessException
- If we're unable to create the underlying tag.public static <T> NbtWrapper<T> ofWrapper(NbtType type, - java.lang.String name, - T value)-
type
- - the NBT type.name
- - the name of the NBT tag.value
- - the value of the new tag.FieldAccessException
- If we're unable to create the underlying tag.public static <T> NbtWrapper<T> ofWrapper(java.lang.Class<?> type, - java.lang.String name, - T value)-
type
- - type of the NBT value.name
- - the name of the NBT tag.value
- - the value of the new tag.FieldAccessException
- If we're unable to create the underlying tag.java.lang.IllegalArgumentException
- If the given class type is not valid NBT.public class NbtFactoryTest
-extends java.lang.Object
-Constructor and Description | -
---|
NbtFactoryTest() |
-
Modifier and Type | -Method and Description | -
---|---|
static void |
-initializeBukkit() |
-
void |
-testFromStream() |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
TType
- - the value type of each NBT tag.public interface NbtList<TType> -extends NbtBase<java.util.List<NbtBase<TType>>>, java.lang.Iterable<TType>-
- Use NbtFactory
to load or create an instance.
-
- The NbtBase.getValue()
method returns a List
that will correctly return the content
- of this NBT list, but may throw an UnsupportedOperationException
for any of the write operations.
Modifier and Type | -Field and Description | -
---|---|
static java.lang.String |
-EMPTY_NAME
-The name of every NBT tag in a list.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-add(byte value)
-Add a new byte element to the list.
- |
-
void |
-add(byte[] value)
-Add a new byte array element to the list.
- |
-
void |
-add(double value)
-Add a new double element to the list.
- |
-
void |
-add(int value)
-Add a new integer element to the list.
- |
-
void |
-add(int[] value)
-Add a new int array element to the list.
- |
-
void |
-add(long value)
-Add a new long element to the list.
- |
-
void |
-add(NbtBase<TType> element)
-Add a NBT list or NBT compound to the list.
- |
-
void |
-add(short value)
-Add a new short element to the list.
- |
-
void |
-add(java.lang.String value)
-Add a new string element to the list.
- |
-
void |
-addClosest(java.lang.Object value)
-Add a value to a typed list by attempting to convert it to the nearest value.
- |
-
java.util.Collection<NbtBase<TType>> |
-asCollection()
-Retrieve each NBT tag in this list.
- |
-
NbtType |
-getElementType()
-Get the type of each element.
- |
-
TType |
-getValue(int index)
-Retrieve an element by index.
- |
-
java.util.Iterator<TType> |
-iterator()
-Iterate over all the elements in this list.
- |
-
void |
-remove(java.lang.Object remove)
-Remove a given object from the list.
- |
-
void |
-setElementType(NbtType type)
-Set the type of each element.
- |
-
int |
-size()
-Retrieve the number of elements in this list.
- |
-
static final java.lang.String EMPTY_NAME-
NbtType getElementType()-
- This will be TAG_END
if the NBT list has just been created.
void setElementType(NbtType type)-
type
- - type of each element.void addClosest(java.lang.Object value)-
- Note that the list must be typed by setting setElementType(NbtType)
before calling this function.
value
- - the value to add.void add(NbtBase<TType> element)-
element
- void add(java.lang.String value)-
value
- - the string element to add.java.lang.IllegalArgumentException
- If this is not a list of strings.void add(byte value)-
value
- - the byte element to add.java.lang.IllegalArgumentException
- If this is not a list of bytes.void add(short value)-
value
- - the short element to add.java.lang.IllegalArgumentException
- If this is not a list of shorts.void add(int value)-
value
- - the string element to add.java.lang.IllegalArgumentException
- If this is not a list of integers.void add(long value)-
value
- - the string element to add.java.lang.IllegalArgumentException
- If this is not a list of longs.void add(double value)-
value
- - the double element to add.java.lang.IllegalArgumentException
- If this is not a list of doubles.void add(byte[] value)-
value
- - the byte array element to add.java.lang.IllegalArgumentException
- If this is not a list of byte arrays.void add(int[] value)-
value
- - the int array element to add.java.lang.IllegalArgumentException
- If this is not a list of int arrays.void remove(java.lang.Object remove)-
remove
- - the object to remove.TType getValue(int index)-
index
- - index of the element to retrieve.java.lang.IndexOutOfBoundsException
- If the index is out of range (index < 0 || index >= size())int size()-
java.util.Collection<NbtBase<TType>> asCollection()-
Enum Constant and Description | -
---|
TAG_BYTE
-A signed 1 byte integral type.
- |
-
TAG_BYTE_ARRAY
-An array of bytes.
- |
-
TAG_COMPOUND
-A list of fully formed tags, including their IDs, names, and payloads.
- |
-
TAG_DOUBLE
-A signed 8 byte floating point type.
- |
-
TAG_END
-Used to mark the end of compound tags.
- |
-
TAG_FLOAT
-A signed 4 byte floating point type.
- |
-
TAG_INT
-A signed 4 byte integral type.
- |
-
TAG_INT_ARRAY
-An array of TAG_Int's payloads..
- |
-
TAG_LIST
-A list of tag payloads, without repeated tag IDs or any tag names.
- |
-
TAG_LONG
-A signed 8 byte integral type.
- |
-
TAG_SHORT
-A signed 2 byte integral type.
- |
-
TAG_STRING
-A UTF-8 string
- |
-
Modifier and Type | -Method and Description | -
---|---|
int |
-getRawID()
-Retrieves the raw unique integer that identifies the type of the parent NBT element.
- |
-
static NbtType |
-getTypeFromClass(java.lang.Class<?> clazz)
-Retrieve an NBT type from the given Java class.
- |
-
static NbtType |
-getTypeFromID(int rawID)
-Retrieve an NBT type from a given raw ID.
- |
-
java.lang.Class<?> |
-getValueType()
-Retrieves the type of the value stored in the NBT element.
- |
-
boolean |
-isComposite()
-Determine if the given NBT can store multiple children NBT tags.
- |
-
static NbtType |
-valueOf(java.lang.String name)
-Returns the enum constant of this type with the specified name.
- |
-
static NbtType[] |
-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 NbtType TAG_END-
public static final NbtType TAG_BYTE-
public static final NbtType TAG_SHORT-
public static final NbtType TAG_INT-
public static final NbtType TAG_LONG-
public static final NbtType TAG_FLOAT-
public static final NbtType TAG_DOUBLE-
public static final NbtType TAG_BYTE_ARRAY-
public static final NbtType TAG_INT_ARRAY-
public static final NbtType TAG_STRING-
public static final NbtType TAG_LIST-
public static final NbtType TAG_COMPOUND-
public static NbtType[] values()-
-for (NbtType c : NbtType.values()) - System.out.println(c); -
public static NbtType 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 isComposite()-
public int getRawID()-
public java.lang.Class<?> getValueType()-
public static NbtType getTypeFromID(int rawID)-
rawID
- - the raw ID to lookup.public static NbtType getTypeFromClass(java.lang.Class<?> clazz)-
clazz
- - type of the value the NBT type can contain.java.lang.IllegalArgumentException
- If this class type cannot be represented by NBT tags.public interface NbtVisitor
-Modifier and Type | -Method and Description | -
---|---|
boolean |
-visit(NbtBase<?> node)
-Visit a leaf node, which is a NBT tag with a primitive or String value.
- |
-
boolean |
-visitEnter(NbtCompound compound)
-Begin visiting a compound node that contains multiple child nodes of different types.
- |
-
boolean |
-visitEnter(NbtList<?> list)
-Begin visiting a list node that contains multiple child nodes of the same type.
- |
-
boolean |
-visitLeave(NbtCompound compound)
-Stop visiting a compound node.
- |
-
boolean |
-visitLeave(NbtList<?> list)
-Stop visiting a list node.
- |
-
boolean visit(NbtBase<?> node)-
node
- - the visited leaf node.boolean visitEnter(NbtList<?> list)-
list
- - the NBT tag to process.boolean visitEnter(NbtCompound compound)-
compound
- - the NBT tag to process.boolean visitLeave(NbtList<?> list)-
list
- - the list we're done visiting.boolean visitLeave(NbtCompound compound)-
compound
- - the compound we're done visting.TType
- - type of the value that is stored.public interface NbtWrapper<TType> -extends NbtBase<TType>-
- Use NbtFactory
to load or create instances.
java.lang.Object getHandle()-
void write(java.io.DataOutput destination)-
destination
- - the destination stream.Package | -Description | -
---|---|
com.comphenix.protocol.events | -- |
com.comphenix.protocol.wrappers | -- |
com.comphenix.protocol.wrappers.nbt | -- |
com.comphenix.protocol.wrappers.nbt.io | -- |
Modifier and Type | -Method and Description | -
---|---|
StructureModifier<NbtBase<?>> |
-PacketContainer.getNbtModifier()
-Retrieves a read/write structure for NBT classes.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static EquivalentConverter<NbtBase<?>> |
-BukkitConverters.getNbtConverter()
-Retrieve an equivalent converter for net.minecraft.server NBT classes and their wrappers.
- |
-
Modifier and Type | -Interface and Description | -
---|---|
interface |
-NbtCompound
-Represents a mapping of arbitrary NBT elements and their unique names.
- |
-
interface |
-NbtList<TType>
-Represents a list of NBT tags of the same type without names.
- |
-
interface |
-NbtWrapper<TType>
-Indicates that this NBT wraps an underlying net.minecraft.server instance.
- |
-
Modifier and Type | -Class and Description | -
---|---|
static class |
-NbtCompoundTest.NbtCustomTag<TValue>
-Represents a custom NBT tag.
- |
-
Modifier and Type | -Method and Description | -
---|---|
NbtBase<TType> |
-NbtBase.deepClone()
-Clone the current NBT tag.
- |
-
NbtBase<TValue> |
-NbtCompoundTest.NbtCustomTag.deepClone() |
-
<T> NbtBase<T> |
-NbtCompound.getValue(java.lang.String key)
-Retrieve the value of a given entry.
- |
-
NbtBase<?> |
-NbtCompound.getValueOrDefault(java.lang.String key,
- NbtType type)
-Retrieve a value by its key, or assign and return a new NBT element if it doesn't exist.
- |
-
static NbtBase<java.lang.Byte> |
-NbtFactory.of(java.lang.String name,
- byte value)
-Constructs a NBT tag of type byte.
- |
-
static NbtBase<byte[]> |
-NbtFactory.of(java.lang.String name,
- byte[] value)
-Constructs a NBT tag of type byte array.
- |
-
static NbtBase<java.lang.Double> |
-NbtFactory.of(java.lang.String name,
- double value)
-Constructs a NBT tag of type double.
- |
-
static NbtBase<java.lang.Float> |
-NbtFactory.of(java.lang.String name,
- float value)
-Constructs a NBT tag of type float.
- |
-
static NbtBase<java.lang.Integer> |
-NbtFactory.of(java.lang.String name,
- int value)
-Constructs a NBT tag of type int.
- |
-
static NbtBase<int[]> |
-NbtFactory.of(java.lang.String name,
- int[] value)
-Constructs a NBT tag of type int array.
- |
-
static NbtBase<java.lang.Long> |
-NbtFactory.of(java.lang.String name,
- long value)
-Constructs a NBT tag of type long.
- |
-
static NbtBase<java.lang.Short> |
-NbtFactory.of(java.lang.String name,
- short value)
-Constructs a NBT tag of type short.
- |
-
static NbtBase<java.lang.String> |
-NbtFactory.of(java.lang.String name,
- java.lang.String value)
-Constructs a NBT tag of type string.
- |
-
<T> NbtBase<?> |
-NbtCompound.remove(java.lang.String key)
-Remove the NBT element that is associated with the given key.
- |
-
Modifier and Type | -Method and Description | -
---|---|
java.util.Collection<NbtBase<TType>> |
-NbtList.asCollection()
-Retrieve each NBT tag in this list.
- |
-
java.util.Map<java.lang.String,NbtBase<?>> |
-NbtCompound.getValue()
-Deprecated.
- |
-
java.util.Iterator<NbtBase<?>> |
-NbtCompound.iterator()
-Retrieve an iterator view of the NBT tags stored in this compound.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-NbtList.add(NbtBase<TType> element)
-Add a NBT list or NBT compound to the list.
- |
-
static NbtCompound |
-NbtFactory.asCompound(NbtBase<?> tag)
-Attempt to cast this NBT tag as a compund.
- |
-
static NbtList<?> |
-NbtFactory.asList(NbtBase<?> tag)
-Attempt to cast this NBT tag as a list.
- |
-
static <T> NbtWrapper<T> |
-NbtFactory.fromBase(NbtBase<T> base)
-Get a NBT wrapper from a NBT base.
- |
-
<T> NbtCompound |
-NbtCompound.put(NbtBase<T> entry)
-Set a entry based on its name.
- |
-
NbtCompound |
-NbtCompound.put(java.lang.String key,
- NbtBase<?> entry)
-Inserts an entry after cloning it and renaming it to "key".
- |
-
boolean |
-NbtVisitor.visit(NbtBase<?> node)
-Visit a leaf node, which is a NBT tag with a primitive or String value.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static NbtCompound |
-NbtFactory.ofCompound(java.lang.String name,
- java.util.Collection<? extends NbtBase<?>> list)
-Construct a new NBT compound initialized with a given list of NBT values.
- |
-
<T> NbtCompound |
-NbtCompound.put(java.lang.String key,
- java.util.Collection<? extends NbtBase<T>> list)
-Associate a new NBT list with the given key.
- |
-
Modifier and Type | -Method and Description | -
---|---|
<TType> java.lang.String |
-NbtTextSerializer.serialize(NbtBase<TType> value)
-Serialize a NBT tag to a base-64 encoded string.
- |
-
<TType> void |
-NbtConfigurationSerializer.serialize(NbtBase<TType> value,
- org.bukkit.configuration.ConfigurationSection destination)
-Write the content of a NBT tag to a configuration section.
- |
-
<TType> void |
-NbtBinarySerializer.serialize(NbtBase<TType> value,
- java.io.DataOutput destination)
-Write the content of a wrapped NBT tag to a stream.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.wrappers.nbt | -- |
com.comphenix.protocol.wrappers.nbt.io | -- |
Modifier and Type | -Method and Description | -
---|---|
static NbtCompound |
-NbtFactory.asCompound(NbtBase<?> tag)
-Attempt to cast this NBT tag as a compund.
- |
-
NbtCompound |
-NbtCompound.getCompound(java.lang.String key)
-Retrieve the compound (map) value of an entry identified by a given key.
- |
-
NbtCompound |
-NbtCompound.getCompoundOrDefault(java.lang.String key)
-Retrieve a compound (map) value by its key, or create a new compound if it doesn't exist.
- |
-
static NbtCompound |
-NbtFactory.ofCompound(java.lang.String name)
-Construct a new NBT compound wrapper.
- |
-
static NbtCompound |
-NbtFactory.ofCompound(java.lang.String name,
- java.util.Collection<? extends NbtBase<?>> list)
-Construct a new NBT compound initialized with a given list of NBT values.
- |
-
<T> NbtCompound |
-NbtCompound.put(NbtBase<T> entry)
-Set a entry based on its name.
- |
-
NbtCompound |
-NbtCompound.put(NbtCompound compound)
-Associate a NBT compound with its name as key.
- |
-
<T> NbtCompound |
-NbtCompound.put(NbtList<T> list)
-Associate a NBT list with the given key.
- |
-
NbtCompound |
-NbtCompound.put(java.lang.String key,
- byte value)
-Associate a NBT byte value with the given key.
- |
-
NbtCompound |
-NbtCompound.put(java.lang.String key,
- byte[] value)
-Associate a NBT byte array value with the given key.
- |
-
<T> NbtCompound |
-NbtCompound.put(java.lang.String key,
- java.util.Collection<? extends NbtBase<T>> list)
-Associate a new NBT list with the given key.
- |
-
NbtCompound |
-NbtCompound.put(java.lang.String key,
- double value)
-Associate a NBT double value with the given key.
- |
-
NbtCompound |
-NbtCompound.put(java.lang.String key,
- float value)
-Associate a NBT float value with the given key.
- |
-
NbtCompound |
-NbtCompound.put(java.lang.String key,
- int value)
-Associate a NBT integer value with the given key.
- |
-
NbtCompound |
-NbtCompound.put(java.lang.String key,
- int[] value)
-Associate a NBT integer array value with the given key.
- |
-
NbtCompound |
-NbtCompound.put(java.lang.String key,
- long value)
-Associate a NBT long value with the given key.
- |
-
NbtCompound |
-NbtCompound.put(java.lang.String key,
- NbtBase<?> entry)
-Inserts an entry after cloning it and renaming it to "key".
- |
-
NbtCompound |
-NbtCompound.put(java.lang.String key,
- short value)
-Associate a NBT short value with the given key.
- |
-
NbtCompound |
-NbtCompound.put(java.lang.String key,
- java.lang.String value)
-Associate a NBT string value with the given key.
- |
-
NbtCompound |
-NbtCompound.putObject(java.lang.String key,
- java.lang.Object value)
-Associates a given Java primitive value, list, map or NbtBase> with a certain key.
- |
-
Modifier and Type | -Method and Description | -
---|---|
NbtCompound |
-NbtCompound.put(NbtCompound compound)
-Associate a NBT compound with its name as key.
- |
-
boolean |
-NbtVisitor.visitEnter(NbtCompound compound)
-Begin visiting a compound node that contains multiple child nodes of different types.
- |
-
boolean |
-NbtVisitor.visitLeave(NbtCompound compound)
-Stop visiting a compound node.
- |
-
Modifier and Type | -Method and Description | -
---|---|
NbtCompound |
-NbtBinarySerializer.deserializeCompound(java.io.DataInput source)
-Load an NBT compound from a stream.
- |
-
NbtCompound |
-NbtTextSerializer.deserializeCompound(java.lang.String input)
-Deserialize a NBT compound from a base-64 encoded string.
- |
-
NbtCompound |
-NbtConfigurationSerializer.deserializeCompound(org.bukkit.configuration.file.YamlConfiguration root,
- java.lang.String nodeName)
-Read a NBT compound from a root configuration.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.wrappers.nbt | -- |
com.comphenix.protocol.wrappers.nbt.io | -- |
Modifier and Type | -Method and Description | -
---|---|
static NbtList<?> |
-NbtFactory.asList(NbtBase<?> tag)
-Attempt to cast this NBT tag as a list.
- |
-
<T> NbtList<T> |
-NbtCompound.getList(java.lang.String key)
-Retrieve the NBT list value of an entry identified by a given key.
- |
-
<T> NbtList<T> |
-NbtCompound.getListOrDefault(java.lang.String key)
-Retrieve a NBT list value by its key, or create a new list if it doesn't exist.
- |
-
static <T> NbtList<T> |
-NbtFactory.ofList(java.lang.String name,
- java.util.Collection<? extends T> elements)
-Construct a NBT list of out a list of values.
- |
-
static <T> NbtList<T> |
-NbtFactory.ofList(java.lang.String name,
- T... elements)
-Construct a NBT list of out an array of values.
- |
-
Modifier and Type | -Method and Description | -
---|---|
<T> NbtCompound |
-NbtCompound.put(NbtList<T> list)
-Associate a NBT list with the given key.
- |
-
boolean |
-NbtVisitor.visitEnter(NbtList<?> list)
-Begin visiting a list node that contains multiple child nodes of the same type.
- |
-
boolean |
-NbtVisitor.visitLeave(NbtList<?> list)
-Stop visiting a list node.
- |
-
Modifier and Type | -Method and Description | -
---|---|
<T> NbtList<T> |
-NbtBinarySerializer.deserializeList(java.io.DataInput source)
-Load an NBT list from a stream.
- |
-
<T> NbtList<T> |
-NbtTextSerializer.deserializeList(java.lang.String input)
-Deserialize a NBT list from a base-64 encoded string.
- |
-
<T> NbtList<T> |
-NbtConfigurationSerializer.deserializeList(org.bukkit.configuration.file.YamlConfiguration root,
- java.lang.String nodeName)
-Read a NBT compound from a root configuration.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.wrappers.nbt | -- |
com.comphenix.protocol.wrappers.nbt.io | -- |
Modifier and Type | -Method and Description | -
---|---|
NbtType |
-NbtList.getElementType()
-Get the type of each element.
- |
-
NbtType |
-NbtBase.getType()
-Retrieve the type of this NBT element.
- |
-
NbtType |
-NbtCompoundTest.NbtCustomTag.getType() |
-
static NbtType |
-NbtType.getTypeFromClass(java.lang.Class<?> clazz)
-Retrieve an NBT type from the given Java class.
- |
-
static NbtType |
-NbtType.getTypeFromID(int rawID)
-Retrieve an NBT type from a given raw ID.
- |
-
static NbtType |
-NbtType.valueOf(java.lang.String name)
-Returns the enum constant of this type with the specified name.
- |
-
static NbtType[] |
-NbtType.values()
-Returns an array containing the constants of this enum type, in
-the order they are declared.
- |
-
Modifier and Type | -Method and Description | -
---|---|
NbtBase<?> |
-NbtCompound.getValueOrDefault(java.lang.String key,
- NbtType type)
-Retrieve a value by its key, or assign and return a new NBT element if it doesn't exist.
- |
-
static <T> NbtWrapper<T> |
-NbtFactory.ofWrapper(NbtType type,
- java.lang.String name)
-Create a new NBT wrapper from a given type.
- |
-
static <T> NbtWrapper<T> |
-NbtFactory.ofWrapper(NbtType type,
- java.lang.String name,
- T value)
-Create a new NBT wrapper from a given type.
- |
-
void |
-NbtList.setElementType(NbtType type)
-Set the type of each element.
- |
-
Modifier and Type | -Method and Description | -
---|---|
java.lang.Object |
-NbtConfigurationSerializer.toNodeValue(java.lang.Object value,
- NbtType type) |
-
Package | -Description | -
---|---|
com.comphenix.protocol.wrappers.nbt | -- |
Modifier and Type | -Method and Description | -
---|---|
boolean |
-NbtBase.accept(NbtVisitor visitor)
-Accepts a NBT visitor.
- |
-
boolean |
-NbtCompoundTest.NbtCustomTag.accept(NbtVisitor visitor) |
-
Package | -Description | -
---|---|
com.comphenix.protocol.wrappers.nbt | -- |
com.comphenix.protocol.wrappers.nbt.io | -- |
Modifier and Type | -Method and Description | -
---|---|
static <T> NbtWrapper<T> |
-NbtFactory.fromBase(NbtBase<T> base)
-Get a NBT wrapper from a NBT base.
- |
-
static NbtWrapper<?> |
-NbtFactory.fromItemTag(org.bukkit.inventory.ItemStack stack)
-Construct a wrapper for an NBT tag stored (in memory) in an item stack.
- |
-
static <T> NbtWrapper<T> |
-NbtFactory.fromNMS(java.lang.Object handle)
-Initialize a NBT wrapper.
- |
-
static <T> NbtWrapper<T> |
-NbtFactory.ofWrapper(java.lang.Class<?> type,
- java.lang.String name,
- T value)
-Create a new NBT wrapper from a given type.
- |
-
static <T> NbtWrapper<T> |
-NbtFactory.ofWrapper(NbtType type,
- java.lang.String name)
-Create a new NBT wrapper from a given type.
- |
-
static <T> NbtWrapper<T> |
-NbtFactory.ofWrapper(NbtType type,
- java.lang.String name,
- T value)
-Create a new NBT wrapper from a given type.
- |
-
Modifier and Type | -Method and Description | -
---|---|
<TType> NbtWrapper<TType> |
-NbtConfigurationSerializer.deserialize(org.bukkit.configuration.ConfigurationSection root,
- java.lang.String nodeName)
-Read a NBT tag from a root configuration.
- |
-
<TType> NbtWrapper<TType> |
-NbtBinarySerializer.deserialize(java.io.DataInput source)
-Load an NBT tag from a stream.
- |
-
<TType> NbtWrapper<TType> |
-NbtTextSerializer.deserialize(java.lang.String input)
-Deserialize a NBT tag from a base-64 encoded string.
- |
-
public class NbtBinarySerializer
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
static NbtBinarySerializer |
-DEFAULT
-Retrieve a default instance of the NBT binary serializer.
- |
-
Constructor and Description | -
---|
NbtBinarySerializer() |
-
Modifier and Type | -Method and Description | -
---|---|
<TType> NbtWrapper<TType> |
-deserialize(java.io.DataInput source)
-Load an NBT tag from a stream.
- |
-
NbtCompound |
-deserializeCompound(java.io.DataInput source)
-Load an NBT compound from a stream.
- |
-
<T> NbtList<T> |
-deserializeList(java.io.DataInput source)
-Load an NBT list from a stream.
- |
-
<TType> void |
-serialize(NbtBase<TType> value,
- java.io.DataOutput destination)
-Write the content of a wrapped NBT tag to a stream.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final NbtBinarySerializer DEFAULT-
public <TType> void serialize(NbtBase<TType> value, - java.io.DataOutput destination)-
value
- - the NBT tag to write.destination
- - the destination stream.public <TType> NbtWrapper<TType> deserialize(java.io.DataInput source)-
source
- - the input stream.public NbtCompound deserializeCompound(java.io.DataInput source)-
source
- - the input stream.public <T> NbtList<T> deserializeList(java.io.DataInput source)-
source
- - the input stream.public class NbtConfigurationSerializer
-extends java.lang.Object
-- Note that data types may be internally preserved by modifying the serialized name. This may - be visible to the end-user.
Modifier and Type | -Field and Description | -
---|---|
static NbtConfigurationSerializer |
-DEFAULT
-A standard YAML serializer.
- |
-
static java.lang.String |
-TYPE_DELIMITER
-The default delimiter that is used to store the data type in YAML.
- |
-
Constructor and Description | -
---|
NbtConfigurationSerializer()
-Construct a serializer using
-TYPE_DELIMITER as the default delimiter. |
-
NbtConfigurationSerializer(java.lang.String dataTypeDelimiter)
-Construct a serializer using the given value as a delimiter.
- |
-
Modifier and Type | -Method and Description | -
---|---|
<TType> NbtWrapper<TType> |
-deserialize(org.bukkit.configuration.ConfigurationSection root,
- java.lang.String nodeName)
-Read a NBT tag from a root configuration.
- |
-
NbtCompound |
-deserializeCompound(org.bukkit.configuration.file.YamlConfiguration root,
- java.lang.String nodeName)
-Read a NBT compound from a root configuration.
- |
-
<T> NbtList<T> |
-deserializeList(org.bukkit.configuration.file.YamlConfiguration root,
- java.lang.String nodeName)
-Read a NBT compound from a root configuration.
- |
-
java.lang.String |
-getDataTypeDelimiter()
-Retrieve the current data type delimiter.
- |
-
<TType> void |
-serialize(NbtBase<TType> value,
- org.bukkit.configuration.ConfigurationSection destination)
-Write the content of a NBT tag to a configuration section.
- |
-
java.lang.Object |
-toNodeValue(java.lang.Object value,
- NbtType type) |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final java.lang.String TYPE_DELIMITER-
public static final NbtConfigurationSerializer DEFAULT-
public NbtConfigurationSerializer()-
TYPE_DELIMITER
as the default delimiter.public NbtConfigurationSerializer(java.lang.String dataTypeDelimiter)-
dataTypeDelimiter
- - the local data type delimiter.public java.lang.String getDataTypeDelimiter()-
public <TType> void serialize(NbtBase<TType> value, - org.bukkit.configuration.ConfigurationSection destination)-
value
- - the NBT tag to write.destination
- - the destination section.public <TType> NbtWrapper<TType> deserialize(org.bukkit.configuration.ConfigurationSection root, - java.lang.String nodeName)-
root
- - configuration that contains the NBT tag.nodeName
- - name of the NBT tag.public NbtCompound deserializeCompound(org.bukkit.configuration.file.YamlConfiguration root, - java.lang.String nodeName)-
root
- - configuration that contains the NBT compound.nodeName
- - name of the NBT compound.public <T> NbtList<T> deserializeList(org.bukkit.configuration.file.YamlConfiguration root, - java.lang.String nodeName)-
root
- - configuration that contains the NBT compound.nodeName
- - name of the NBT compound.public java.lang.Object toNodeValue(java.lang.Object value, - NbtType type)-
public class NbtConfigurationSerializerTest
-extends java.lang.Object
-Constructor and Description | -
---|
NbtConfigurationSerializerTest() |
-
Modifier and Type | -Method and Description | -
---|---|
static void |
-initializeBukkit() |
-
void |
-testSerialization() |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public class NbtTextSerializer
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
static NbtTextSerializer |
-DEFAULT
-A default instance of this serializer.
- |
-
Constructor and Description | -
---|
NbtTextSerializer() |
-
NbtTextSerializer(NbtBinarySerializer binary)
-Construct a serializer with a custom binary serializer.
- |
-
Modifier and Type | -Method and Description | -
---|---|
<TType> NbtWrapper<TType> |
-deserialize(java.lang.String input)
-Deserialize a NBT tag from a base-64 encoded string.
- |
-
NbtCompound |
-deserializeCompound(java.lang.String input)
-Deserialize a NBT compound from a base-64 encoded string.
- |
-
<T> NbtList<T> |
-deserializeList(java.lang.String input)
-Deserialize a NBT list from a base-64 encoded string.
- |
-
NbtBinarySerializer |
-getBinarySerializer()
-Retrieve the binary serializer that is used.
- |
-
<TType> java.lang.String |
-serialize(NbtBase<TType> value)
-Serialize a NBT tag to a base-64 encoded string.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final NbtTextSerializer DEFAULT-
public NbtTextSerializer()-
public NbtTextSerializer(NbtBinarySerializer binary)-
binary
- - binary serializer.public NbtBinarySerializer getBinarySerializer()-
public <TType> java.lang.String serialize(NbtBase<TType> value)-
value
- - the NBT tag to serialize.public <TType> NbtWrapper<TType> deserialize(java.lang.String input) - throws java.io.IOException-
input
- - the base-64 string.java.io.IOException
- If we are unable to parse the input.public NbtCompound deserializeCompound(java.lang.String input) - throws java.io.IOException-
input
- - the base-64 string.java.io.IOException
- If we are unable to parse the input.public <T> NbtList<T> deserializeList(java.lang.String input) - throws java.io.IOException-
input
- - the base-64 string.java.io.IOException
- If we are unable to parse the input.Package | -Description | -
---|---|
com.comphenix.protocol.wrappers.nbt.io | -- |
Modifier and Type | -Field and Description | -
---|---|
static NbtBinarySerializer |
-NbtBinarySerializer.DEFAULT
-Retrieve a default instance of the NBT binary serializer.
- |
-
Modifier and Type | -Method and Description | -
---|---|
NbtBinarySerializer |
-NbtTextSerializer.getBinarySerializer()
-Retrieve the binary serializer that is used.
- |
-
Constructor and Description | -
---|
NbtTextSerializer(NbtBinarySerializer binary)
-Construct a serializer with a custom binary serializer.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.wrappers.nbt.io | -- |
Modifier and Type | -Field and Description | -
---|---|
static NbtConfigurationSerializer |
-NbtConfigurationSerializer.DEFAULT
-A standard YAML serializer.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.wrappers.nbt.io | -- |
Modifier and Type | -Field and Description | -
---|---|
static NbtTextSerializer |
-NbtTextSerializer.DEFAULT
-A default instance of this serializer.
- |
-
Class | -Description | -
---|---|
NbtBinarySerializer | -- |
NbtConfigurationSerializer | -
- Serialize and deserialize NBT information from a configuration section.
- |
-
NbtConfigurationSerializerTest | -- |
NbtTextSerializer | -
- Serializes NBT to a base-64 encoded string and back.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.wrappers.nbt.io | -- |
Class and Description | -
---|
NbtBinarySerializer | -
NbtConfigurationSerializer
- Serialize and deserialize NBT information from a configuration section.
- |
-
NbtTextSerializer
- Serializes NBT to a base-64 encoded string and back.
- |
-
Interface | -Description | -
---|---|
NbtBase<TType> | -
- Represents a generic container for an NBT element.
- |
-
NbtCompound | -
- Represents a mapping of arbitrary NBT elements and their unique names.
- |
-
NbtList<TType> | -
- Represents a list of NBT tags of the same type without names.
- |
-
NbtVisitor | -
- A visitor that can enumerate a NBT tree structure.
- |
-
NbtWrapper<TType> | -
- Indicates that this NBT wraps an underlying net.minecraft.server instance.
- |
-
Class | -Description | -
---|---|
NbtCompoundTest | -- |
NbtCompoundTest.NbtCustomTag<TValue> | -
- Represents a custom NBT tag.
- |
-
NbtFactory | -
- Factory methods for creating NBT elements, lists and compounds.
- |
-
NbtFactoryTest | -- |
Enum | -Description | -
---|---|
NbtType | -
- Represents all the element types
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.events | -- |
com.comphenix.protocol.wrappers | -- |
com.comphenix.protocol.wrappers.nbt | -- |
com.comphenix.protocol.wrappers.nbt.io | -- |
Class and Description | -
---|
NbtBase
- Represents a generic container for an NBT element.
- |
-
Class and Description | -
---|
NbtBase
- Represents a generic container for an NBT element.
- |
-
Class and Description | -
---|
NbtBase
- Represents a generic container for an NBT element.
- |
-
NbtCompound
- Represents a mapping of arbitrary NBT elements and their unique names.
- |
-
NbtList
- Represents a list of NBT tags of the same type without names.
- |
-
NbtType
- Represents all the element types
- |
-
NbtVisitor
- A visitor that can enumerate a NBT tree structure.
- |
-
NbtWrapper
- Indicates that this NBT wraps an underlying net.minecraft.server instance.
- |
-
Class and Description | -
---|
NbtBase
- Represents a generic container for an NBT element.
- |
-
NbtCompound
- Represents a mapping of arbitrary NBT elements and their unique names.
- |
-
NbtList
- Represents a list of NBT tags of the same type without names.
- |
-
NbtType
- Represents all the element types
- |
-
NbtWrapper
- Indicates that this NBT wraps an underlying net.minecraft.server instance.
- |
-
Class | -Description | -
---|---|
BukkitConverters | -
- Contains several useful equivalent converters for normal Bukkit types.
- |
-
ChunkPosition | -
- Copies a immutable net.minecraft.server.ChunkPosition, which represents a integer 3D vector.
- |
-
TroveWrapper | -
- Wrap a GNU Trove Collection class with an equivalent Java Collection class.
- |
-
WrappedChunkCoordinate | -
- Allows access to a chunk coordinate.
- |
-
WrappedDataWatcher | -
- Wraps a DataWatcher that is used to transmit arbitrary key-value pairs with a given entity.
- |
-
WrappedWatchableObject | -
- Represents a watchable object.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.events | -- |
com.comphenix.protocol.wrappers | -- |
Class and Description | -
---|
ChunkPosition
- Copies a immutable net.minecraft.server.ChunkPosition, which represents a integer 3D vector.
- |
-
WrappedDataWatcher
- Wraps a DataWatcher that is used to transmit arbitrary key-value pairs with a given entity.
- |
-
WrappedWatchableObject
- Represents a watchable object.
- |
-
Class and Description | -
---|
ChunkPosition
- Copies a immutable net.minecraft.server.ChunkPosition, which represents a integer 3D vector.
- |
-
WrappedChunkCoordinate
- Allows access to a chunk coordinate.
- |
-
WrappedDataWatcher
- Wraps a DataWatcher that is used to transmit arbitrary key-value pairs with a given entity.
- |
-
WrappedWatchableObject
- Represents a watchable object.
- |
-
Modifier and Type | -Constant Field | -Value | -
---|---|---|
-
-public static final java.lang.String |
-NAME |
-"filter" |
-
-
-public static final java.lang.String |
-PERMISSION_ADMIN |
-"protocol.admin" |
-
Modifier and Type | -Constant Field | -Value | -
---|---|---|
-
-public static final int |
-MAXIMUM_PACKET_ID |
-255 |
-
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 |
-BLOCK_ITEM_SWITCH |
-16 |
-
-
-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 |
-DISPLAY_SCOREBOARD |
-208 |
-
-
-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 |
-SCOREBOARD_OBJECTIVE |
-206 |
-
-
-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 |
-TEAMS |
-209 |
-
-
-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_SCORE |
-207 |
-
-
-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 int |
-DEFAULT_SENDING_DELTA |
-0 |
-
-
-public static final int |
-DEFAULT_TIMEOUT_DELTA |
-1800000 |
-
Modifier and Type | -Constant Field | -Value | -
---|---|---|
-
-public static final int |
-DEFAULT_MAX_ERROR_COUNT |
-20 |
-
-
-public static final java.lang.String |
-DEFAULT_PREFIX |
-" " |
-
-
-public static final java.lang.String |
-DEFAULT_SUPPORT_URL |
-"http://dev.bukkit.org/server-mods/protocollib/" |
-
-
-public static final java.lang.String |
-ERROR_PERMISSION |
-"protocol.info" |
-
-
-public static final java.lang.String |
-SECOND_LEVEL_PREFIX |
-" " |
-
Modifier and Type | -Constant Field | -Value | -
---|---|---|
-
-public static final int |
-RECURSE_DEPTH |
-3 |
-
Modifier and Type | -Constant Field | -Value | -
---|---|---|
-
-public static final double |
-DEFAULT_DISABLE_AT_PERM_GEN |
-0.65 |
-
-
-public static final int |
-SHUTDOWN_DELAY_MS |
-2000 |
-
-
-public static final java.lang.String |
-THREAD_FORMAT |
-"ProtocolLib-StructureCompiler %s" |
-
Modifier and Type | -Constant Field | -Value | -
---|---|---|
-
-public static final java.lang.String |
-STRING_DEFAULT |
-"" |
-
Modifier and Type | -Constant Field | -Value | -
---|---|---|
-
-public static final java.lang.String |
-MINECRAFT_OBJECT |
-"net\\.minecraft(\\.\\w+)+" |
-
Modifier and Type | -Constant Field | -Value | -
---|---|---|
-
-public static final java.lang.String |
-EMPTY_NAME |
-"" |
-
Modifier and Type | -Constant Field | -Value | -
---|---|---|
-
-public static final java.lang.String |
-TYPE_DELIMITER |
-"$" |
-
Field and Description | -
---|
com.comphenix.protocol.utility.MinecraftReflection.MINECRAFT_OBJECT | -
com.comphenix.protocol.Packets.Server.PICKUP_SPAWN | -
com.comphenix.protocol.Packets.Client.RESPAWN | -
Method and Description | -
---|
com.comphenix.protocol.wrappers.nbt.NbtCompound.getValue() | -
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.
-NbtConfigurationSerializer.TYPE_DELIMITER
as the default delimiter.true
.ProtocolMananger
object.Report
to the display and permanent storage.DetailedErrorReporter.reportDetailed(Object, Report)
.Field
by name respecting scope.Field
by name breaking scope if
- requested.Modifier
that must not be present for the member to match.Modifier
that is required for the member to match.- - diff --git a/Javadoc/overview-summary.html b/Javadoc/overview-summary.html deleted file mode 100644 index a1108800..00000000 --- a/Javadoc/overview-summary.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - - -
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.async | -- |
com.comphenix.protocol.concurrency | -- |
com.comphenix.protocol.error | -- |
com.comphenix.protocol.events | -- |
com.comphenix.protocol.injector | -- |
com.comphenix.protocol.metrics | -- |
com.comphenix.protocol.reflect | -- |
com.comphenix.protocol.reflect.cloning | -- |
com.comphenix.protocol.reflect.compiler | -- |
com.comphenix.protocol.reflect.fuzzy | -- |
com.comphenix.protocol.reflect.instances | -- |
com.comphenix.protocol.utility | -- |
com.comphenix.protocol.wrappers | -- |
com.comphenix.protocol.wrappers.nbt | -- |
com.comphenix.protocol.wrappers.nbt.io | -- |
long initialTime-
long timeout-
long originalSendingIndex-
long newSendingIndex-
java.lang.Long queuedSendingIndex-
boolean processed-
boolean transmitted-
boolean asyncCancelled-
java.util.concurrent.atomic.AtomicInteger processingDelay-
java.lang.Object processingLock-
private void readObject(java.io.ObjectInputStream input) - throws java.lang.ClassNotFoundException, - java.io.IOException-
java.lang.ClassNotFoundException
java.io.IOException
private void writeObject(java.io.ObjectOutputStream output) - throws java.io.IOException-
java.io.IOException
int id-
private void readObject(java.io.ObjectInputStream input) - throws java.lang.ClassNotFoundException, - java.io.IOException-
java.lang.ClassNotFoundException
java.io.IOException
private void writeObject(java.io.ObjectOutputStream output) - throws java.io.IOException-
java.io.IOException
PacketContainer packet-
boolean serverPacket-
boolean cancel-
AsyncMarker asyncMarker-
boolean asynchronous-
boolean readOnly-