22w06a resources (#2998)

* 22w06a resources

fyi javadoc gen broke, wait for me to fix it...

Signed-off-by: liach <liach@users.noreply.github.com>

* Apply suggestions from code review

* Update mappings/net/minecraft/resource/NamespaceResourceManager.mapping

Co-authored-by: enbrain <69905075+enbrain@users.noreply.github.com>

Co-authored-by: liach <liach@users.noreply.github.com>
Co-authored-by: enbrain <69905075+enbrain@users.noreply.github.com>
This commit is contained in:
liach 2022-02-12 11:03:23 -06:00 committed by GitHub
parent a6d414dd13
commit 33efbaf906
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 81 additions and 15 deletions

View File

@ -0,0 +1,4 @@
CLASS net/minecraft/class_6860 net/minecraft/resource/LifecycledResourceManager
COMMENT A lifecycled resource manager is available until it is {@linkplain #close()
COMMENT closed}. In principle, it should not be accessed any more after closing;
COMMENT use another resource manager instead.

View File

@ -0,0 +1,14 @@
CLASS net/minecraft/class_6861 net/minecraft/resource/LifecycledResourceManagerImpl
COMMENT A basic implementation of resource manager with a lifecycle.
COMMENT
COMMENT <p>It handles resources by namespaces, hoping that most namespaces are
COMMENT defined in only few resource packs.
COMMENT
COMMENT @see NamespaceResourceManager
FIELD field_36389 subManagers Ljava/util/Map;
FIELD field_36390 packs Ljava/util/List;
METHOD <init> (Lnet/minecraft/class_3264;Ljava/util/List;)V
ARG 1 type
ARG 2 packs
METHOD method_40086 (Lnet/minecraft/class_3264;Ljava/lang/String;)Lnet/minecraft/class_3294;
ARG 1 namespace

View File

@ -1,4 +1,10 @@
CLASS net/minecraft/class_3294 net/minecraft/resource/NamespaceResourceManager CLASS net/minecraft/class_3294 net/minecraft/resource/NamespaceResourceManager
COMMENT A resource manager that only loads resources for a specific namespace.
COMMENT This is an implementation detail for {@link LifecycledResourceManagerImpl}, based
COMMENT on the heuristic that most namespaces are only defined in few resource
COMMENT packs, making loading in those namespaces faster.
COMMENT
COMMENT @see LifecycledResourceManagerImpl
FIELD field_14283 packList Ljava/util/List; FIELD field_14283 packList Ljava/util/List;
FIELD field_14284 type Lnet/minecraft/class_3264; FIELD field_14284 type Lnet/minecraft/class_3264;
FIELD field_14285 LOGGER Lorg/slf4j/Logger; FIELD field_14285 LOGGER Lorg/slf4j/Logger;

View File

@ -19,6 +19,8 @@ CLASS net/minecraft/class_4010 net/minecraft/resource/ProfiledResourceReload
ARG 3 reloader ARG 3 reloader
ARG 4 prepare ARG 4 prepare
ARG 5 apply ARG 5 apply
METHOD method_18356 (Lnet/minecraft/class_3302;Lnet/minecraft/class_3533;Lnet/minecraft/class_3533;Ljava/util/concurrent/atomic/AtomicLong;Ljava/util/concurrent/atomic/AtomicLong;Ljava/lang/Void;)Lnet/minecraft/class_4010$class_4046;
ARG 5 dummy
METHOD method_18358 (Ljava/util/concurrent/Executor;Ljava/util/concurrent/atomic/AtomicLong;Ljava/lang/Runnable;)V METHOD method_18358 (Ljava/util/concurrent/Executor;Ljava/util/concurrent/atomic/AtomicLong;Ljava/lang/Runnable;)V
ARG 2 preparation ARG 2 preparation
CLASS class_4046 Summary CLASS class_4046 Summary

View File

@ -1,8 +1,27 @@
CLASS net/minecraft/class_3304 net/minecraft/resource/ReloadableResourceManagerImpl CLASS net/minecraft/class_3304 net/minecraft/resource/ReloadableResourceManagerImpl
COMMENT A reloadable resource manager is always available to be accessed, and is the
COMMENT type used by the minecraft client instance. It has a backing {@linkplain
COMMENT #activeManager active resource manager} that it delegates to.
COMMENT
COMMENT <p>It starts with an empty active resource manager, and swaps the active
COMMENT resource manager whenever it {@linkplain #reload reloads}; in addition,
COMMENT {@linkplain #close closing} it will replace the active resource manager
COMMENT with an empty one, and the reloadable manager itself is still accessible to
COMMENT users, as opposed to the lifecycled resource manager.
FIELD field_14294 type Lnet/minecraft/class_3264; FIELD field_14294 type Lnet/minecraft/class_3264;
FIELD field_14295 LOGGER Lorg/slf4j/Logger; FIELD field_14295 LOGGER Lorg/slf4j/Logger;
FIELD field_17935 reloaders Ljava/util/List; FIELD field_17935 reloaders Ljava/util/List;
FIELD field_36391 activeManager Lnet/minecraft/class_6860;
METHOD <init> (Lnet/minecraft/class_3264;)V METHOD <init> (Lnet/minecraft/class_3264;)V
ARG 1 type ARG 1 type
METHOD method_14477 registerReloader (Lnet/minecraft/class_3302;)V METHOD method_14477 registerReloader (Lnet/minecraft/class_3302;)V
COMMENT Registers a reloader to all future reloads on this resource
COMMENT manager.
ARG 1 reloader
METHOD method_18232 reload (Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;Ljava/util/List;)Lnet/minecraft/class_4011; METHOD method_18232 reload (Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;Ljava/util/List;)Lnet/minecraft/class_4011;
COMMENT Swaps the active resource manager with another one backed by the given
COMMENT {@code packs} and start a {@linkplain SimpleResourceReload#start reload}.
ARG 1 prepareExecutor
ARG 2 applyExecutor
ARG 3 initialStage
ARG 4 packs

View File

@ -1,8 +1,10 @@
CLASS net/minecraft/class_3262 net/minecraft/resource/ResourcePack CLASS net/minecraft/class_3262 net/minecraft/resource/ResourcePack
COMMENT A resource pack, providing resources to resource managers. COMMENT A resource pack, providing resources to resource managers.
COMMENT COMMENT
COMMENT <p>They are single-use in each reload cycle of a reloadable resource manager. COMMENT <p>They are single-use in the lifecycle of a {@linkplain LifecycledResourceManagerImpl
COMMENT {@link ResourcePackProfile} is a persistent version of the resource packs. COMMENT lifecycled resource manager}. A {@link ResourcePackProfile} is a persistent
COMMENT representation of the resource packs, and can be used to recreate the packs
COMMENT on demand.
FIELD field_29780 METADATA_PATH_SUFFIX Ljava/lang/String; FIELD field_29780 METADATA_PATH_SUFFIX Ljava/lang/String;
FIELD field_29781 PACK_METADATA_NAME Ljava/lang/String; FIELD field_29781 PACK_METADATA_NAME Ljava/lang/String;
METHOD method_14405 open (Lnet/minecraft/class_3264;Lnet/minecraft/class_2960;)Ljava/io/InputStream; METHOD method_14405 open (Lnet/minecraft/class_3264;Lnet/minecraft/class_2960;)Ljava/io/InputStream;

View File

@ -1,8 +1,7 @@
CLASS net/minecraft/class_4011 net/minecraft/resource/ResourceReload CLASS net/minecraft/class_4011 net/minecraft/resource/ResourceReload
COMMENT Represents a resource reload. COMMENT Represents a resource reload.
COMMENT COMMENT
COMMENT @see ReloadableResourceManager#reload(java.util.concurrent.Executor, COMMENT @see SimpleResourceReload#start
COMMENT java.util.concurrent.Executor, CompletableFuture, java.util.List)
METHOD method_18229 getProgress ()F METHOD method_18229 getProgress ()F
COMMENT Returns a fraction between 0 and 1 indicating the progress of this COMMENT Returns a fraction between 0 and 1 indicating the progress of this
COMMENT reload. COMMENT reload.

View File

@ -1,8 +1,8 @@
CLASS net/minecraft/class_3302 net/minecraft/resource/ResourceReloader CLASS net/minecraft/class_3302 net/minecraft/resource/ResourceReloader
COMMENT A resource reloader performs actual reloading in its {@linkplain #reload COMMENT A resource reloader performs actual reloading in its {@linkplain #reload
COMMENT reload} in a reloadable resource manager it is registered to. COMMENT reload} when called by {@link SimpleResourceReload#start}.
COMMENT COMMENT
COMMENT @see ReloadableResourceManager COMMENT @see SimpleResourceReload#start
COMMENT @see SinglePreparationResourceReloader SinglePreparationResourceReloader COMMENT @see SinglePreparationResourceReloader SinglePreparationResourceReloader
COMMENT (completes preparation in one method) COMMENT (completes preparation in one method)
COMMENT @see SynchronousResourceReloader SynchronousResourceReloader COMMENT @see SynchronousResourceReloader SynchronousResourceReloader

View File

@ -8,11 +8,13 @@ CLASS net/minecraft/class_5350 net/minecraft/resource/ServerResourceManager
FIELD field_25341 serverAdvancementLoader Lnet/minecraft/class_2989; FIELD field_25341 serverAdvancementLoader Lnet/minecraft/class_2989;
FIELD field_25342 functionLoader Lnet/minecraft/class_5349; FIELD field_25342 functionLoader Lnet/minecraft/class_5349;
FIELD field_28017 lootFunctionManager Lnet/minecraft/class_5640; FIELD field_28017 lootFunctionManager Lnet/minecraft/class_5640;
FIELD field_36491 LOGGER Lorg/slf4j/Logger;
METHOD <init> (Lnet/minecraft/class_5455$class_6890;Lnet/minecraft/class_2170$class_5364;I)V METHOD <init> (Lnet/minecraft/class_5455$class_6890;Lnet/minecraft/class_2170$class_5364;I)V
ARG 2 commandEnvironment ARG 2 commandEnvironment
ARG 3 functionPermissionLevel ARG 3 functionPermissionLevel
METHOD method_29465 getFunctionLoader ()Lnet/minecraft/class_5349; METHOD method_29465 getFunctionLoader ()Lnet/minecraft/class_5349;
METHOD method_29466 reload (Lnet/minecraft/class_3300;Lnet/minecraft/class_5455$class_6890;Lnet/minecraft/class_2170$class_5364;ILjava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture; METHOD method_29466 reload (Lnet/minecraft/class_3300;Lnet/minecraft/class_5455$class_6890;Lnet/minecraft/class_2170$class_5364;ILjava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;
ARG 0 manager
ARG 2 commandEnvironment ARG 2 commandEnvironment
ARG 3 functionPermissionLevel ARG 3 functionPermissionLevel
ARG 4 prepareExecutor ARG 4 prepareExecutor
@ -23,3 +25,4 @@ CLASS net/minecraft/class_5350 net/minecraft/resource/ServerResourceManager
METHOD method_29472 getCommandManager ()Lnet/minecraft/class_2170; METHOD method_29472 getCommandManager ()Lnet/minecraft/class_2170;
METHOD method_29473 getServerAdvancementLoader ()Lnet/minecraft/class_2989; METHOD method_29473 getServerAdvancementLoader ()Lnet/minecraft/class_2989;
METHOD method_32703 getLootFunctionManager ()Lnet/minecraft/class_5640; METHOD method_32703 getLootFunctionManager ()Lnet/minecraft/class_5640;
METHOD method_40427 getResourceReloaders ()Ljava/util/List;

View File

@ -42,6 +42,24 @@ CLASS net/minecraft/class_4014 net/minecraft/resource/SimpleResourceReload
ARG 4 initialStage ARG 4 initialStage
METHOD method_18372 (Ljava/util/concurrent/Executor;Ljava/lang/Runnable;)V METHOD method_18372 (Ljava/util/concurrent/Executor;Ljava/lang/Runnable;)V
ARG 2 preparation ARG 2 preparation
METHOD method_40087 start (Lnet/minecraft/class_3300;Ljava/util/List;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;Z)Lnet/minecraft/class_4011;
COMMENT Starts a resource reload with the content from the {@code manager} supplied
COMMENT to the {@code reloaders}.
COMMENT
COMMENT @apiNote In vanilla, this is respectively called by {@link ReloadableResourceManagerImpl}
COMMENT on the client and {@link ServerResourceManager} on the server.
ARG 0 manager
COMMENT the resource manager, providing resources to the reloaders
ARG 1 reloaders
COMMENT the reloaders performing the reload
ARG 2 prepareExecutor
COMMENT the executor for the prepare stage, often asynchronous
ARG 3 applyExecutor
COMMENT the executor for the apply stage, synchronous with the game engine
ARG 4 initialStage
COMMENT the initial stage, must be completed before the reloaders can prepare resources
ARG 5 profiled
COMMENT whether to profile this reload and log the statistics
CLASS class_4047 Factory CLASS class_4047 Factory
COMMENT A factory that creates a completable future for each reloader in the COMMENT A factory that creates a completable future for each reloader in the
COMMENT resource reload. COMMENT resource reload.

View File

@ -3,7 +3,7 @@
*/ */
/** /**
* Provides resources to Minecraft, including resource access and provision. * Provides resources to Minecraft, including resource access, provision, and reloading.
* *
* <p>"Data" as in "Data Packs" is considered resource as well. * <p>"Data" as in "Data Packs" is considered resource as well.
* *
@ -15,26 +15,25 @@
* </tr> * </tr>
* <tr> * <tr>
* <td>{@link Resource}</td> * <td>{@link Resource}</td>
* <td>Accesses binary data.</td> * <td>Accesses to binary data.</td>
* </tr> * </tr>
* <tr> * <tr>
* <td>{@link ResourceFactory}</td> * <td>{@link ResourceFactory}</td>
* <td>Provides a resource given an {@link net.minecraft.util.Identifier}.</td> * <td>Provides a resource given an {@link net.minecraft.util.Identifier}.</td>
* </tr> * </tr>
* <tr> * <tr>
* <td>{@link ResourceManager}</td> * <td>{@link ResourceManager}</td>
* <td>Exposes more resource access in addition to being a {@link ResourceFactory}.</td> * <td>Exposes more resource access in addition to being a {@link ResourceFactory}.</td>
* </tr> * </tr>
* <tr> * <tr>
* <td>{@link ResourceReloader}</td> * <td>{@link LifecycledResourceManager}</td>
* <td>The most common accessor to resources, acting during "reloads" to set up in-game contents. * <td>A resource manager with a specific lifecycle, to fine-grain resource access.</td>
* <br><i>This is usually implemented by mods using resources.</i></td>
* </tr> * </tr>
* <tr> * <tr>
* <td>{@link ReloadableResourceManager}</td> * <td>{@link ResourceReloader}</td>
* <td>Performs reloads and manages {@link ResourceReloader}s in addition to being a {@link ResourceManager}. * <td>The most common accessor to resources, acting during {@linkplain
* <br>Usually held by the game engine, it may be provided by the modding APIs as well.</td> * SimpleResourceReload#start reloads} to set up in-game contents.
* <br><i>This is usually implemented by mods using resources.</i></td>
* </tr> * </tr>
* </table></div> * </table></div>
* *