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.
|
protected java.lang.ClassLoader classLoader
protected ListenerInvoker invoker
protected ErrorReporter reporter
protected PlayerInjectionHandler playerInjection
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.