Class Synchronisation

java.lang.Object
dev.scsupercraft.mc.libraries.corelib.api.util.Synchronisation

@AvailableSince("1.0.0") public class Synchronisation extends Object
A utility class for synchronising data.
  • Method Details

    • setup

      @AvailableSince("1.0.0") public static <T> void setup(SyncedData<T> syncedData, CodecHolder<T> codecHolder)
      Set up an object for synchronisation.

      Failing to call this method will result in errors upon trying to synchronise the data.

      Type Parameters:
      T - The type of data being synchronised.
      Parameters:
      syncedData - The synced data to set up synchronisation for.
      codecHolder - The codec holder to use for serialisation.
    • synchronise

      @AvailableSince("1.0.0") public static void synchronise(SyncedData<?> syncedData)
      Synchronises the data to all clients.
      Parameters:
      syncedData - The data to synchronise.
    • synchronise

      @AvailableSince("1.0.0") public static void synchronise(SyncedData<?> syncedData, net.minecraft.server.network.ServerPlayerEntity client)
      Synchronises the data to the specified client.
      Parameters:
      syncedData - The data to synchronise.
      client - The client to send the data to.
    • synchronise

      @AvailableSince("1.0.0") public static void synchronise(net.minecraft.server.network.ServerPlayerEntity client)
      Synchronises all data to the specified client.
      Parameters:
      client - The client to send the data to.