diff --git a/Javadoc/allclasses-frame.html b/Javadoc/allclasses-frame.html index 6db061a6..83527ff6 100644 --- a/Javadoc/allclasses-frame.html +++ b/Javadoc/allclasses-frame.html @@ -2,9 +2,9 @@
- +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 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()+
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.
+ |
+
AbstractConcurrentListenerMultimap()
AbstractConcurrentListenerMultimap(int maximumPacketID)
public AbstractConcurrentListenerMultimap()+
public AbstractConcurrentListenerMultimap(int maximumPacketID)
void
addAll(java.util.Collection<java.lang.Integer> packets)
+void
clear()
boolean
contains(int element)
void
remove(int element)
java.util.Set<java.lang.Integer>
toSet()
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 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.maxErrorCount
static java.lang.String
PLUGIN_NAME
protected java.lang.String
pluginName
protected java.lang.ref.WeakReference<org.bukkit.plugin.Plugin>
prefix
static ReportType
REPORT_EXCEPTION_COUNT
+static java.lang.String
SECOND_LEVEL_PREFIX
protected java.lang.String
supportURL
void
clearGlobalParameters()
clearGlobalParameters()
+int
getErrorCount()
getErrorCount()
+reportDetailed(Object, Report)
.java.lang.Object
getGlobalParameter(java.lang.String key)
getGlobalParameter(java.lang.String key)
+java.util.logging.Logger
getLogger()
getLogger()
+int
getMaxErrorCount()
getMaxErrorCount()
+java.lang.String
getPrefix()
getPrefix()
+protected java.lang.String
getStringDescription(java.lang.Object value)
getStringDescription(java.lang.Object value)
+java.lang.String
getSupportURL()
getSupportURL()
+java.util.Set<java.lang.String>
globalParameters()
globalParameters()
+protected boolean
void
reportDetailed(java.lang.Object sender,
- java.lang.String message,
- java.lang.Throwable error,
- java.lang.Object... parameters)
+reportDetailed(java.lang.Object sender,
+ Report.ReportBuilder reportBuilder)
void
reportMinimal(org.bukkit.plugin.Plugin sender,
- java.lang.String methodName,
- java.lang.Throwable error)
-reportDetailed(java.lang.Object sender,
+ Report report)
+void
reportMinimal(org.bukkit.plugin.Plugin sender,
+ java.lang.String methodName,
+ java.lang.Throwable error)
+void
reportMinimal(org.bukkit.plugin.Plugin sender,
java.lang.String methodName,
java.lang.Throwable error,
java.lang.Object... parameters)
-boolean
reportMinimalNoSpam(org.bukkit.plugin.Plugin sender,
java.lang.String methodName,
- java.lang.Throwable error)
void
reportWarning(java.lang.Object sender,
- java.lang.String message)
-void
reportWarning(java.lang.Object sender,
- java.lang.String message,
- java.lang.Throwable error)
+reportWarning(java.lang.Object sender,
+ Report.ReportBuilder reportBuilder)
void
setErrorCount(int errorCount)
reportWarning(java.lang.Object sender,
+ Report report)
+void
setLogger(java.util.logging.Logger logger)
setErrorCount(int errorCount)
+void
setMaxErrorCount(int maxErrorCount)
setLogger(java.util.logging.Logger logger)
+void
setPrefix(java.lang.String prefix)
setMaxErrorCount(int maxErrorCount)
+void
setSupportURL(java.lang.String supportURL)
setPrefix(java.lang.String prefix)
+void
setSupportURL(java.lang.String supportURL)
+public static final ReportType REPORT_EXCEPTION_COUNT+
public static final java.lang.String PLUGIN_NAME-
protected java.lang.String pluginName+
ErrorReporter
reportMinimal
in interface ErrorReporter
ErrorReporter
reportMinimal
in interface ErrorReporter
sender
- - the component that observed this exception.methodName
- - the method name.error
- - the error itself.public void reportWarning(java.lang.Object sender, - java.lang.String message)-
ErrorReporter
ErrorReporter
reportWarning
in interface ErrorReporter
sender
- - the object containing the caller method.message
- - error message.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, - java.lang.String message, - java.lang.Throwable error)-
ErrorReporter
ErrorReporter
reportWarning
in interface ErrorReporter
sender
- - the object containing the caller method.message
- - error message.error
- - the exception that was thrown.reportWarning
in interface ErrorReporter
sender
- - the object containing the caller method.report
- - an error report to include.public void reportDetailed(java.lang.Object sender, - java.lang.String message, - java.lang.Throwable error, - java.lang.Object... parameters)-
ErrorReporter
ErrorReporter
reportDetailed
in interface ErrorReporter
sender
- - the object containing the caller method.message
- - an error message to include.error
- - the exception that was thrown in the caller method.parameters
- - parameters from the caller method.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 getStringDescription(java.lang.Object value)+
value
- - object to convert.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.void
reportDetailed(java.lang.Object sender,
- java.lang.String message,
- java.lang.Throwable error,
- java.lang.Object... parameters)
+reportDetailed(java.lang.Object sender,
+ Report.ReportBuilder reportBuilder)
void
reportMinimal(org.bukkit.plugin.Plugin sender,
- java.lang.String methodName,
- java.lang.Throwable error)
-reportDetailed(java.lang.Object sender,
+ Report report)
+void
reportMinimal(org.bukkit.plugin.Plugin sender,
+ java.lang.String methodName,
+ java.lang.Throwable error)
+void
reportMinimal(org.bukkit.plugin.Plugin sender,
java.lang.String methodName,
java.lang.Throwable error,
java.lang.Object... parameters)
-void
reportWarning(java.lang.Object sender,
- java.lang.String message)
-void
reportWarning(java.lang.Object sender,
- java.lang.String message,
- java.lang.Throwable error)
+reportWarning(java.lang.Object sender,
+ Report.ReportBuilder reportBuilder)
+void
reportWarning(java.lang.Object sender,
+ Report report)
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.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, - java.lang.String message)+ Report report)
sender
- - the object containing the caller method.message
- - error message.sender
- - the object containing the caller method.report
- - an error report to include.void reportWarning(java.lang.Object sender, - java.lang.String message, - java.lang.Throwable error)+ Report.ReportBuilder reportBuilder)
sender
- - the object containing the caller method.message
- - error message.error
- - the exception that was thrown.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, - java.lang.String message, - java.lang.Throwable error, - java.lang.Object... parameters)+ Report.ReportBuilder reportBuilder)
sender
- - the object containing the caller method.message
- - an error message to include.error
- - the exception that was thrown in the caller method.parameters
- - parameters from the caller method.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 BukkitUnwrapper -extends java.lang.Object -implements PacketConstructor.Unwrapper-
public class ReportType
+extends java.lang.Object
+- Typical conversions include: -
BukkitUnwrapper()
ReportType(java.lang.String errorFormat)
+java.lang.Object
unwrapItem(java.lang.Object wrappedObject)
-java.lang.String
getMessage(java.lang.Object[] parameters)
+static ReportType[]
getReports(java.lang.Class<?> clazz)
+java.lang.String
toString()
public BukkitUnwrapper()+
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 java.lang.Object unwrapItem(java.lang.Object wrappedObject)-
PacketConstructor.Unwrapper
unwrapItem
in interface PacketConstructor.Unwrapper
wrappedObject
- - wrapped object.public static ReportType[] getReports(java.lang.Class<?> clazz)+
clazz
- - sender class.Constructor and Description | +
---|
CommandFilter(ErrorReporter reporter,
+ org.bukkit.plugin.Plugin plugin,
+ com.comphenix.protocol.ProtocolConfig config) |
+
class
BasicErrorReporter
+class
DelegatedErrorReporter
+class
DetailedErrorReporter
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.
+ |
+
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 |
+
Report
to the display and permanent storage.Report
to the display and permanent storage.Report
to the display and permanent storage.Report
to the display and permanent storage.Report
to the display and permanent storage.@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()+
boolean
isReadOnly()
+boolean
isServerPacket()
void
setAsyncMarker(AsyncMarker asyncMarker)
void
setCancelled(boolean cancel)
void
setPacket(PacketContainer packet)
void
setReadOnly(boolean readOnly)
+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.ListeningWhitelist
getReceivingWhitelist()
getReceivingWhitelist()
ListeningWhitelist
getReceivingWhitelist()
getReceivingWhitelist()
ListeningWhitelist
ListeningWhitelist
getSendingWhitelist()
getSendingWhitelist()
ListeningWhitelist
getSendingWhitelist()
getSendingWhitelist()
boolean
evaluate(javax.script.ScriptEngine context,
+ PacketEvent event)
+boolean
filterEvent(PacketEvent event)
+boolean
filterEvent(PacketEvent event,
+ CommandFilter.FilterFailedHandler handler)
+boolean
handle(PacketEvent event,
+ CommandFilter.Filter filter,
+ java.lang.Exception ex)
+boolean
hasAsynchronousListeners(PacketEvent packet)
public class DelayedSingleTask
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
protected boolean |
-closed |
-
protected Plugin |
-plugin |
-
protected BukkitScheduler |
-scheduler |
-
protected int |
-taskID |
-
Constructor and Description | -
---|
DelayedSingleTask(Plugin plugin)
-Create a single task scheduler.
- |
-
DelayedSingleTask(Plugin plugin,
- BukkitScheduler scheduler)
-Create a single task scheduler.
- |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-cancel()
-Cancel a future task from being executed.
- |
-
void |
-close()
-Stop the current task and all future tasks scheduled by this instance.
- |
-
protected void |
-finalize() |
-
Plugin |
-getPlugin()
-Retrieve the plugin this task belongs to.
- |
-
int |
-getTaskID()
-Retrieve the raw task ID.
- |
-
boolean |
-isRunning()
-Whether or not a future task is scheduled to be executed.
- |
-
boolean |
-schedule(long ticksDelay,
- java.lang.Runnable task)
-Schedule a single task for execution.
- |
-
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected int taskID-
protected Plugin plugin-
protected BukkitScheduler scheduler-
protected boolean closed-
public DelayedSingleTask(Plugin plugin)-
plugin
- - owner plugin.public DelayedSingleTask(Plugin plugin, - BukkitScheduler scheduler)-
plugin
- - owner plugin.scheduler
- - specialized scheduler.public boolean schedule(long ticksDelay, - java.lang.Runnable task)-
- Any previously scheduled task will be automatically cancelled. -
- Note that a tick delay of zero will execute the task immediately.
ticksDelay
- - number of ticks before the task is executed.task
- - the task to schedule.public boolean isRunning()-
public boolean cancel()-
public int getTaskID()-
public Plugin getPlugin()-
public void close()-
protected void finalize() - throws java.lang.Throwable-
finalize
in class java.lang.Object
java.lang.Throwable
Enum Constant and Description | -
---|
BOTH
-Listen for every sent and received packet.
- |
-
LOGIN
-Only listen for packets sent or received before a player has logged in.
- |
-
PLAYING
-Only listen for packets sent or received after a player has logged in.
- |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-hasLogin()
-Determine if the current value represents the login phase.
- |
-
boolean |
-hasPlaying()
-Determine if the current value represents the playing phase.
- |
-
static GamePhase |
-valueOf(java.lang.String name)
-Returns the enum constant of this type with the specified name.
- |
-
static GamePhase[] |
-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 GamePhase LOGIN-
public static final GamePhase PLAYING-
public static final GamePhase BOTH-
public static GamePhase[] values()-
-for (GamePhase c : GamePhase.values()) - System.out.println(c); -
public static GamePhase 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 hasLogin()-
public boolean hasPlaying()-
public interface ListenerInvoker
-Modifier and Type | -Method and Description | -
---|---|
java.lang.Class<?> |
-getPacketClassFromID(int packetID,
- boolean forceVanilla)
-Retrieves the correct packet class from a given packet ID.
- |
-
int |
-getPacketID(java.lang.Object packet)
-Retrieve the associated ID of a packet.
- |
-
void |
-invokePacketRecieving(PacketEvent event)
-Invokes the given packet event for every registered listener.
- |
-
void |
-invokePacketSending(PacketEvent event)
-Invokes the given packet event for every registered listener.
- |
-
void |
-registerPacketClass(java.lang.Class<?> clazz,
- int packetID)
-Remove a given class from the packet registry.
- |
-
void |
-unregisterPacketClass(java.lang.Class<?> clazz)
-Associate a given class with the given packet ID.
- |
-
void invokePacketRecieving(PacketEvent event)-
event
- - the packet event to invoke.void invokePacketSending(PacketEvent event)-
event
- - the packet event to invoke.int getPacketID(java.lang.Object packet)-
packet
- - the packet.void unregisterPacketClass(java.lang.Class<?> clazz)-
clazz
- - class to associate.void registerPacketClass(java.lang.Class<?> clazz, - int packetID)-
clazz
- - class to remove.java.lang.Class<?> getPacketClassFromID(int packetID, - boolean forceVanilla)-
packetID
- - the packet ID.forceVanilla
- - whether or not to look for vanilla classes, not injected classes.public class PacketConstructor
-extends java.lang.Object
-Modifier and Type | -Class and Description | -
---|---|
static interface |
-PacketConstructor.Unwrapper
-Represents a unwrapper for a constructor parameter.
- |
-
Modifier and Type | -Field and Description | -
---|---|
static PacketConstructor |
-DEFAULT
-A packet constructor that automatically converts Bukkit types to their NMS conterpart.
- |
-
Modifier and Type | -Method and Description | -
---|---|
PacketContainer |
-createPacket(java.lang.Object... values)
-Construct a packet using the special builtin Minecraft constructors.
- |
-
int |
-getPacketID()
-Retrieve the id of the packets this constructor creates.
- |
-
com.google.common.collect.ImmutableList<PacketConstructor.Unwrapper> |
-getUnwrappers() |
-
PacketConstructor |
-withPacket(int id,
- java.lang.Object[] values)
-Create a packet constructor that creates packets using the given types.
- |
-
PacketConstructor |
-withUnwrappers(java.util.List<PacketConstructor.Unwrapper> unwrappers)
-Return a copy of the current constructor with a different list of unwrappers.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static PacketConstructor DEFAULT-
- Remember to call withPacket().
public com.google.common.collect.ImmutableList<PacketConstructor.Unwrapper> getUnwrappers()-
public int getPacketID()-
public PacketConstructor withUnwrappers(java.util.List<PacketConstructor.Unwrapper> unwrappers)-
unwrappers
- - list of unwrappers that convert Bukkit wrappers into the equivalent NMS classes.public PacketConstructor withPacket(int id, - java.lang.Object[] values)-
id
- - packet ID.values
- - types to create.java.lang.IllegalArgumentException
- If no packet constructor could be created with these types.public PacketContainer createPacket(java.lang.Object... values) - throws FieldAccessException-
values
- - values containing Bukkit wrapped items to pass to Minecraft.FieldAccessException
- Failure due to a security limitation.java.lang.IllegalArgumentException
- Arguments doesn't match the constructor.java.lang.RuntimeException
- Minecraft threw an exception.public static enum PacketFilterManager.PlayerInjectHooks -extends java.lang.Enum<PacketFilterManager.PlayerInjectHooks>-
Enum Constant and Description | -
---|
NETWORK_HANDLER_FIELDS
-Override the packet queue lists in NetworkHandler.
- |
-
NETWORK_MANAGER_OBJECT
-Override the network handler object itself.
- |
-
NETWORK_SERVER_OBJECT
-Override the server handler object.
- |
-
NONE
-The injection hook that does nothing.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static PacketFilterManager.PlayerInjectHooks |
-valueOf(java.lang.String name)
-Returns the enum constant of this type with the specified name.
- |
-
static PacketFilterManager.PlayerInjectHooks[] |
-values()
-Returns an array containing the constants of this enum type, in
-the order they are declared.
- |
-
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final PacketFilterManager.PlayerInjectHooks NONE-
public static final PacketFilterManager.PlayerInjectHooks NETWORK_MANAGER_OBJECT-
- Cannot intercept MapChunk packets.
public static final PacketFilterManager.PlayerInjectHooks NETWORK_HANDLER_FIELDS-
- Cannot intercept MapChunk packets.
public static final PacketFilterManager.PlayerInjectHooks NETWORK_SERVER_OBJECT-
public static PacketFilterManager.PlayerInjectHooks[] values()-
-for (PacketFilterManager.PlayerInjectHooks c : PacketFilterManager.PlayerInjectHooks.values()) - System.out.println(c); -
public static PacketFilterManager.PlayerInjectHooks valueOf(java.lang.String name)-
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant
-with the specified namejava.lang.NullPointerException
- if the argument is nullpublic final class PacketFilterManager -extends java.lang.Object -implements ProtocolManager, ListenerInvoker-
Modifier and Type | -Class and Description | -
---|---|
static class |
-PacketFilterManager.PlayerInjectHooks
-Sets the inject hook type.
- |
-
Constructor and Description | -
---|
PacketFilterManager(java.lang.ClassLoader classLoader,
- Server server,
- DelayedSingleTask unhookTask,
- ErrorReporter reporter)
-Only create instances of this class if protocol lib is disabled.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-addPacketListener(PacketListener listener)
-Adds a packet listener.
- |
-
void |
-close()
-Called when ProtocolLib is closing.
- |
-
PacketContainer |
-createPacket(int id)
-Constructs a new encapsulated Minecraft packet with the given ID.
- |
-
PacketContainer |
-createPacket(int id,
- boolean forceDefaults)
-Constructs a new encapsulated Minecraft packet with the given ID.
- |
-
PacketConstructor |
-createPacketConstructor(int id,
- java.lang.Object... arguments)
-Construct a packet using the special builtin Minecraft constructors.
- |
-
protected void |
-finalize() |
-
AsynchronousManager |
-getAsynchronousManager()
-Retrieve the current asyncronous packet manager.
- |
-
java.lang.ClassLoader |
-getClassLoader()
-Retrieves the current plugin class loader.
- |
-
static java.util.Set<java.lang.Integer> |
-getClientPackets()
-Retrieve every known and supported client packet.
- |
-
Entity |
-getEntityFromID(World container,
- int id)
-Retrieve the associated entity.
- |
-
java.util.List<Player> |
-getEntityTrackers(Entity entity)
-Retrieve every client that is receiving information about a given entity.
- |
-
java.lang.Class<?> |
-getPacketClassFromID(int packetID,
- boolean forceVanilla)
-Retrieves the correct packet class from a given packet ID.
- |
-
int |
-getPacketID(java.lang.Object packet)
-Retrieve the associated ID of a packet.
- |
-
com.google.common.collect.ImmutableSet<PacketListener> |
-getPacketListeners()
-Retrieves a list of every registered packet listener.
- |
-
PacketFilterManager.PlayerInjectHooks |
-getPlayerHook()
-Retrieves how the server packets are read.
- |
-
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.
- |
-
static java.util.Set<java.lang.Integer> |
-getServerPackets()
-Retrieve every known and supported server packet.
- |
-
void |
-initializePlayers(Player[] players)
-Initialize the packet injection for every player.
- |
-
void |
-invokePacketRecieving(PacketEvent event)
-Invokes the given packet event for every registered listener.
- |
-
void |
-invokePacketSending(PacketEvent event)
-Invokes the given packet event for every registered listener.
- |
-
boolean |
-isClosed()
-Determines whether or not this protocol mananger has been disabled.
- |
-
void |
-recieveClientPacket(Player sender,
- PacketContainer packet)
-Simulate recieving a certain packet from a given player.
- |
-
void |
-recieveClientPacket(Player sender,
- PacketContainer packet,
- boolean filters)
-Simulate recieving a certain packet from a given player.
- |
-
void |
-registerEvents(PluginManager manager,
- Plugin plugin)
-Register this protocol manager on Bukkit.
- |
-
void |
-registerPacketClass(java.lang.Class<?> clazz,
- int packetID)
-Remove a given class from the packet registry.
- |
-
void |
-removePacketListener(PacketListener listener)
-Removes a given packet listener.
- |
-
void |
-removePacketListeners(Plugin plugin)
-Removes every listener associated with the given plugin.
- |
-
void |
-sendServerPacket(Player reciever,
- PacketContainer packet)
-Send a packet to the given player.
- |
-
void |
-sendServerPacket(Player reciever,
- PacketContainer packet,
- boolean filters)
-Send a packet to the given player.
- |
-
void |
-setPlayerHook(PacketFilterManager.PlayerInjectHooks playerHook)
-Sets how the server packets are read.
- |
-
void |
-uninitializePlayers(Player[] players)
-Uninitialize the packet injection of every player.
- |
-
void |
-unregisterPacketClass(java.lang.Class<?> clazz)
-Associate a given class with the given packet ID.
- |
-
void |
-updateEntity(Entity entity,
- java.util.List<Player> observers)
-Completely resend an entity to a list of clients.
- |
-
static void |
-verifyWhitelist(PacketListener listener,
- ListeningWhitelist whitelist)
-Determine if the packet IDs in a whitelist is valid.
- |
-
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public PacketFilterManager(java.lang.ClassLoader classLoader, - Server server, - DelayedSingleTask unhookTask, - ErrorReporter reporter)-
unhookTask
- public AsynchronousManager getAsynchronousManager()-
ProtocolManager
getAsynchronousManager
in interface ProtocolManager
public PacketFilterManager.PlayerInjectHooks getPlayerHook()-
public void setPlayerHook(PacketFilterManager.PlayerInjectHooks playerHook)-
playerHook
- - the new injection method for reading server packets.public com.google.common.collect.ImmutableSet<PacketListener> getPacketListeners()-
ProtocolManager
getPacketListeners
in interface ProtocolManager
public void addPacketListener(PacketListener listener)-
ProtocolManager
- Adding an already registered listener has no effect. If you need to change the packets - the current listener is observing, you must first remove the packet listener before you - can register it again.
addPacketListener
in interface ProtocolManager
listener
- - new packet listener.public static void verifyWhitelist(PacketListener listener, - ListeningWhitelist whitelist)-
listener
- - the listener that will be mentioned in the error.whitelist
- - whitelist of packet IDs.java.lang.IllegalArgumentException
- If the whitelist is illegal.public void removePacketListener(PacketListener listener)-
ProtocolManager
- Attempting to remove a listener that doesn't exist has no effect.
removePacketListener
in interface ProtocolManager
listener
- - the packet listener to remove.public void removePacketListeners(Plugin plugin)-
ProtocolManager
removePacketListeners
in interface ProtocolManager
plugin
- - the plugin to unload.public void invokePacketRecieving(PacketEvent event)-
ListenerInvoker
invokePacketRecieving
in interface ListenerInvoker
event
- - the packet event to invoke.public void invokePacketSending(PacketEvent event)-
ListenerInvoker
invokePacketSending
in interface ListenerInvoker
event
- - the packet event to invoke.public void sendServerPacket(Player reciever, - PacketContainer packet) - throws java.lang.reflect.InvocationTargetException-
PacketStream
sendServerPacket
in interface PacketStream
reciever
- - the reciever.packet
- - packet to send.java.lang.reflect.InvocationTargetException
- - if an error occured when sending the packet.public void sendServerPacket(Player reciever, - PacketContainer packet, - boolean filters) - throws java.lang.reflect.InvocationTargetException-
ProtocolManager
- 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
sendServerPacket
in interface ProtocolManager
reciever
- - the reciever.packet
- - packet to send.filters
- - whether or not to invoke any packet filters.java.lang.reflect.InvocationTargetException
- - if an error occured when sending the packet.public void recieveClientPacket(Player sender, - PacketContainer packet) - throws java.lang.IllegalAccessException, - java.lang.reflect.InvocationTargetException-
PacketStream
recieveClientPacket
in interface PacketStream
sender
- - the sender.packet
- - the packet that was sent.java.lang.IllegalAccessException
- If the underlying method caused an error.java.lang.reflect.InvocationTargetException
- If the reflection machinery failed.public void recieveClientPacket(Player sender, - PacketContainer packet, - boolean filters) - throws java.lang.IllegalAccessException, - java.lang.reflect.InvocationTargetException-
ProtocolManager
- 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
recieveClientPacket
in interface ProtocolManager
sender
- - the sender.packet
- - the packet that was sent.filters
- - whether or not to invoke any packet filters.java.lang.IllegalAccessException
- If the underlying method caused an error.java.lang.reflect.InvocationTargetException
- If the reflection machinery failed.public PacketContainer createPacket(int id)-
ProtocolManager
createPacket
in interface ProtocolManager
id
- - packet ID.public PacketContainer createPacket(int id, - boolean forceDefaults)-
ProtocolManager
- If set to true, the forceDefaults option will force the system to automatically - give non-primitive fields in the packet sensible default values. For instance, certain - packets - like Packet60Explosion - require a List or Set to be non-null. If the - forceDefaults option is true, the List or Set will be automatically created.
createPacket
in interface ProtocolManager
id
- - packet ID.forceDefaults
- - TRUE to use sensible defaults in most fields, FALSE otherwise.public PacketConstructor createPacketConstructor(int id, - java.lang.Object... arguments)-
ProtocolManager
createPacketConstructor
in interface ProtocolManager
id
- - the packet ID.arguments
- - arguments that will be passed to the constructor.public java.util.Set<java.lang.Integer> getSendingFilters()-
ProtocolManager
getSendingFilters
in interface ProtocolManager
public java.util.Set<java.lang.Integer> getReceivingFilters()-
ProtocolManager
getReceivingFilters
in interface ProtocolManager
public void updateEntity(Entity entity, - java.util.List<Player> observers) - throws FieldAccessException-
ProtocolManager
- Note that this method is NOT thread safe. If you call this method from anything - but the main thread, it will throw an exception.
updateEntity
in interface ProtocolManager
entity
- - entity to refresh.observers
- - the clients to update.FieldAccessException
public Entity getEntityFromID(World container, - int id) - throws FieldAccessException-
ProtocolManager
getEntityFromID
in interface ProtocolManager
container
- - the world the entity belongs to.id
- - the unique ID of the entity.FieldAccessException
- Reflection failed.public java.util.List<Player> getEntityTrackers(Entity entity) - throws FieldAccessException-
ProtocolManager
getEntityTrackers
in interface ProtocolManager
entity
- - the entity that is being tracked.FieldAccessException
- If reflection failed.public void initializePlayers(Player[] players)-
players
- - list of players to inject.public void uninitializePlayers(Player[] players)-
players
- - list of players to uninject.public void registerEvents(PluginManager manager, - Plugin plugin)-
manager
- - Bukkit plugin manager that provides player join/leave events.plugin
- - the parent plugin.public int getPacketID(java.lang.Object packet)-
ListenerInvoker
getPacketID
in interface ListenerInvoker
packet
- - the packet.public void registerPacketClass(java.lang.Class<?> clazz, - int packetID)-
ListenerInvoker
registerPacketClass
in interface ListenerInvoker
clazz
- - class to remove.public void unregisterPacketClass(java.lang.Class<?> clazz)-
ListenerInvoker
unregisterPacketClass
in interface ListenerInvoker
clazz
- - class to associate.public java.lang.Class<?> getPacketClassFromID(int packetID, - boolean forceVanilla)-
ListenerInvoker
getPacketClassFromID
in interface ListenerInvoker
packetID
- - the packet ID.forceVanilla
- - whether or not to look for vanilla classes, not injected classes.public static java.util.Set<java.lang.Integer> getServerPackets() - throws FieldAccessException-
FieldAccessException
- If we're unable to retrieve the server packet data from Minecraft.public static java.util.Set<java.lang.Integer> getClientPackets() - throws FieldAccessException-
FieldAccessException
- If we're unable to retrieve the client packet data from Minecraft.public java.lang.ClassLoader getClassLoader()-
public boolean isClosed()-
ProtocolManager
isClosed
in interface ProtocolManager
public void close()-
protected void finalize() - throws java.lang.Throwable-
finalize
in class java.lang.Object
java.lang.Throwable
public class PrioritizedListener<TListener> -extends java.lang.Object -implements java.lang.Comparable<PrioritizedListener<TListener>>-
Constructor and Description | -
---|
PrioritizedListener(TListener listener,
- ListenerPriority priority) |
-
Modifier and Type | -Method and Description | -
---|---|
int |
-compareTo(PrioritizedListener<TListener> other) |
-
boolean |
-equals(java.lang.Object obj) |
-
TListener |
-getListener()
-Retrieve the underlying listener.
- |
-
ListenerPriority |
-getPriority()
-Retrieve the priority of this listener.
- |
-
int |
-hashCode() |
-
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
public PrioritizedListener(TListener listener, - ListenerPriority priority)-
public int compareTo(PrioritizedListener<TListener> other)-
compareTo
in interface java.lang.Comparable<PrioritizedListener<TListener>>
public boolean equals(java.lang.Object obj)-
equals
in class java.lang.Object
public int hashCode()-
hashCode
in class java.lang.Object
public TListener getListener()-
public ListenerPriority getPriority()-
public final class SortedPacketListenerList -extends AbstractConcurrentListenerMultimap<PacketListener>-
Constructor and Description | -
---|
SortedPacketListenerList() |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-invokePacketRecieving(ErrorReporter reporter,
- PacketEvent event)
-Invokes the given packet event for every registered listener.
- |
-
void |
-invokePacketSending(ErrorReporter reporter,
- PacketEvent event)
-Invokes the given packet event for every registered listener.
- |
-
addListener, clearListeners, getListener, keySet, removeListener, values
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public SortedPacketListenerList()-
public void invokePacketRecieving(ErrorReporter reporter, - PacketEvent event)-
reporter
- - the error reporter that will be used to inform about listener exceptions.event
- - the packet event to invoke.public void invokePacketSending(ErrorReporter reporter, - PacketEvent event)-
reporter
- - the error reporter that will be used to inform about listener exceptions.event
- - the packet event to invoke.public class StructureCache
-extends java.lang.Object
-Constructor and Description | -
---|
StructureCache() |
-
Modifier and Type | -Method and Description | -
---|---|
static StructureModifier<java.lang.Object> |
-getStructure(java.lang.Class<?> packetType)
-Retrieve a cached structure modifier given a packet type.
- |
-
static StructureModifier<java.lang.Object> |
-getStructure(java.lang.Class<?> packetType,
- boolean compile)
-Retrieve a cached structure modifier given a packet type.
- |
-
static StructureModifier<java.lang.Object> |
-getStructure(int id)
-Retrieve a cached structure modifier for the given packet id.
- |
-
static StructureModifier<java.lang.Object> |
-getStructure(int id,
- boolean compile)
-Retrieve a cached structure modifier for the given packet id.
- |
-
static java.lang.Object |
-newPacket(int id)
-Creates an empty Minecraft packet of the given ID.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static java.lang.Object newPacket(int id)-
id
- - packet ID.public static StructureModifier<java.lang.Object> getStructure(int id)-
id
- - packet ID.public static StructureModifier<java.lang.Object> getStructure(java.lang.Class<?> packetType)-
packetType
- - packet type.public static StructureModifier<java.lang.Object> getStructure(java.lang.Class<?> packetType, - boolean compile)-
packetType
- - packet type.compile
- - whether or not to asynchronously compile the structure modifier.public static StructureModifier<java.lang.Object> getStructure(int id, - boolean compile)-
id
- - packet ID.compile
- - whether or not to asynchronously compile the structure modifier.Package | -Description | -
---|---|
com.comphenix.protocol.injector | -- |
Constructor and Description | -
---|
PacketFilterManager(java.lang.ClassLoader classLoader,
- Server server,
- DelayedSingleTask unhookTask,
- ErrorReporter reporter)
-Only create instances of this class if protocol lib is disabled.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.events | -- |
com.comphenix.protocol.injector | -- |
com.comphenix.protocol.injector.player | -- |
Modifier and Type | -Method and Description | -
---|---|
GamePhase |
-ListeningWhitelist.getGamePhase()
-Retrieve which game phase this listener is active under.
- |
-
Constructor and Description | -
---|
ListeningWhitelist(ListenerPriority priority,
- java.lang.Integer[] whitelist,
- 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,
- GamePhase gamePhase)
-Creates a packet whitelist for a given priority with a set of packet IDs.
- |
-
PacketAdapter(Plugin plugin,
- ConnectionSide connectionSide,
- GamePhase gamePhase,
- java.lang.Integer... packets)
-Initialize a packet listener for a single connection side.
- |
-
PacketAdapter(Plugin plugin,
- ConnectionSide connectionSide,
- GamePhase gamePhase,
- java.util.Set<java.lang.Integer> packets)
-Initialize a packet listener for a single connection side.
- |
-
PacketAdapter(Plugin plugin,
- ConnectionSide connectionSide,
- ListenerPriority listenerPriority,
- GamePhase gamePhase,
- java.lang.Integer... packets)
-Initialize a packet listener for a single connection side.
- |
-
PacketAdapter(Plugin plugin,
- ConnectionSide connectionSide,
- ListenerPriority listenerPriority,
- GamePhase gamePhase,
- java.util.Set<java.lang.Integer> packets)
-Initialize a packet listener for a single connection side.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static GamePhase |
-GamePhase.valueOf(java.lang.String name)
-Returns the enum constant of this type with the specified name.
- |
-
static GamePhase[] |
-GamePhase.values()
-Returns an array containing the constants of this enum type, in
-the order they are declared.
- |
-
Modifier and Type | -Field and Description | -
---|---|
protected com.google.common.base.Predicate<GamePhase> |
-PlayerInjectorBuilder.injectionFilter |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-NetworkObjectInjector.canInject(GamePhase phase) |
-
PacketFilterManager.PlayerInjectHooks |
-PlayerInjectionHandler.getPlayerHook(GamePhase phase)
-Retrieves how the server packets are read.
- |
-
void |
-PlayerInjectionHandler.setPlayerHook(GamePhase phase,
- PacketFilterManager.PlayerInjectHooks playerHook)
-Sets how the server packets are read.
- |
-
Modifier and Type | -Method and Description | -
---|---|
PlayerInjectorBuilder |
-PlayerInjectorBuilder.injectionFilter(com.google.common.base.Predicate<GamePhase> injectionFilter)
-The injection filter that is used to determine if it is necessary to perform
- injection during a certain phase.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.injector | -- |
com.comphenix.protocol.injector.packet | -- |
com.comphenix.protocol.injector.player | -- |
com.comphenix.protocol.injector.spigot | -- |
Modifier and Type | -Class and Description | -
---|---|
class |
-PacketFilterManager |
-
Modifier and Type | -Field and Description | -
---|---|
protected ListenerInvoker |
-PacketInjectorBuilder.invoker |
-
Modifier and Type | -Method and Description | -
---|---|
PacketInjectorBuilder |
-PacketInjectorBuilder.invoker(ListenerInvoker invoker)
-The packet stream invoker.
- |
-
Modifier and Type | -Field and Description | -
---|---|
protected ListenerInvoker |
-PlayerInjectorBuilder.invoker |
-
Modifier and Type | -Method and Description | -
---|---|
PlayerInjectorBuilder |
-PlayerInjectorBuilder.invoker(ListenerInvoker invoker)
-The packet stream invoker.
- |
-
Constructor and Description | -
---|
NetworkObjectInjector(java.lang.ClassLoader classLoader,
- ErrorReporter reporter,
- Player player,
- ListenerInvoker invoker,
- IntegerSet sendingFilters)
-Create a new network object injector.
- |
-
Constructor and Description | -
---|
SpigotPacketInjector(java.lang.ClassLoader classLoader,
- ErrorReporter reporter,
- ListenerInvoker invoker,
- Server server)
-Create a new spigot injector.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.injector | -- |
Modifier and Type | -Class and Description | -
---|---|
class |
-BukkitUnwrapper
-Represents an object capable of converting wrapped Bukkit objects into NMS objects.
- |
-
Modifier and Type | -Method and Description | -
---|---|
com.google.common.collect.ImmutableList<PacketConstructor.Unwrapper> |
-PacketConstructor.getUnwrappers() |
-
Modifier and Type | -Method and Description | -
---|---|
PacketConstructor |
-PacketConstructor.withUnwrappers(java.util.List<PacketConstructor.Unwrapper> unwrappers)
-Return a copy of the current constructor with a different list of unwrappers.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol | -
- Contains classes for retrieving the main
-ProtocolMananger object. |
-
com.comphenix.protocol.injector | -- |
Modifier and Type | -Method and Description | -
---|---|
PacketConstructor |
-ProtocolManager.createPacketConstructor(int id,
- java.lang.Object... arguments)
-Construct a packet using the special builtin Minecraft constructors.
- |
-
Modifier and Type | -Field and Description | -
---|---|
static PacketConstructor |
-PacketConstructor.DEFAULT
-A packet constructor that automatically converts Bukkit types to their NMS conterpart.
- |
-
Modifier and Type | -Method and Description | -
---|---|
PacketConstructor |
-PacketFilterManager.createPacketConstructor(int id,
- java.lang.Object... arguments) |
-
PacketConstructor |
-PacketConstructor.withPacket(int id,
- java.lang.Object[] values)
-Create a packet constructor that creates packets using the given types.
- |
-
PacketConstructor |
-PacketConstructor.withUnwrappers(java.util.List<PacketConstructor.Unwrapper> unwrappers)
-Return a copy of the current constructor with a different list of unwrappers.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.injector | -- |
com.comphenix.protocol.injector.player | -- |
Modifier and Type | -Method and Description | -
---|---|
PacketFilterManager.PlayerInjectHooks |
-PacketFilterManager.getPlayerHook()
-Retrieves how the server packets are read.
- |
-
static PacketFilterManager.PlayerInjectHooks |
-PacketFilterManager.PlayerInjectHooks.valueOf(java.lang.String name)
-Returns the enum constant of this type with the specified name.
- |
-
static PacketFilterManager.PlayerInjectHooks[] |
-PacketFilterManager.PlayerInjectHooks.values()
-Returns an array containing the constants of this enum type, in
-the order they are declared.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-PacketFilterManager.setPlayerHook(PacketFilterManager.PlayerInjectHooks playerHook)
-Sets how the server packets are read.
- |
-
Modifier and Type | -Method and Description | -
---|---|
PacketFilterManager.PlayerInjectHooks |
-NetworkObjectInjector.getHookType() |
-
PacketFilterManager.PlayerInjectHooks |
-PlayerInjectionHandler.getPlayerHook()
-Retrieves how the server packets are read.
- |
-
PacketFilterManager.PlayerInjectHooks |
-PlayerInjectionHandler.getPlayerHook(GamePhase phase)
-Retrieves how the server packets are read.
- |
-
Modifier and Type | -Method and Description | -
---|---|
void |
-PlayerInjectionHandler.setPlayerHook(GamePhase phase,
- PacketFilterManager.PlayerInjectHooks playerHook)
-Sets how the server packets are read.
- |
-
void |
-PlayerInjectionHandler.setPlayerHook(PacketFilterManager.PlayerInjectHooks playerHook)
-Sets how the server packets are read.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.concurrency | -- |
com.comphenix.protocol.injector | -- |
Modifier and Type | -Method and Description | -
---|---|
java.util.Collection<PrioritizedListener<TListener>> |
-AbstractConcurrentListenerMultimap.getListener(int packetID)
-Retrieve the registered listeners, in order from the lowest to the highest priority.
- |
-
java.lang.Iterable<PrioritizedListener<TListener>> |
-AbstractConcurrentListenerMultimap.values()
-Retrieve every listener.
- |
-
Modifier and Type | -Method and Description | -
---|---|
int |
-PrioritizedListener.compareTo(PrioritizedListener<TListener> other) |
-
Interface | -Description | -
---|---|
ListenerInvoker | -
- Represents an object that initiate the packet listeners.
- |
-
PacketConstructor.Unwrapper | -
- Represents a unwrapper for a constructor parameter.
- |
-
BukkitUnwrapper | -
- Represents an object capable of converting wrapped Bukkit objects into NMS objects.
- |
-|
DelayedSingleTask | -
- Represents a single delayed task.
- |
-|
PacketConstructor | -
- A packet constructor that uses an internal Minecraft.
- |
-|
PacketFilterManager | +SortedCopyOnWriteArrayTest | |
PrioritizedListener<TListener> | -
- Represents a listener with a priority.
- |
-|
SortedPacketListenerList | -
- Registry of synchronous packet listeners.
- |
-|
StructureCache | -
- Caches structure modifiers.
- |
-
Enum | -Description | -
---|---|
GamePhase | -
- The current player phase.
- |
-
PacketFilterManager.PlayerInjectHooks | -
- Sets the inject hook type.
- |
-
Exception | -Description | -
---|---|
PlayerLoggedOutException | -
- Invoked when attempting to use a player that has already logged out.
- |
-
Class and Description | -
---|
DelayedSingleTask
- Represents a single delayed task.
- |
-
GamePhase
- The current player phase.
- |
-
ListenerInvoker
- Represents an object that initiate the packet listeners.
- |
-
PacketConstructor
- A packet constructor that uses an internal Minecraft.
- |
-
PacketConstructor.Unwrapper
- Represents a unwrapper for a constructor parameter.
- |
-
PacketFilterManager.PlayerInjectHooks
- Sets the inject hook type.
- |
-
PlayerLoggedOutException
- Invoked when attempting to use a player that has already logged out.
- |
-
PrioritizedListener
- Represents a listener with a priority.
- |
-
Class and Description | -
---|
ListenerInvoker
- Represents an object that initiate the packet listeners.
- |
-
Class and Description | -
---|
GamePhase
- The current player phase.
- |
-
ListenerInvoker
- Represents an object that initiate the packet listeners.
- |
-
PacketFilterManager.PlayerInjectHooks
- Sets the inject hook type.
- |
-
Class and Description | -
---|
ListenerInvoker
- Represents an object that initiate the packet listeners.
- |
-
public interface PacketInjector
-Modifier and Type | -Method and Description | -
---|---|
boolean |
-addPacketHandler(int packetID)
-Start intercepting packets with the given packet ID.
- |
-
void |
-cleanupAll()
-Perform any necessary cleanup before unloading ProtocolLib.
- |
-
java.util.Set<java.lang.Integer> |
-getPacketHandlers()
-Retrieve every intercepted packet ID.
- |
-
boolean |
-hasPacketHandler(int packetID)
-Determine if packets with the given packet ID is being intercepted.
- |
-
PacketEvent |
-packetRecieved(PacketContainer packet,
- Player client)
-Let the packet listeners process the given packet.
- |
-
boolean |
-removePacketHandler(int packetID)
-Stop intercepting packets with the given packet ID.
- |
-
void |
-undoCancel(java.lang.Integer id,
- java.lang.Object packet)
-Undo a packet cancel.
- |
-
void undoCancel(java.lang.Integer id, - java.lang.Object packet)-
id
- - the id of the packet.packet
- - packet to uncancel.boolean addPacketHandler(int packetID)-
packetID
- - the ID of the packets to start intercepting.boolean removePacketHandler(int packetID)-
packetID
- - the ID of the packets to stop intercepting.boolean hasPacketHandler(int packetID)-
packetID
- - the packet ID to lookup.java.util.Set<java.lang.Integer> getPacketHandlers()-
PacketEvent packetRecieved(PacketContainer packet, - Player client)-
packet
- - a packet to process.client
- - the client that sent the packet.void cleanupAll()-
public class PacketInjectorBuilder
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
protected java.lang.ClassLoader |
-classLoader |
-
protected ListenerInvoker |
-invoker |
-
protected PlayerInjectionHandler |
-playerInjection |
-
protected ErrorReporter |
-reporter |
-
Modifier | -Constructor and Description | -
---|---|
protected |
-PacketInjectorBuilder() |
-
Modifier and Type | -Method and Description | -
---|---|
PacketInjector |
-buildInjector()
-Create a packet injector using the provided fields or the default values.
- |
-
PacketInjectorBuilder |
-classLoader(java.lang.ClassLoader classLoader)
-Set the class loader to use during class generation.
- |
-
PacketInjectorBuilder |
-invoker(ListenerInvoker invoker)
-The packet stream invoker.
- |
-
static PacketInjectorBuilder |
-newBuilder()
-Retrieve a new packet injector builder.
- |
-
PacketInjectorBuilder |
-playerInjection(PlayerInjectionHandler playerInjection)
-The packet stream invoker.
- |
-
PacketInjectorBuilder |
-reporter(ErrorReporter reporter)
-The error reporter used by the created injector.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected java.lang.ClassLoader classLoader-
protected ListenerInvoker invoker-
protected ErrorReporter reporter-
protected PlayerInjectionHandler playerInjection-
protected PacketInjectorBuilder()-
public static PacketInjectorBuilder newBuilder()-
public PacketInjectorBuilder classLoader(@Nonnull - java.lang.ClassLoader classLoader)-
classLoader
- - new class loader.public PacketInjectorBuilder reporter(@Nonnull - ErrorReporter reporter)-
reporter
- - new error reporter.public PacketInjectorBuilder invoker(@Nonnull - ListenerInvoker invoker)-
invoker
- - the invoker.@Nonnull -public PacketInjectorBuilder playerInjection(@Nonnull - PlayerInjectionHandler playerInjection)-
invoker
- - the invoker.public PacketInjector buildInjector() - throws java.lang.IllegalAccessException-
- Note that any non-null builder parameters must be set.
java.lang.IllegalAccessException
- If anything goes wrong in terms of reflection.public class PacketRegistry
-extends java.lang.Object
-Constructor and Description | -
---|
PacketRegistry() |
-
Modifier and Type | -Method and Description | -
---|---|
static java.util.Set<java.lang.Integer> |
-getClientPackets()
-Retrieve every known and supported client packet.
- |
-
static java.util.Map<java.lang.Integer,java.lang.Class> |
-getOverwrittenPackets()
-Retrieve the injected proxy classes handlig each packet ID.
- |
-
static java.lang.Class |
-getPacketClassFromID(int packetID)
-Retrieves the correct packet class from a given packet ID.
- |
-
static java.lang.Class |
-getPacketClassFromID(int packetID,
- boolean forceVanilla)
-Retrieves the correct packet class from a given packet ID.
- |
-
static int |
-getPacketID(java.lang.Class<?> packet)
-Retrieve the packet ID of a given packet.
- |
-
static java.util.Map<java.lang.Class,java.lang.Integer> |
-getPacketToID() |
-
static java.util.Map<java.lang.Integer,java.lang.Class> |
-getPreviousPackets()
-Retrieve the vanilla classes handling each packet ID.
- |
-
static java.util.Set<java.lang.Integer> |
-getServerPackets()
-Retrieve every known and supported server packet.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static java.util.Map<java.lang.Class,java.lang.Integer> getPacketToID()-
public static java.util.Map<java.lang.Integer,java.lang.Class> getOverwrittenPackets()-
public static java.util.Map<java.lang.Integer,java.lang.Class> getPreviousPackets()-
public static java.util.Set<java.lang.Integer> getServerPackets() - throws FieldAccessException-
FieldAccessException
- If we're unable to retrieve the server packet data from Minecraft.public static java.util.Set<java.lang.Integer> getClientPackets() - throws FieldAccessException-
FieldAccessException
- If we're unable to retrieve the client packet data from Minecraft.public static java.lang.Class getPacketClassFromID(int packetID)-
packetID
- - the packet ID.public static java.lang.Class getPacketClassFromID(int packetID, - boolean forceVanilla)-
packetID
- - the packet ID.forceVanilla
- - whether or not to look for vanilla classes, not injected classes.public static int getPacketID(java.lang.Class<?> packet)-
packet
- - the type of packet to check.java.lang.IllegalArgumentException
- If this is not a valid packet.Package | -Description | -
---|---|
com.comphenix.protocol.injector.packet | -- |
com.comphenix.protocol.injector.spigot | -- |
Modifier and Type | -Method and Description | -
---|---|
PacketInjector |
-PacketInjectorBuilder.buildInjector()
-Create a packet injector using the provided fields or the default values.
- |
-
Modifier and Type | -Method and Description | -
---|---|
PacketInjector |
-SpigotPacketInjector.getPacketInjector()
-Retrieve the dummy packet injection handler.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.injector.packet | -- |
Modifier and Type | -Method and Description | -
---|---|
PacketInjectorBuilder |
-PacketInjectorBuilder.classLoader(java.lang.ClassLoader classLoader)
-Set the class loader to use during class generation.
- |
-
PacketInjectorBuilder |
-PacketInjectorBuilder.invoker(ListenerInvoker invoker)
-The packet stream invoker.
- |
-
static PacketInjectorBuilder |
-PacketInjectorBuilder.newBuilder()
-Retrieve a new packet injector builder.
- |
-
PacketInjectorBuilder |
-PacketInjectorBuilder.playerInjection(PlayerInjectionHandler playerInjection)
-The packet stream invoker.
- |
-
PacketInjectorBuilder |
-PacketInjectorBuilder.reporter(ErrorReporter reporter)
-The error reporter used by the created injector.
- |
-
Interface | -Description | -
---|---|
PacketInjector | -
- Represents a incoming packet injector.
- |
-
Class | -Description | -
---|---|
PacketInjectorBuilder | -
- A builder responsible for creating incoming packet injectors.
- |
-
PacketRegistry | -
- Static packet registry in Minecraft.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.injector.packet | -- |
com.comphenix.protocol.injector.spigot | -- |
Class and Description | -
---|
PacketInjector
- Represents a incoming packet injector.
- |
-
PacketInjectorBuilder
- A builder responsible for creating incoming packet injectors.
- |
-
Class and Description | -
---|
PacketInjector
- Represents a incoming packet injector.
- |
-
public class NetworkObjectInjector
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
protected java.io.DataInputStream |
-cachedInput |
-
protected boolean |
-hasInitialized |
-
protected ListenerInvoker |
-invoker |
-
protected java.lang.Object |
-loginHandler |
-
protected java.lang.Object |
-netHandler |
-
protected static java.lang.reflect.Field |
-netHandlerField |
-
protected java.lang.Object |
-networkManager |
-
protected static java.lang.reflect.Field |
-networkManagerField |
-
protected VolatileField |
-networkManagerRef |
-
protected static StructureModifier<java.lang.Object> |
-networkModifier |
-
protected Player |
-player |
-
protected static java.lang.reflect.Method |
-processMethod |
-
protected static java.lang.reflect.Field |
-proxyServerField |
-
protected static java.lang.reflect.Method |
-queueMethod |
-
protected ErrorReporter |
-reporter |
-
protected java.lang.Runnable |
-scheduledAction |
-
protected java.lang.Object |
-serverHandler |
-
protected static java.lang.reflect.Field |
-serverHandlerField |
-
protected VolatileField |
-serverHandlerRef |
-
protected java.net.Socket |
-socket |
-
protected static java.lang.reflect.Field |
-socketField |
-
Constructor and Description | -
---|
NetworkObjectInjector(java.lang.ClassLoader classLoader,
- ErrorReporter reporter,
- Player player,
- ListenerInvoker invoker,
- IntegerSet sendingFilters)
-Create a new network object injector.
- |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-canInject(GamePhase phase)
-Determine if this inject method can even be attempted.
- |
-
com.comphenix.protocol.injector.player.UnsupportedListener |
-checkListener(PacketListener listener)
-Invoked before a new listener is registered.
- |
-
protected void |
-cleanHook()
-Override to add custom cleanup behavior.
- |
-
void |
-cleanupAll()
-Remove all hooks and modifications.
- |
-
Player |
-createTemporaryPlayer(Server server)
-Create a temporary player for use during login.
- |
-
void |
-disconnect(java.lang.String message)
-Attempt to disconnect the current client.
- |
-
java.net.SocketAddress |
-getAddress()
-Retrieve the associated address of this player.
- |
-
protected java.lang.Object |
-getEntityPlayer(Player player)
-Retrieve the notch (NMS) entity player object.
- |
-
PacketFilterManager.PlayerInjectHooks |
-getHookType()
-Retrieve the hook type this class represents.
- |
-
java.io.DataInputStream |
-getInputStream(boolean cache)
-Retrieve the current player's input stream.
- |
-
ListenerInvoker |
-getInvoker()
-Object that can invoke the packet events.
- |
-
protected java.lang.Object |
-getNetHandler()
-Retrieves the current net handler for this player.
- |
-
java.lang.Object |
-getNetworkManager()
-Retrieve the current network manager.
- |
-
Player |
-getPlayer()
-Retrieve the hooked player.
- |
-
java.net.Socket |
-getSocket()
-Retrieve the associated socket of this player.
- |
-
Player |
-getUpdatedPlayer()
-Retrieve the hooked player object OR the more up-to-date player instance.
- |
-
void |
-handleDisconnect()
-Clean up after the player has disconnected.
- |
-
java.lang.Object |
-handlePacketSending(java.lang.Object packet)
-Allows a packet to be sent by the listeners.
- |
-
protected boolean |
-hasListener(int packetID)
-Determine if the given injector is listening for this packet ID.
- |
-
protected boolean |
-hasProxyServerHandler()
-Retrieve whether or not the server handler is a proxy object.
- |
-
void |
-initialize(java.lang.Object injectionSource)
-Initialize all fields for this player injector, if it hasn't already.
- |
-
void |
-initializeLogin(java.lang.Object netLoginHandler)
-Initialize the player injector from a NetLoginHandler.
- |
-
void |
-initializePlayer(Player player)
-Initialize the player injector using an actual player instance.
- |
-
void |
-injectManager()
-Inject a hook to catch packets sent to the current player.
- |
-
boolean |
-isClean()
-Determine whether or not this hook has already been cleaned.
- |
-
void |
-processPacket(java.lang.Object packet)
-Processes the given packet as if it was transmitted by the current player.
- |
-
void |
-scheduleAction(java.lang.Runnable action)
-Schedule an action to occur on the next sent packet.
- |
-
void |
-sendServerPacket(java.lang.Object packet,
- boolean filtered)
-Send a packet to the client.
- |
-
void |
-setNetworkManager(java.lang.Object value,
- boolean force)
-Set the current network manager.
- |
-
void |
-setPlayer(Player player)
-Set the hooked player.
- |
-
void |
-setUpdatedPlayer(Player updatedPlayer)
-Set the real Bukkit player that we will use.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected static java.lang.reflect.Field serverHandlerField-
protected static java.lang.reflect.Field proxyServerField-
protected static java.lang.reflect.Field networkManagerField-
protected static java.lang.reflect.Field netHandlerField-
protected static java.lang.reflect.Field socketField-
protected static StructureModifier<java.lang.Object> networkModifier-
protected static java.lang.reflect.Method queueMethod-
protected static java.lang.reflect.Method processMethod-
protected Player player-
protected boolean hasInitialized-
protected VolatileField networkManagerRef-
protected VolatileField serverHandlerRef-
protected java.lang.Object networkManager-
protected java.lang.Object loginHandler-
protected java.lang.Object serverHandler-
protected java.lang.Object netHandler-
protected java.net.Socket socket-
protected ListenerInvoker invoker-
protected java.io.DataInputStream cachedInput-
protected ErrorReporter reporter-
protected java.lang.Runnable scheduledAction-
public NetworkObjectInjector(java.lang.ClassLoader classLoader, - ErrorReporter reporter, - Player player, - ListenerInvoker invoker, - IntegerSet sendingFilters) - throws java.lang.IllegalAccessException-
- Note: This class is intended to be internal. Do not use.
classLoader
- - the class loader.reporter
- - the error reporter.player
- - the player Bukkit entity.invoker
- - the packet invoker.sendingFilters
- - list of permitted packet IDs.java.lang.IllegalAccessException
- If reflection failed.protected boolean hasListener(int packetID)-
packetID
- - packet ID to check.public Player createTemporaryPlayer(Server server)-
server
- - Bukkit server.public void sendServerPacket(java.lang.Object packet, - boolean filtered) - throws java.lang.reflect.InvocationTargetException-
packet
- - server packet to send.filtered
- - whether or not the packet will be filtered by our listeners.java.lang.reflect.InvocationTargetException
public com.comphenix.protocol.injector.player.UnsupportedListener checkListener(PacketListener listener)-
- The player injector should only return a non-null value if some or all of the packet IDs are unsupported.
listener
- - the listener that is about to be registered.public void injectManager()-
protected void cleanHook()-
public void handleDisconnect()-
public boolean canInject(GamePhase phase)-
public PacketFilterManager.PlayerInjectHooks getHookType()-
protected java.lang.Object getEntityPlayer(Player player)-
player
- - the player to retrieve.public void initialize(java.lang.Object injectionSource) - throws java.lang.IllegalAccessException-
java.lang.IllegalAccessException
- An error has occured.public void initializePlayer(Player player)-
player
- - the player to hook.public void initializeLogin(java.lang.Object netLoginHandler)-
netLoginHandler
- - the net login handler to inject.protected boolean hasProxyServerHandler()-
public java.lang.Object getNetworkManager()-
public void setNetworkManager(java.lang.Object value, - boolean force)-
value
- - new network manager.force
- - whether or not to save this value.public java.net.Socket getSocket() - throws java.lang.IllegalAccessException-
java.lang.IllegalAccessException
- If we're unable to read the socket field.public java.net.SocketAddress getAddress() - throws java.lang.IllegalAccessException-
java.lang.IllegalAccessException
- If we're unable to read the socket field.public void disconnect(java.lang.String message) - throws java.lang.reflect.InvocationTargetException-
message
- - the message to display.java.lang.reflect.InvocationTargetException
- If disconnection failed.protected java.lang.Object getNetHandler() - throws java.lang.IllegalAccessException-
java.lang.IllegalAccessException
- Unable to find or retrieve net handler.public void processPacket(java.lang.Object packet) - throws java.lang.IllegalAccessException, - java.lang.reflect.InvocationTargetException-
packet
- - packet to process.java.lang.IllegalAccessException
- If the reflection machinery failed.java.lang.reflect.InvocationTargetException
- If the underlying method caused an error.public final void cleanupAll()-
public boolean isClean()-
public java.lang.Object handlePacketSending(java.lang.Object packet)-
packet
- - packet to sent.public java.io.DataInputStream getInputStream(boolean cache)-
cache
- - whether or not to cache the result of this method.public void scheduleAction(java.lang.Runnable action)-
action
- - action to execute.public Player getPlayer()-
public void setPlayer(Player player)-
- Should only be called during the creation of the injector.
player
- - the new hooked player.public ListenerInvoker getInvoker()-
public Player getUpdatedPlayer()-
public void setUpdatedPlayer(Player updatedPlayer)-
updatedPlayer
- - the real Bukkit player.public class NetworkServerInjector
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
protected java.io.DataInputStream |
-cachedInput |
-
protected boolean |
-hasInitialized |
-
protected static java.lang.reflect.Field |
-inputField |
-
protected ListenerInvoker |
-invoker |
-
protected java.lang.Object |
-loginHandler |
-
protected java.lang.Object |
-netHandler |
-
protected static java.lang.reflect.Field |
-netHandlerField |
-
protected java.lang.Object |
-networkManager |
-
protected static java.lang.reflect.Field |
-networkManagerField |
-
protected VolatileField |
-networkManagerRef |
-
protected static StructureModifier<java.lang.Object> |
-networkModifier |
-
protected org.bukkit.entity.Player |
-player |
-
protected static java.lang.reflect.Method |
-processMethod |
-
protected static java.lang.reflect.Field |
-proxyServerField |
-
protected static java.lang.reflect.Method |
-queueMethod |
-
protected ErrorReporter |
-reporter |
-
protected java.lang.Runnable |
-scheduledAction |
-
protected java.lang.Object |
-serverHandler |
-
protected static java.lang.reflect.Field |
-serverHandlerField |
-
protected VolatileField |
-serverHandlerRef |
-
protected java.net.Socket |
-socket |
-
protected static java.lang.reflect.Field |
-socketField |
-
Constructor and Description | -
---|
NetworkServerInjector(java.lang.ClassLoader classLoader,
- ErrorReporter reporter,
- org.bukkit.entity.Player player,
- ListenerInvoker invoker,
- com.comphenix.protocol.injector.player.IntegerSet sendingFilters,
- com.comphenix.protocol.injector.player.InjectedServerConnection serverInjection) |
-
Modifier and Type | -Method and Description | -
---|---|
boolean |
-canInject(GamePhase phase)
-Determine if this inject method can even be attempted.
- |
-
com.comphenix.protocol.injector.player.UnsupportedListener |
-checkListener(PacketListener listener)
-Invoked before a new listener is registered.
- |
-
protected void |
-cleanHook()
-Override to add custom cleanup behavior.
- |
-
void |
-cleanupAll()
-Remove all hooks and modifications.
- |
-
void |
-disconnect(java.lang.String message)
-Attempt to disconnect the current client.
- |
-
java.net.SocketAddress |
-getAddress()
-Retrieve the associated address of this player.
- |
-
protected java.lang.Object |
-getEntityPlayer(org.bukkit.entity.Player player)
-Retrieve the notch (NMS) entity player object.
- |
-
PacketFilterManager.PlayerInjectHooks |
-getHookType()
-Retrieve the hook type this class represents.
- |
-
java.io.DataInputStream |
-getInputStream(boolean cache)
-Retrieve the current player's input stream.
- |
-
ListenerInvoker |
-getInvoker()
-Object that can invoke the packet events.
- |
-
protected java.lang.Object |
-getNetHandler()
-Retrieves the current net handler for this player.
- |
-
java.lang.Object |
-getNetworkManager()
-Retrieve the current network manager.
- |
-
org.bukkit.entity.Player |
-getPlayer()
-Retrieve the hooked player.
- |
-
java.net.Socket |
-getSocket()
-Retrieve the associated socket of this player.
- |
-
org.bukkit.entity.Player |
-getUpdatedPlayer()
-Retrieve the hooked player object OR the more up-to-date player instance.
- |
-
void |
-handleDisconnect()
-Clean up after the player has disconnected.
- |
-
java.lang.Object |
-handlePacketSending(java.lang.Object packet)
-Allows a packet to be sent by the listeners.
- |
-
protected boolean |
-hasListener(int packetID)
-Determine if the given injector is listening for this packet ID.
- |
-
protected boolean |
-hasProxyServerHandler()
-Retrieve whether or not the server handler is a proxy object.
- |
-
void |
-initialize(java.lang.Object injectionSource)
-Initialize all fields for this player injector, if it hasn't already.
- |
-
void |
-initializeLogin(java.lang.Object netLoginHandler)
-Initialize the player injector for a NetLoginHandler instead.
- |
-
void |
-initializePlayer(java.lang.Object player)
-Initialize the player injector using an actual player instance.
- |
-
void |
-injectManager()
-Inject a hook to catch packets sent to the current player.
- |
-
boolean |
-isClean()
-Determine whether or not this hook has already been cleaned.
- |
-
void |
-processPacket(java.lang.Object packet)
-Processes the given packet as if it was transmitted by the current player.
- |
-
void |
-scheduleAction(java.lang.Runnable action)
-Schedule an action to occur on the next sent packet.
- |
-
void |
-sendServerPacket(java.lang.Object packet,
- boolean filtered)
-Send a packet to the client.
- |
-
void |
-setNetworkManager(java.lang.Object value,
- boolean force)
-Set the current network manager.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected static java.lang.reflect.Field serverHandlerField-
protected static java.lang.reflect.Field proxyServerField-
protected static java.lang.reflect.Field networkManagerField-
protected static java.lang.reflect.Field inputField-
protected static java.lang.reflect.Field netHandlerField-
protected static java.lang.reflect.Field socketField-
protected static StructureModifier<java.lang.Object> networkModifier-
protected static java.lang.reflect.Method queueMethod-
protected static java.lang.reflect.Method processMethod-
protected org.bukkit.entity.Player player-
protected boolean hasInitialized-
protected VolatileField networkManagerRef-
protected VolatileField serverHandlerRef-
protected java.lang.Object networkManager-
protected java.lang.Object loginHandler-
protected java.lang.Object serverHandler-
protected java.lang.Object netHandler-
protected java.net.Socket socket-
protected ListenerInvoker invoker-
protected java.io.DataInputStream cachedInput-
protected ErrorReporter reporter-
protected java.lang.Runnable scheduledAction-
public NetworkServerInjector(java.lang.ClassLoader classLoader, - ErrorReporter reporter, - org.bukkit.entity.Player player, - ListenerInvoker invoker, - com.comphenix.protocol.injector.player.IntegerSet sendingFilters, - com.comphenix.protocol.injector.player.InjectedServerConnection serverInjection) - throws java.lang.IllegalAccessException-
java.lang.IllegalAccessException
protected boolean hasListener(int packetID)-
packetID
- - packet ID to check.public void initialize(java.lang.Object injectionSource) - throws java.lang.IllegalAccessException-
java.lang.IllegalAccessException
- An error has occured.public void sendServerPacket(java.lang.Object packet, - boolean filtered) - throws java.lang.reflect.InvocationTargetException-
packet
- - server packet to send.filtered
- - whether or not the packet will be filtered by our listeners.java.lang.reflect.InvocationTargetException
public void injectManager()-
protected void cleanHook()-
public void handleDisconnect()-
public com.comphenix.protocol.injector.player.UnsupportedListener checkListener(PacketListener listener)-
- The player injector should only return a non-null value if some or all of the packet IDs are unsupported.
listener
- - the listener that is about to be registered.public boolean canInject(GamePhase phase)-
public PacketFilterManager.PlayerInjectHooks getHookType()-
protected java.lang.Object getEntityPlayer(org.bukkit.entity.Player player)-
player
- - the player to retrieve.public void initializePlayer(java.lang.Object player)-
player
- - the player to hook.public void initializeLogin(java.lang.Object netLoginHandler)-
netLoginHandler
- - the net login handler to inject.protected boolean hasProxyServerHandler()-
public java.lang.Object getNetworkManager()-
public void setNetworkManager(java.lang.Object value, - boolean force)-
value
- - new network manager.force
- - whether or not to save this value.public java.net.Socket getSocket() - throws java.lang.IllegalAccessException-
java.lang.IllegalAccessException
- If we're unable to read the socket field.public java.net.SocketAddress getAddress() - throws java.lang.IllegalAccessException-
java.lang.IllegalAccessException
- If we're unable to read the socket field.public void disconnect(java.lang.String message) - throws java.lang.reflect.InvocationTargetException-
message
- - the message to display.java.lang.reflect.InvocationTargetException
- If disconnection failed.protected java.lang.Object getNetHandler() - throws java.lang.IllegalAccessException-
java.lang.IllegalAccessException
- Unable to find or retrieve net handler.public void processPacket(java.lang.Object packet) - throws java.lang.IllegalAccessException, - java.lang.reflect.InvocationTargetException-
packet
- - packet to process.java.lang.IllegalAccessException
- If the reflection machinery failed.java.lang.reflect.InvocationTargetException
- If the underlying method caused an error.public final void cleanupAll()-
public boolean isClean()-
public java.lang.Object handlePacketSending(java.lang.Object packet)-
packet
- - packet to sent.public java.io.DataInputStream getInputStream(boolean cache)-
cache
- - whether or not to cache the result of this method.public void scheduleAction(java.lang.Runnable action)-
action
- - action to execute.public org.bukkit.entity.Player getPlayer()-
public ListenerInvoker getInvoker()-
public org.bukkit.entity.Player getUpdatedPlayer()-
public interface PlayerInjectionHandler
-Modifier and Type | -Method and Description | -
---|---|
void |
-addPacketHandler(int packetID)
-Add an underlying packet handler of the given ID.
- |
-
void |
-checkListener(PacketListener listener)
-Determine if a listener is valid or not.
- |
-
void |
-checkListener(java.util.Set<PacketListener> listeners)
-Determine if the given listeners are valid.
- |
-
void |
-close()
-Close any lingering proxy injections.
- |
-
Player |
-getPlayerByConnection(java.io.DataInputStream inputStream)
-Retrieve a player by its DataInput connection.
- |
-
Player |
-getPlayerByConnection(java.io.DataInputStream inputStream,
- long playerTimeout,
- java.util.concurrent.TimeUnit unit)
-Retrieve a player by its DataInput connection.
- |
-
PacketFilterManager.PlayerInjectHooks |
-getPlayerHook()
-Retrieves how the server packets are read.
- |
-
PacketFilterManager.PlayerInjectHooks |
-getPlayerHook(GamePhase phase)
-Retrieves how the server packets are read.
- |
-
java.util.Set<java.lang.Integer> |
-getSendingFilters()
-Retrieve the current list of registered sending listeners.
- |
-
void |
-handleDisconnect(Player player)
-Invoke special routines for handling disconnect before a player is uninjected.
- |
-
void |
-injectPlayer(Player player)
-Initialize a player hook, allowing us to read server packets.
- |
-
void |
-processPacket(Player player,
- java.lang.Object mcPacket)
-Process a packet as if it were sent by the given player.
- |
-
void |
-removePacketHandler(int packetID)
-Remove an underlying packet handler of ths ID.
- |
-
void |
-scheduleDataInputRefresh(Player player)
-Inform the current PlayerInjector that it should update the DataInputStream next.
- |
-
void |
-sendServerPacket(Player reciever,
- PacketContainer packet,
- boolean filters)
-Send the given packet to the given reciever.
- |
-
void |
-setPlayerHook(GamePhase phase,
- PacketFilterManager.PlayerInjectHooks playerHook)
-Sets how the server packets are read.
- |
-
void |
-setPlayerHook(PacketFilterManager.PlayerInjectHooks playerHook)
-Sets how the server packets are read.
- |
-
boolean |
-uninjectPlayer(java.net.InetSocketAddress address)
-Unregisters a player by the given address.
- |
-
boolean |
-uninjectPlayer(Player player)
-Unregisters the given player.
- |
-
PacketFilterManager.PlayerInjectHooks getPlayerHook()-
PacketFilterManager.PlayerInjectHooks getPlayerHook(GamePhase phase)-
phase
- - the current game phase.void setPlayerHook(PacketFilterManager.PlayerInjectHooks playerHook)-
playerHook
- - the new injection method for reading server packets.void setPlayerHook(GamePhase phase, - PacketFilterManager.PlayerInjectHooks playerHook)-
phase
- - the current game phase.playerHook
- - the new injection method for reading server packets.void addPacketHandler(int packetID)-
packetID
- - packet ID to register.void removePacketHandler(int packetID)-
packetID
- - packet ID to unregister.Player getPlayerByConnection(java.io.DataInputStream inputStream) - throws java.lang.InterruptedException-
inputStream
- - the associated DataInput connection.java.lang.InterruptedException
- If the thread was interrupted during the wait.Player getPlayerByConnection(java.io.DataInputStream inputStream, - long playerTimeout, - java.util.concurrent.TimeUnit unit) - throws java.lang.InterruptedException-
inputStream
- - the associated DataInput connection.playerTimeout
- - the amount of time to wait for a result.unit
- - unit of playerTimeout.java.lang.InterruptedException
- If the thread was interrupted during the wait.void injectPlayer(Player player)-
- This call will be ignored if there's no listener that can receive the given events.
player
- - player to hook.void handleDisconnect(Player player)-
player
- - player to process.boolean uninjectPlayer(Player player)-
player
- - player to unregister.boolean uninjectPlayer(java.net.InetSocketAddress address)-
- If the server handler has been created before we've gotten a chance to unject the player, - the method will try a workaround to remove the injected hook in the NetServerHandler.
address
- - address of the player to unregister.void sendServerPacket(Player reciever, - PacketContainer packet, - boolean filters) - throws java.lang.reflect.InvocationTargetException-
reciever
- - the player receiver.packet
- - the packet to send.filters
- - whether or not to invoke the packet filters.java.lang.reflect.InvocationTargetException
- If an error occured during sending.void processPacket(Player player, - java.lang.Object mcPacket) - throws java.lang.IllegalAccessException, - java.lang.reflect.InvocationTargetException-
player
- - the sender.mcPacket
- - the packet to process.java.lang.IllegalAccessException
- If the reflection machinery failed.java.lang.reflect.InvocationTargetException
- If the underlying method caused an error.void checkListener(java.util.Set<PacketListener> listeners)-
listeners
- - listeners to check.void checkListener(PacketListener listener)-
- If not, a warning will be printed to the console.
listener
- - listener to check.java.util.Set<java.lang.Integer> getSendingFilters()-
void close()-
void scheduleDataInputRefresh(Player player)-
player
- - the player to update.public class PlayerInjectorBuilder
-extends java.lang.Object
-Modifier and Type | -Field and Description | -
---|---|
protected java.lang.ClassLoader |
-classLoader |
-
protected com.google.common.base.Predicate<GamePhase> |
-injectionFilter |
-
protected ListenerInvoker |
-invoker |
-
protected java.util.Set<PacketListener> |
-packetListeners |
-
protected ErrorReporter |
-reporter |
-
protected Server |
-server |
-
Modifier | -Constructor and Description | -
---|---|
protected |
-PlayerInjectorBuilder() |
-
Modifier and Type | -Method and Description | -
---|---|
PlayerInjectionHandler |
-buildHandler()
-Construct the injection handler.
- |
-
PlayerInjectorBuilder |
-classLoader(java.lang.ClassLoader classLoader)
-Set the class loader to use during class generation.
- |
-
PlayerInjectorBuilder |
-injectionFilter(com.google.common.base.Predicate<GamePhase> injectionFilter)
-The injection filter that is used to determine if it is necessary to perform
- injection during a certain phase.
- |
-
PlayerInjectorBuilder |
-invoker(ListenerInvoker invoker)
-The packet stream invoker.
- |
-
static PlayerInjectorBuilder |
-newBuilder() |
-
PlayerInjectorBuilder |
-packetListeners(java.util.Set<PacketListener> packetListeners)
-Set the set of packet listeners.
- |
-
PlayerInjectorBuilder |
-reporter(ErrorReporter reporter)
-The error reporter used by the created injector.
- |
-
PlayerInjectorBuilder |
-server(Server server)
-Set the Bukkit server used for scheduling.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected java.lang.ClassLoader classLoader-
protected ErrorReporter reporter-
protected com.google.common.base.Predicate<GamePhase> injectionFilter-
protected ListenerInvoker invoker-
protected java.util.Set<PacketListener> packetListeners-
protected Server server-
protected PlayerInjectorBuilder()-
public static PlayerInjectorBuilder newBuilder()-
public PlayerInjectorBuilder classLoader(@Nonnull - java.lang.ClassLoader classLoader)-
classLoader
- - new class loader.public PlayerInjectorBuilder reporter(@Nonnull - ErrorReporter reporter)-
reporter
- - new error reporter.@Nonnull -public PlayerInjectorBuilder injectionFilter(@Nonnull - com.google.common.base.Predicate<GamePhase> injectionFilter)-
injectionFilter
- - filter predicate.public PlayerInjectorBuilder invoker(@Nonnull - ListenerInvoker invoker)-
invoker
- - the invoker.@Nonnull -public PlayerInjectorBuilder packetListeners(@Nonnull - java.util.Set<PacketListener> packetListeners)-
packetListeners
- - packet listeners.public PlayerInjectorBuilder server(@Nonnull - Server server)-
server
- - the Bukkit server.public PlayerInjectionHandler buildHandler()-
- Any builder parameter marked as NON-NULL is essential and must be initialized.
Package | -Description | -
---|---|
com.comphenix.protocol.injector.packet | -- |
com.comphenix.protocol.injector.player | -- |
com.comphenix.protocol.injector.spigot | -- |
Modifier and Type | -Field and Description | -
---|---|
protected PlayerInjectionHandler |
-PacketInjectorBuilder.playerInjection |
-
Modifier and Type | -Method and Description | -
---|---|
PacketInjectorBuilder |
-PacketInjectorBuilder.playerInjection(PlayerInjectionHandler playerInjection)
-The packet stream invoker.
- |
-
Modifier and Type | -Method and Description | -
---|---|
PlayerInjectionHandler |
-PlayerInjectorBuilder.buildHandler()
-Construct the injection handler.
- |
-
Modifier and Type | -Method and Description | -
---|---|
PlayerInjectionHandler |
-SpigotPacketInjector.getPlayerHandler()
-Retrieve the dummy player injection handler.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.injector.player | -- |
Modifier and Type | -Method and Description | -
---|---|
PlayerInjectorBuilder |
-PlayerInjectorBuilder.classLoader(java.lang.ClassLoader classLoader)
-Set the class loader to use during class generation.
- |
-
PlayerInjectorBuilder |
-PlayerInjectorBuilder.injectionFilter(com.google.common.base.Predicate<GamePhase> injectionFilter)
-The injection filter that is used to determine if it is necessary to perform
- injection during a certain phase.
- |
-
PlayerInjectorBuilder |
-PlayerInjectorBuilder.invoker(ListenerInvoker invoker)
-The packet stream invoker.
- |
-
static PlayerInjectorBuilder |
-PlayerInjectorBuilder.newBuilder() |
-
PlayerInjectorBuilder |
-PlayerInjectorBuilder.packetListeners(java.util.Set<PacketListener> packetListeners)
-Set the set of packet listeners.
- |
-
PlayerInjectorBuilder |
-PlayerInjectorBuilder.reporter(ErrorReporter reporter)
-The error reporter used by the created injector.
- |
-
PlayerInjectorBuilder |
-PlayerInjectorBuilder.server(Server server)
-Set the Bukkit server used for scheduling.
- |
-
Interface | -Description | -
---|---|
PlayerInjectionHandler | -- |
Class | -Description | -
---|---|
NetworkObjectInjector | -
- Injection method that overrides the NetworkHandler itself, and its queue-method.
- |
-
PlayerInjectorBuilder | -
- Constructor for different player injectors.
- |
-
Package | -Description | -
---|---|
com.comphenix.protocol.injector.packet | -- |
com.comphenix.protocol.injector.player | -- |
com.comphenix.protocol.injector.spigot | -- |
Class and Description | -
---|
PlayerInjectionHandler | -
Class and Description | -
---|
PlayerInjectionHandler | -
PlayerInjectorBuilder
- Constructor for different player injectors.
- |
-
Class and Description | -
---|
PlayerInjectionHandler | -
public class SpigotPacketInjector
-extends java.lang.Object
-Constructor and Description | -
---|
SpigotPacketInjector(java.lang.ClassLoader classLoader,
- ErrorReporter reporter,
- ListenerInvoker invoker,
- Server server)
-Create a new spigot injector.
- |
-
Modifier and Type | -Method and Description | -
---|---|
static boolean |
-canUseSpigotListener()
-Determine if there is a Spigot packet listener.
- |
-
PacketInjector |
-getPacketInjector()
-Retrieve the dummy packet injection handler.
- |
-
PlayerInjectionHandler |
-getPlayerHandler()
-Retrieve the dummy player injection handler.
- |
-
boolean |
-hasRegistered()
-Determine if the Spigot packet listener has been registered.
- |
-
java.lang.Object |
-packetQueued(java.lang.Object networkManager,
- java.lang.Object connection,
- java.lang.Object packet)
-Called when a packet is queued to be sent.
- |
-
java.lang.Object |
-packetReceived(java.lang.Object networkManager,
- java.lang.Object connection,
- java.lang.Object packet)
-Called when a packet has been received and is about to be handled by the
- current Connection.
- |
-
boolean |
-register(Plugin plugin)
-Register the Spigot packet injector.
- |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public SpigotPacketInjector(java.lang.ClassLoader classLoader, - ErrorReporter reporter, - ListenerInvoker invoker, - Server server)-
public static boolean canUseSpigotListener()-
public boolean register(Plugin plugin)-
plugin
- - the parent plugin.public boolean hasRegistered()-
public PlayerInjectionHandler getPlayerHandler()-
public PacketInjector getPacketInjector()-
public java.lang.Object packetReceived(java.lang.Object networkManager, - java.lang.Object connection, - java.lang.Object packet)-
- The returned packet will be the packet passed on for handling, or in the case of - null being returned, not handled at all.
networkManager
- - the NetworkManager receiving the packetconnection
- - the connection which will handle the packetpacket
- - the received packetpublic java.lang.Object packetQueued(java.lang.Object networkManager, - java.lang.Object connection, - java.lang.Object packet)-
- The returned packet will be the packet sent. In the case of null being returned, - the packet will not be sent.
networkManager
- - the NetworkManager which will send the packetconnection
- - the connection which queued the packetpacket
- - the queue packetClass | -Description | -
---|---|
SpigotPacketInjector | -
- Offload all the work to Spigot, if possible.
- |
-
public final class PrimitiveUtils
-extends java.lang.Object
-Modifier and Type | -Method and Description | -
---|---|
static <T> T |
-checkNotNull(T obj) |
-
static boolean |
-isPrimitive(java.lang.reflect.Type type)
-Returns true if this type is a primitive.
- |
-
static boolean |
-isWrapperType(java.lang.reflect.Type type)
-Returns
-true if type is one of the nine primitive-wrapper
- types, such as Integer . |
-
static <T> java.lang.Class<T> |
-unwrap(java.lang.Class<T> type)
-Returns the corresponding primitive type of
-type if it is a
- wrapper type; otherwise returns type itself. |
-
static <T> java.lang.Class<T> |
-wrap(java.lang.Class<T> type)
-Returns the corresponding wrapper type of
-type if it is a
- primitive type; otherwise returns type itself. |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static boolean isPrimitive(java.lang.reflect.Type type)-
public static boolean isWrapperType(java.lang.reflect.Type type)-
true
if type
is one of the nine primitive-wrapper
- types, such as Integer
.Class.isPrimitive()
public static <T> java.lang.Class<T> wrap(java.lang.Class<T> type)-
type
if it is a
- primitive type; otherwise returns type
itself. Idempotent.
-
- - wrap(int.class) == Integer.class - wrap(Integer.class) == Integer.class - wrap(String.class) == String.class -
public static <T> java.lang.Class<T> unwrap(java.lang.Class<T> type)-
type
if it is a
- wrapper type; otherwise returns type
itself. Idempotent.
-
- - unwrap(Integer.class) == int.class - unwrap(int.class) == int.class - unwrap(String.class) == String.class -
public static <T> T checkNotNull(T obj)-
static ReportType
REPORT_CANNOT_COMPILE_STRUCTURE_MODIFIER
static ReportType
REPORT_CANNOT_SCHEDULE_COMPILATION
static int
SHUTDOWN_DELAY_MS
public static final ReportType REPORT_CANNOT_COMPILE_STRUCTURE_MODIFIER+
public static final ReportType REPORT_CANNOT_SCHEDULE_COMPILATION+
Modifier and Type | +Field and Description | +
---|---|
static ReportType |
+REPORT_TOO_MANY_GENERATED_CLASSES |
+
public static final ReportType REPORT_TOO_MANY_GENERATED_CLASSES+
protected int
combineRounds(java.lang.Integer... rounds)
+protected int
combineRounds(int roundA,
int roundB)
int
compareTo(AbstractFuzzyMatcher<T> obj)
int
getRoundNumber()
AbstractFuzzyMatcher<T>
inverted()
abstract boolean
isMatch(T value,
java.lang.Object parent)
AbstractFuzzyMatcher<T>
or(AbstractFuzzyMatcher<T> other)
protected final int combineRounds(java.lang.Integer... rounds)+
rounds
- - the round numbers.and, combineRounds, compareTo, getRoundNumber, inverted, or
+and, combineRounds, combineRounds, compareTo, getRoundNumber, inverted, or
FuzzyClassContract.Builder
baseclass(AbstractFuzzyMatcher<java.lang.Class<?>> matcher)
+FuzzyClassContract.Builder
baseclass(FuzzyClassContract.Builder builder)
+FuzzyClassContract
build()
FuzzyClassContract.Builder
interfaces(AbstractFuzzyMatcher<java.lang.Class<?>> matcher)
+FuzzyClassContract.Builder
interfaces(FuzzyClassContract.Builder builder)
+FuzzyClassContract.Builder
method(AbstractFuzzyMatcher<MethodInfo> matcher)
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.com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.Class<?>>>
getBaseclassContracts()
+com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>>
getConstructorContracts()
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.reflect.Field>>
getFieldContracts()
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.Class<?>>>
getInterfaceContracts()
+com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>>
getMethodContracts()
@@ -196,7 +208,7 @@ extends AbstractFuzzyMatcher
-and, combineRounds, compareTo, getRoundNumber, inverted, or
+and, combineRounds, combineRounds, compareTo, getRoundNumber, inverted, or
+
+
+
+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.
and, combineRounds, compareTo, getRoundNumber, inverted, or
+and, combineRounds, combineRounds, compareTo, getRoundNumber, inverted, or
and, combineRounds, compareTo, getRoundNumber, inverted, or
and, combineRounds, combineRounds, compareTo, getRoundNumber, inverted, or
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.Class<?>>>
getBaseclassContracts()
+com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>>
getConstructorContracts()
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.reflect.Field>>
getFieldContracts()
com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<java.lang.Class<?>>>
getInterfaceContracts()
+com.google.common.collect.ImmutableList<AbstractFuzzyMatcher<MethodInfo>>
getMethodContracts()
@@ -332,48 +344,60 @@
FuzzyClassContract.Builder
baseclass(AbstractFuzzyMatcher<java.lang.Class<?>> matcher)
+int
compareTo(AbstractFuzzyMatcher<T> obj)
FuzzyClassContract.Builder
constructor(AbstractFuzzyMatcher<MethodInfo> matcher)
FuzzyMethodContract.Builder
declaringClassMatching(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
FuzzyFieldContract.Builder
declaringClassMatching(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
AbstractFuzzyMember.Builder<T>
declaringClassMatching(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
FuzzyMethodContract.Builder
exceptionMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher)
FuzzyMethodContract.Builder
exceptionMatches(AbstractFuzzyMatcher<java.lang.Class<?>> classMatcher,
int index)
FuzzyClassContract.Builder
field(AbstractFuzzyMatcher<java.lang.reflect.Field> matcher)
FuzzyClassContract.Builder
interfaces(AbstractFuzzyMatcher<java.lang.Class<?>> matcher)
+FuzzyClassContract.Builder
method(AbstractFuzzyMatcher<MethodInfo> matcher)
diff --git a/Javadoc/com/comphenix/protocol/reflect/fuzzy/class-use/AbstractFuzzyMember.Builder.html b/Javadoc/com/comphenix/protocol/reflect/fuzzy/class-use/AbstractFuzzyMember.Builder.html
index 8f823678..4be32847 100644
--- a/Javadoc/com/comphenix/protocol/reflect/fuzzy/class-use/AbstractFuzzyMember.Builder.html
+++ b/Javadoc/com/comphenix/protocol/reflect/fuzzy/class-use/AbstractFuzzyMember.Builder.html
@@ -2,9 +2,9 @@
-
+
FuzzyClassContract.Builder
baseclass(AbstractFuzzyMatcher<java.lang.Class<?>> matcher)
+FuzzyClassContract.Builder
baseclass(FuzzyClassContract.Builder builder)
+FuzzyClassContract.Builder
constructor(AbstractFuzzyMatcher<MethodInfo> matcher)
FuzzyClassContract.Builder
interfaces(AbstractFuzzyMatcher<java.lang.Class<?>> matcher)
+FuzzyClassContract.Builder
interfaces(FuzzyClassContract.Builder builder)
+FuzzyClassContract.Builder
method(AbstractFuzzyMatcher<MethodInfo> matcher)
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.
+ |
+
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.static PlayerLoggedOutException
fromFormat(java.lang.String message,
- java.lang.Object... params)
-static <TValue> java.util.List<TValue>
getDecoratedList(java.lang.Object troveList)
+static <TKey,TValue>
java.util.Map<TKey,TValue>
getDecoratedMap(java.lang.Object troveMap)
+static <TValue> java.util.Set<TValue>
getDecoratedSet(java.lang.Object troveSet)
+addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public PlayerLoggedOutException()-
public PlayerLoggedOutException(java.lang.String message, - java.lang.Throwable cause)-
public PlayerLoggedOutException(java.lang.String message)-
public PlayerLoggedOutException(java.lang.Throwable cause)+
public TroveWrapper()
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 PlayerLoggedOutException fromFormat(java.lang.String message, - java.lang.Object... params)-
message
- - the message to format.params
- - parameters.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 interface NbtBase<TType>
diff --git a/Javadoc/com/comphenix/protocol/wrappers/nbt/NbtCompound.html b/Javadoc/com/comphenix/protocol/wrappers/nbt/NbtCompound.html
index bb24d7d6..84650e05 100644
--- a/Javadoc/com/comphenix/protocol/wrappers/nbt/NbtCompound.html
+++ b/Javadoc/com/comphenix/protocol/wrappers/nbt/NbtCompound.html
@@ -2,9 +2,9 @@
-
+
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
NbtType
getType()
static NbtType
getTypeFromClass(java.lang.Class<?> clazz)
static NbtType
getTypeFromID(int rawID)
static NbtType
valueOf(java.lang.String name)
static NbtType[]
values()
boolean
accept(NbtVisitor visitor)
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