Interface NetworkHelper

All Known Implementing Classes:
FabricNetworkHelper

public interface NetworkHelper
Defines the contract for cross-platform network communication and payload dispatching.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    sendToClient(EnchantmentMenuSyncPayload payload, net.minecraft.server.level.ServerPlayer serverPlayer)
    Dispatches a custom network payload to a specific client.
  • Method Details

    • sendToClient

      void sendToClient(EnchantmentMenuSyncPayload payload, net.minecraft.server.level.ServerPlayer serverPlayer)
      Dispatches a custom network payload to a specific client.

      Used to synchronize complex, non-primitive menu state (like the EnchantmentContext list) that cannot be natively synchronized via standard container DataSlots.

      Parameters:
      payload - The constructed payload containing the data to synchronize.
      serverPlayer - The specific connected client player to receive the payload.