Interface ResourceReloader.Synchronizer

Enclosing interface:
ResourceReloader

public static interface ResourceReloader.Synchronizer
A synchronizer to indicate completion of a reloader's prepare stage and to allow start of the apply stage only if all reloaders have finished the prepare stage.
Mappings:
Namespace Name
named net/minecraft/resource/ResourceReloader$Synchronizer
intermediary net/minecraft/class_3302$class_4045
official atq$a
  • Method Summary

    Modifier and Type
    Method
    Description
    whenPrepared(T preparedObject)
    Indicates, to the ongoing reload, that this reloader has finished its preparation stage with the preparedObject as its result.
  • Method Details

    • whenPrepared

      <T> CompletableFuture<T> whenPrepared(T preparedObject)
      Indicates, to the ongoing reload, that this reloader has finished its preparation stage with the preparedObject as its result.

      Returns a completable future that the apply stage depends on. This returned future is completed when all the reloaders have completed their prepare stages in the reload.

      Example: CompletableFuture<SomeObject> prepareStage = ...; prepareStage.thenCompose(synchronizer::whenPrepared) .thenAcceptAsync(..., applyExecutor);

      Parameters:
      preparedObject - the result of the prepare stage
      Returns:
      a completable future as the precondition for the apply stage
      Mappings:
      Namespace Name Mixin selector
      named whenPrepared Lnet/minecraft/resource/ResourceReloader$Synchronizer;whenPrepared(Ljava/lang/Object;)Ljava/util/concurrent/CompletableFuture;
      intermediary method_18352 Lnet/minecraft/class_3302$class_4045;method_18352(Ljava/lang/Object;)Ljava/util/concurrent/CompletableFuture;
      official a Latq$a;a(Ljava/lang/Object;)Ljava/util/concurrent/CompletableFuture;