Class StructureCache

java.lang.Object
com.comphenix.protocol.injector.StructureCache

public class StructureCache extends Object
Caches structure modifiers.
  • Constructor Details

    • StructureCache

      public StructureCache()
  • Method Details

    • newPacket

      @Deprecated public static Object newPacket(Class<?> packetClass)
      Deprecated.
      Renamed to newInstance(Class).
    • canCreateInstance

      public static boolean canCreateInstance(Class<?> clazz)
    • newInstance

      public static Object newInstance(Class<?> clazz)
    • newPacket

      public static Object newPacket(PacketType type)
      Creates an empty Minecraft packet of the given type.
      Parameters:
      type - - packet type.
      Returns:
      Created packet.
    • getStructure

      @Deprecated public static StructureModifier<Object> getStructure(Class<?> packetType)
      Deprecated.
      Retrieve a cached structure modifier given a packet type.
      Parameters:
      packetType - - packet type.
      Returns:
      A structure modifier.
    • getStructure

      public static StructureModifier<Object> getStructure(PacketType packetType)
      Retrieve a cached structure modifier for the given packet type.
      Parameters:
      packetType - - packet type.
      Returns:
      A structure modifier.
    • newNullDataSerializer

      public static Object newNullDataSerializer()
      Returns a new mocked null data serializer instance, if possible.
      Returns:
      a new null data serializer instance.
    • tryInitTrickDataSerializer

      public static boolean tryInitTrickDataSerializer()
      Creates a packet data serializer sub-class if needed to allow the fixed read of a NbtTagCompound because of a null check in the MapChunk packet constructor.