Package foundry.veil.api.resource.editor
Interface ResourceFileEditor<T extends VeilResource<?>>
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
BlockModelInspector
,FramebufferFileEditor
,ResourceOverrideEditor
,TextFileEditor
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
ResourceFileEditor.Factory<T extends VeilResource<?>>
Factory for creating a new resource file editor. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
close()
boolean
isClosed()
void
Called to update the editor status from disk.void
render()
Renders this editor to the screen.default void
save
(byte[] data, VeilResourceManager resourceManager, VeilResource<?> resource) Saves the specified data to the specified resource and hot reloads it.default void
save
(com.google.gson.JsonElement element, VeilResourceManager resourceManager, VeilResource<?> resource) Saves the specified json element to the specified resource and hot reloads it.
-
Method Details
-
render
void render()Renders this editor to the screen. -
loadFromDisk
void loadFromDisk()Called to update the editor status from disk. -
isClosed
boolean isClosed()- Returns:
- Whether this editor is closed
-
getResource
T getResource()- Returns:
- The resource being edited
-
close
default void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
save
default void save(com.google.gson.JsonElement element, VeilResourceManager resourceManager, VeilResource<?> resource) throws IOException Saves the specified json element to the specified resource and hot reloads it.- Parameters:
element
- The json to write to the resource fileresourceManager
- The resource manager to write the file toresource
- The resource to write to- Throws:
IOException
-
save
Saves the specified data to the specified resource and hot reloads it.- Parameters:
data
- The data to write to the resource fileresourceManager
- The resource manager to write the file toresource
- The resource to write to
-