Package com.comphenix.protocol.injector
Class PacketFilterBuilder
java.lang.Object
com.comphenix.protocol.injector.PacketFilterBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Create a new packet filter manager.classLoader(ClassLoader classLoader)Update the current class loader.Retrieve the asynchronous manager.Retrieve the class loader set in this builder.org.bukkit.plugin.PluginRetrieve a reference to the current ProtocolLib instance.Retrieve the current Minecraft version.Retrieve the error reporter.org.bukkit.ServerRetrieve the current CraftBukkit server.Retrieve the task that is used to delay unhooking when ProtocolLib is no in use.booleanDetermine if we should prepare to hook Netty in Spigot.library(org.bukkit.plugin.Plugin library)Set a reference to the plugin instance of ProtocolLib.minecraftVersion(MinecraftVersion mcVersion)Set the current Minecraft version.reporter(ErrorReporter reporter)Set the error reporter.server(org.bukkit.Server server)Set the current server.unhookTask(DelayedSingleTask unhookTask)Set the task used to delay unhooking when ProtocolLib is no in use.
-
Constructor Details
-
PacketFilterBuilder
public PacketFilterBuilder()
-
-
Method Details
-
classLoader
Update the current class loader.- Parameters:
classLoader- - current class loader.- Returns:
- This builder, for chaining.
-
server
Set the current server.- Parameters:
server- - current server.- Returns:
- This builder, for chaining.
-
library
Set a reference to the plugin instance of ProtocolLib.- Parameters:
library- - plugin instance.- Returns:
- This builder, for chaining.
-
minecraftVersion
Set the current Minecraft version.- Parameters:
mcVersion- - Minecraft version.- Returns:
- This builder, for chaining.
-
unhookTask
Set the task used to delay unhooking when ProtocolLib is no in use.- Parameters:
unhookTask- - the unhook task.- Returns:
- This builder, for chaining.
-
reporter
Set the error reporter.- Parameters:
reporter- - new error reporter.- Returns:
- This builder, for chaining.
-
isNettyEnabled
public boolean isNettyEnabled()Determine if we should prepare to hook Netty in Spigot.This is calculated in the
build()method.- Returns:
- TRUE if we should, FALSE otherwise.
-
getClassLoader
Retrieve the class loader set in this builder.- Returns:
- The class loader.
-
getServer
public org.bukkit.Server getServer()Retrieve the current CraftBukkit server.- Returns:
- Current server.
-
getLibrary
public org.bukkit.plugin.Plugin getLibrary()Retrieve a reference to the current ProtocolLib instance.- Returns:
- ProtocolLib.
-
getMinecraftVersion
Retrieve the current Minecraft version.- Returns:
- Current version.
-
getUnhookTask
Retrieve the task that is used to delay unhooking when ProtocolLib is no in use.- Returns:
- The unhook task.
-
getReporter
Retrieve the error reporter.- Returns:
- Error reporter.
-
getAsyncManager
Retrieve the asynchronous manager.This is first constructed the
build()method.- Returns:
- The asynchronous manager.
-
build
Create a new packet filter manager.- Returns:
- A new packet filter manager.
-