接口 ResourceReloader.Synchronizer

  • 封闭接口:
    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
    official adg$a
    intermediary net/minecraft/class_3302$class_4045
    named net/minecraft/resource/ResourceReloader$Synchronizer
    • 方法概要

      所有方法 实例方法 抽象方法 
      修饰符和类型 方法 说明
      <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.
    • 方法详细资料

      • 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);

        参数:
        preparedObject - the result of the prepare stage
        返回:
        a completable future as the precondition for the apply stage
        Mappings:
        Namespace Name Mixin selector
        official a Ladg$a;a(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;
        named whenPrepared Lnet/minecraft/resource/ResourceReloader$Synchronizer;whenPrepared(Ljava/lang/Object;)Ljava/util/concurrent/CompletableFuture;