Package foundry.veil.api.resource
Interface VeilResource<T extends VeilResource<?>>
- Type Parameters:
T
- This resource type
- All Known Subinterfaces:
VeilShaderResource<T>
,VeilTextResource<T>
- All Known Implementing Classes:
BlockModelResource
,FramebufferResource
,LanguageResource
,McMetaResource
,PostPipelineResource
,RenderTypeResource
,TextResource
,TextureResource
,UnknownResource
,VanillaShaderFileResource
,VeilShaderDefinitionResource
,VeilShaderFileResource
,VeilShaderIncludeResource
public interface VeilResource<T extends VeilResource<?>>
An abstracted version of a resource independent of client and server resources.
This is intended to be used on the client side to modify assets during mod and resource pack development.
This is intended to be used on the client side to modify assets during mod and resource pack development.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionboolean
default void
Copies this resource from the build folder to the actual asset root.int
Gets the icon code for this resource (ex.void
hotReload
(VeilResourceManager resourceManager) Hot-reloads the resource.default CompletableFuture
<?> onFileSystemChange
(VeilResourceManager resourceManager, WatchEvent<Path> event) Called from the watcher thread when this resource updates on disc.default void
render
(boolean dragging, boolean fullName) Renders this resource into the resource panel.
-
Method Details
-
render
default void render(boolean dragging, boolean fullName) Renders this resource into the resource panel.- Parameters:
dragging
- Whether the user is dragging the resourcefullName
- Whether to render the location of the resource
-
onFileSystemChange
default CompletableFuture<?> onFileSystemChange(VeilResourceManager resourceManager, WatchEvent<Path> event) Called from the watcher thread when this resource updates on disc.- Parameters:
resourceManager
- The resource manager this event was triggered fromevent
- The event received from the file watcher- Returns:
- A future for when the key can be reset. All events are ignored until this future completes
-
resourceInfo
VeilResourceInfo resourceInfo()- Returns:
- Information about this resource
-
getActions
List<VeilResourceAction<T>> getActions()- Returns:
- All actions that can be performed on this resource
-
canHotReload
boolean canHotReload()- Returns:
- If this resource can be hot-reloaded
-
hotReload
Hot-reloads the resource.- Parameters:
resourceManager
- The resource manager reloading the resource- Throws:
IOException
- If any error occurs while trying to reload
-
copyToResources
Copies this resource from the build folder to the actual asset root.- Throws:
IOException
- If there was an error copying the file
-
getIconCode
int getIconCode()Gets the icon code for this resource (ex. 0xED0F)
-