Interface IServerChunkCacheExtension

All Known Implementing Classes:
ServerChunkCache

public interface IServerChunkCacheExtension
Extension class for ServerChunkCache

This interface with its default methods allows for easy sending of payloads players watching a specific entity.

  • Method Details

    • self

      default ServerChunkCache self()
    • broadcastAndSend

      default void broadcastAndSend(Entity entity, CustomPacketPayload payload)
      Sends a payload to all players watching the given entity.

      If the entity is a player, the payload will be sent to that player.

      Parameters:
      entity - the entity that needs to be watched to receive the payload, and the player to send the payload to if the entity is a player.
      payload - the payload to send
    • broadcast

      default void broadcast(Entity entity, CustomPacketPayload payload)
      Sends a payload to all players watching the given entity.

      If the entity is a player, the payload will not be sent to that player.

      Parameters:
      entity - the entity that needs to be watched to receive the payload
      payload - the payload to send