Package foundry.veil.api.resource
Interface VeilResource<T extends VeilResource<?>>
- All Known Subinterfaces:
VeilShaderResource<T>
,VeilTextResource<T>
- All Known Implementing Classes:
BlockModelResource
,FramebufferResource
,LanguageResource
,McMetaResource
,PostPipelineResource
,RenderTypeResource
,TextResource
,TextureResource
,UnknownResource
,VeilShaderDefinitionResource
,VeilShaderFileResource
,VeilShaderIncludeResource
public interface VeilResource<T extends VeilResource<?>>
-
Method Summary
Modifier and TypeMethodDescriptionboolean
default void
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) Rebders this resource into the resource panel.
-
Method Details
-
render
default void render(boolean dragging, boolean fullName) Rebders 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() -
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
- Throws:
IOException
-
getIconCode
int getIconCode()Gets the icon code for this resource (ex. 0xED0F)
-