Class SyncTasks

java.lang.Object
com.viaversion.viafabricplus.util.network.SyncTasks

public final class SyncTasks extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    This identifier is an internal identifier used to identify packets that are sent by ViaFabricPlus
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    executeSyncTask(Consumer<net.minecraft.network.RegistryFriendlyByteBuf> task)
    Executes a task synchronized with the main thread from networking threads
    static void
    handleSyncTask(net.minecraft.network.FriendlyByteBuf buf)
    Handles a sync task sent from the networking thread
    static void
     

    Methods inherited from class Object

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

    • PACKET_SYNC_IDENTIFIER

      public static final String PACKET_SYNC_IDENTIFIER
      This identifier is an internal identifier used to identify packets that are sent by ViaFabricPlus
  • Constructor Details

    • SyncTasks

      public SyncTasks()
  • Method Details

    • init

      public static void init()
    • executeSyncTask

      public static String executeSyncTask(Consumer<net.minecraft.network.RegistryFriendlyByteBuf> task)
      Executes a task synchronized with the main thread from networking threads
      Parameters:
      task - The task to execute
      Returns:
      The uuid of the task
    • handleSyncTask

      public static void handleSyncTask(net.minecraft.network.FriendlyByteBuf buf)
      Handles a sync task sent from the networking thread
      Parameters:
      buf - The packet buffer