Class NeoForgeSyncBootstrap

java.lang.Object
com.oliveryasuna.mc.rubric.neoforge.NeoForgeSyncBootstrap

public final class NeoForgeSyncBootstrap extends Object
Loader-side helpers that wire a SyncService into NeoForge's event surface so consumers don't have to learn the event API to use sync. Build a manager + codec registry, call installServer(com.oliveryasuna.mc.rubric.value.CodecRegistry, com.oliveryasuna.mc.rubric.platform.PermissionGate) on the common entry point and installClient(com.oliveryasuna.mc.rubric.value.CodecRegistry) on the client entry point, then register the manager and (on the client side) hand the resulting service to RubricGui.registerSyncService(manager, service).
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.oliveryasuna.mc.rubric.sync.SyncService
    installClient(com.oliveryasuna.mc.rubric.value.CodecRegistry codecs)
    Builds the client-side SyncService around the client transport (payload receiver is wired via registerPayload on the mod event bus) and starts it.
    static com.oliveryasuna.mc.rubric.sync.SyncService
    installServer(com.oliveryasuna.mc.rubric.value.CodecRegistry codecs, com.oliveryasuna.mc.rubric.platform.PermissionGate gate)
    Builds the server-side SyncService, hooks PlayerEvent.PlayerLoggedInEvent to dispatch handshake + initial snapshot per joining player.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • installServer

      public static com.oliveryasuna.mc.rubric.sync.SyncService installServer(com.oliveryasuna.mc.rubric.value.CodecRegistry codecs, com.oliveryasuna.mc.rubric.platform.PermissionGate gate)
      Builds the server-side SyncService, hooks PlayerEvent.PlayerLoggedInEvent to dispatch handshake + initial snapshot per joining player. Started before returning.
      Parameters:
      codecs - Codec registry shared with the consumer's managers.
      gate - Permission gate consulted by handleClientEdit.
      Returns:
      The configured, started service. Register managers on it.
    • installClient

      public static com.oliveryasuna.mc.rubric.sync.SyncService installClient(com.oliveryasuna.mc.rubric.value.CodecRegistry codecs)
      Builds the client-side SyncService around the client transport (payload receiver is wired via registerPayload on the mod event bus) and starts it.
      Parameters:
      codecs - Codec registry shared with the consumer's managers.
      Returns:
      The configured, started service. Register managers on it and hand to RubricGui.registerSyncService so the screen's Save & Exit can forward dirty server-scoped edits.