Class MinecraftMethods

java.lang.Object
com.comphenix.protocol.utility.MinecraftMethods

public final class MinecraftMethods extends Object
Static methods for accessing Minecraft methods.
  • Method Details

    • getSendPacketMethod

      public static MethodAccessor getSendPacketMethod()
      Retrieve the send packet method in PlayerConnection/NetServerHandler.
      Returns:
      The send packet method.
    • getDisconnectMethod

      public static MethodAccessor getDisconnectMethod(Class<?> playerConnection)
      Retrieve the disconnect method for a given player connection.
      Parameters:
      playerConnection - - the player connection.
      Returns:
      The
    • getNetworkManagerHandleMethod

      public static MethodAccessor getNetworkManagerHandleMethod()
      Retrieve the handle/send packet method of network manager.
      Returns:
      The handle method.
    • getNetworkManagerReadPacketMethod

      public static MethodAccessor getNetworkManagerReadPacketMethod()
      Retrieve the packetRead(ChannelHandlerContext, Packet) method of NetworkManager.
      Returns:
      The packetRead method.
    • getPacketReadByteBufMethod

      public static MethodAccessor getPacketReadByteBufMethod()
      Retrieve the Packet.read(PacketDataSerializer) method.
      Returns:
      The packet read method.
    • getPacketWriteByteBufMethod

      public static MethodAccessor getPacketWriteByteBufMethod()
      Retrieve the Packet.write(PacketDataSerializer) method.

      This only exists in version 1.7.2 and above.

      Returns:
      The packet write method.