Interface ResourceFileEditor<T extends VeilResource<?>>

Type Parameters:
T - The type of resource this editor handles
All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
BlockModelInspector, FramebufferFileEditor, ResourceOverrideEditor, TextFileEditor

public interface ResourceFileEditor<T extends VeilResource<?>> extends Closeable
Defines an editor type that can interact with one or more resources.
Since:
1.0.0
See Also:
  • 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 interface AutoCloseable
      Specified by:
      close in interface Closeable
    • save

      default CompletableFuture<?> 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 file
      resourceManager - The resource manager to write the file to
      resource - The resource to write to
      Returns:
      A future for when the task is complete
      Throws:
      IOException
    • save

      default CompletableFuture<?> save(byte[] data, VeilResourceManager resourceManager, VeilResource<?> resource)
      Saves the specified data to the specified resource and hot reloads it.
      Parameters:
      data - The data to write to the resource file
      resourceManager - The resource manager to write the file to
      resource - The resource to write to
      Returns:
      A future for when the task is complete