Package com.comphenix.protocol.injector
Class BukkitUnwrapper
java.lang.Object
com.comphenix.protocol.injector.BukkitUnwrapper
- All Implemented Interfaces:
PacketConstructor.Unwrapper
Represents an object capable of converting wrapped Bukkit objects into NMS objects.
Typical conversions include:
- org.bukkit.entity.Player to net.minecraft.server.EntityPlayer
- org.bukkit.World to net.minecraft.server.WorldServer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ReportTypestatic final ReportTypestatic final ReportTypestatic final ReportType -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new Bukkit unwrapper with ProtocolLib's default error reporter.BukkitUnwrapper(ErrorReporter reporter) Construct a new Bukkit unwrapper with the given error reporter. -
Method Summary
Modifier and TypeMethodDescriptionstatic BukkitUnwrapperRetrieve the default instance of the Bukkit unwrapper.unwrapItem(Object wrappedObject) Convert the given wrapped object to the equivalent net.minecraft.server object.
-
Field Details
-
REPORT_ILLEGAL_ARGUMENT
-
REPORT_SECURITY_LIMITATION
-
REPORT_CANNOT_FIND_UNWRAP_METHOD
-
REPORT_CANNOT_READ_FIELD_HANDLE
-
-
Constructor Details
-
BukkitUnwrapper
public BukkitUnwrapper()Construct a new Bukkit unwrapper with ProtocolLib's default error reporter. -
BukkitUnwrapper
Construct a new Bukkit unwrapper with the given error reporter.- Parameters:
reporter- - the error reporter to use.
-
-
Method Details
-
getInstance
Retrieve the default instance of the Bukkit unwrapper.- Returns:
- The default instance.
-
unwrapItem
Description copied from interface:PacketConstructor.UnwrapperConvert the given wrapped object to the equivalent net.minecraft.server object.Note that we may pass in a class instead of object - in that case, the unwrapper should return the equivalent NMS class.
- Specified by:
unwrapItemin interfacePacketConstructor.Unwrapper- Parameters:
wrappedObject- - wrapped object or class.- Returns:
- The equivalent net.minecraft.server object or class.
-