类 SinglePreparationResourceReloader<T>

    • 构造器详细资料

      • SinglePreparationResourceReloader

        public SinglePreparationResourceReloader()
    • 方法详细资料

      • reload

        public final CompletableFuture<Void> reload​(ResourceReloader.Synchronizer synchronizer,
                                                    ResourceManager manager,
                                                    Profiler prepareProfiler,
                                                    Profiler applyProfiler,
                                                    Executor prepareExecutor,
                                                    Executor applyExecutor)
        Performs a reload. Returns a future that is completed when the reload is completed.

        In a reload, there is a prepare stage and an apply stage. For the prepare stage, you should create completable futures with CompletableFuture.supplyAsync(..., prepareExecutor) to ensure the prepare actions are done with the prepare executor. Then, you should have a completable future for all the prepared actions, and call combinedPrepare.thenCompose(synchronizer::waitFor) to notify the synchronizer. Finally, you should run CompletableFuture.thenAcceptAsync(..., applyExecutor) for apply actions. In the end, returns the result of thenAcceptAsync.

        指定者:
        reload 在接口中 ResourceReloader
        参数:
        synchronizer - the synchronizer
        manager - the resource manager
        prepareProfiler - the profiler for prepare stage
        applyProfiler - the profiler for apply stage
        prepareExecutor - the executor for prepare stage
        applyExecutor - the executor for apply stage
        返回:
        a future for the reload
        另请参阅:
        ReloadableResourceManager.reload(Executor, Executor, CompletableFuture, List)
        Mappings:
        Namespace Name Mixin selector
        official a Ladg;a(Ladg$a;Ladl;Lapl;Lapl;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
        intermediary method_25931 Lnet/minecraft/class_3302;method_25931(Lnet/minecraft/class_3302$class_4045;Lnet/minecraft/class_3300;Lnet/minecraft/class_3695;Lnet/minecraft/class_3695;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
        named reload Lnet/minecraft/resource/ResourceReloader;reload(Lnet/minecraft/resource/ResourceReloader$Synchronizer;Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/util/profiler/Profiler;Lnet/minecraft/util/profiler/Profiler;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
      • prepare

        protected abstract T prepare​(ResourceManager manager,
                                     Profiler profiler)
        Prepares the intermediate object.

        This method is called in the prepare executor in a reload.

        参数:
        manager - the resource manager
        profiler - the prepare profiler
        返回:
        the prepared object
        Mappings:
        Namespace Name Mixin selector
        official b Ladp;b(Ladl;Lapl;)Ljava/lang/Object;
        intermediary method_18789 Lnet/minecraft/class_4080;method_18789(Lnet/minecraft/class_3300;Lnet/minecraft/class_3695;)Ljava/lang/Object;
        named prepare Lnet/minecraft/resource/SinglePreparationResourceReloader;prepare(Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/util/profiler/Profiler;)Ljava/lang/Object;
      • apply

        protected abstract void apply​(T prepared,
                                      ResourceManager manager,
                                      Profiler profiler)
        Handles the prepared intermediate object.

        This method is called in the apply executor, or the game engine, in a reload.

        参数:
        prepared - the prepared object
        manager - the resource manager
        profiler - the apply profiler
        Mappings:
        Namespace Name Mixin selector
        official a Ladp;a(Ljava/lang/Object;Ladl;Lapl;)V
        intermediary method_18788 Lnet/minecraft/class_4080;method_18788(Ljava/lang/Object;Lnet/minecraft/class_3300;Lnet/minecraft/class_3695;)V
        named apply Lnet/minecraft/resource/SinglePreparationResourceReloader;apply(Ljava/lang/Object;Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/util/profiler/Profiler;)V