Package net.minecraft.resource
package net.minecraft.resource
Provides resources to Minecraft, including resource access, provision, and reloading.
"Data" as in "Data Packs" is considered resource as well.
Here is a quick overview on the resource access and provision APIs of Minecraft:
Class | Usage |
---|---|
Resource |
Accesses to binary data. |
ResourceFactory |
Provides a resource given an Identifier . |
ResourceManager |
Exposes more resource access in addition to being a ResourceFactory . |
LifecycledResourceManager |
A resource manager with a specific lifecycle, to fine-grain resource access. |
ResourceReloader |
The most common accessor to resources, acting during reloads to set up in-game contents.
This is usually implemented by mods using resources. |
Class | Usage |
---|---|
ResourcePack |
Provides binary data based on queries.
They are usually single-use, created by ResourcePackManager and provided
to the resource manager in each reload. |
ResourcePackProfile |
A user-friendly, persistent form of ResourcePack . Used to create resource
packs in reloads. |
ResourcePackProvider |
Provides ResourcePackProfile s, so they are taken account of during reloads.
This is usually implemented by mods providing resources. |
ResourcePackManager |
Keeps track of ResourcePackProvider s and uses the profiles from the providers
to create ResourcePack s to send to resource managers in each reload. |
In addition to these APIs, this package includes implementation details of the resource system.
-
ClassDescriptionAn abstract implementation of resource reloader that reads JSON files into Gson representations in the prepare stage.A lifecycled resource manager is available until it is closed.A basic implementation of resource manager with a lifecycle.A resource manager that only loads resources for a specific namespace.An implementation of resource reload that includes an additional profiling summary for each reloader.The profiling summary for each reloader in the reload.A reloadable resource manager is always available to be accessed, and is the type used by the minecraft client instance.A resource of binary data.Provides resource access.Provides resource loading capabilities to Minecraft.A resource pack, providing resources to resource managers.A resource pack manager manages a list of
ResourcePackProfile
s and builds a list of resource packs when the resource manager reloads.Represents a resource pack in aResourcePackManager
.A resource pack provider providesResourcePackProfile
s, usually toResourcePackManager
s.Represents a resource reload.A resource reloader performs actual reloading in its reload when called bySimpleResourceReload.start(net.minecraft.resource.ResourceManager, java.util.List<net.minecraft.resource.ResourceReloader>, java.util.concurrent.Executor, java.util.concurrent.Executor, java.util.concurrent.CompletableFuture<net.minecraft.util.Unit>, boolean)
.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.A simple implementation of resource reload.A factory that creates a completable future for each reloader in the resource reload.A base resource reloader implementation that prepares an object in a single call (as opposed to in multiple concurrent tasks) and handles the prepared object in the apply stage.A base resource reloader that does all its work in the apply executor, or the game engine's thread.