public interface PacketHandler
Modifier and Type | Method and Description |
---|---|
org.bukkit.map.MapCursor |
constructMapCursor(int x,
int y,
double yaw,
org.bukkit.map.MapCursor.Type cursorType,
java.lang.String name)
Construct a MapCursor with the following params.
|
double |
getTPS()
Get the current TPS of the Minecraft server.
|
GeneralUtil |
getUtil()
Get the
GeneralUtil for this PacketHandler. |
MinimapPalette |
getVanillaPalette()
Get the vanilla MinimapPalette, per version.
|
boolean |
isMapRegistered(int id)
Check if the id provided is a Cartographer2 map.
|
default boolean |
mapBug()
Check if the Minecraft version contains freezing maps.
|
java.lang.Object |
onPacketInterceptIn(org.bukkit.entity.Player player,
java.lang.Object packet)
Called before a packet gets sent from player to server.
|
java.lang.Object |
onPacketInterceptOut(org.bukkit.entity.Player player,
java.lang.Object packet)
Called before a packet gets sent from server to player.
|
boolean |
registerCommand(org.bukkit.command.PluginCommand command)
Register a command with the default fallback prefix.
|
boolean |
registerCommand(java.lang.String fallbackPrefix,
org.bukkit.command.PluginCommand command)
Register a command with the fallback prefix indicated.
|
void |
registerMap(int id)
Register a MapView with Cartographer2.
|
void |
sendDataTo(int id,
byte[] data,
org.bukkit.map.MapCursor[] cursors,
java.util.UUID... uuids)
Send map data to the client.
|
void |
unregisterCommand(org.bukkit.command.PluginCommand command)
Unregister a command.
|
void |
unregisterMap(int id)
Unregister a MapView with Cartographer2.
|
java.lang.Object onPacketInterceptOut(org.bukkit.entity.Player player, java.lang.Object packet)
player
- The player receiving the packet.packet
- The packet being sent.java.lang.Object onPacketInterceptIn(org.bukkit.entity.Player player, java.lang.Object packet)
player
- The player sending the packet.packet
- The packet being received.boolean isMapRegistered(int id)
id
- The id of a Bukkit MapView.void unregisterMap(int id)
id
- The id of a Bukkit MapView.void registerMap(int id)
id
- The id of a Bukkit MapViewvoid sendDataTo(int id, byte[] data, org.bukkit.map.MapCursor[] cursors, java.util.UUID... uuids)
id
- The id of the Bukkit MapView.data
- An array of data with size of 128 * 128.cursors
- An array of MapCursors on the map.uuids
- An array of the UUID of players receiving this data.MinimapPalette getVanillaPalette()
default boolean mapBug()
org.bukkit.map.MapCursor constructMapCursor(int x, int y, double yaw, org.bukkit.map.MapCursor.Type cursorType, java.lang.String name)
x
- The x position on the map, from -128 to 127.y
- The y position on the map, from -128 to 127.yaw
- The yaw of the cursor, in degrees.cursorType
- The type of the cursor. Cannot be null.name
- The name that will be displayed by the cursor, if applicable. Can be null.double getTPS()
boolean registerCommand(java.lang.String fallbackPrefix, org.bukkit.command.PluginCommand command)
fallbackPrefix
- The prefix to use if another command shares the same value.command
- Cannot be null.boolean registerCommand(org.bukkit.command.PluginCommand command)
command
- Cannot be null. The fallback prefix will be the name of the plugin of the command.void unregisterCommand(org.bukkit.command.PluginCommand command)
command
- The command to unregister, cannot be null.GeneralUtil getUtil()
GeneralUtil
for this PacketHandler.GeneralUtil
.