Interface ResourceFileEditor<T extends VeilResource<?>>

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
BlockModelInspector, FramebufferFileEditor, ResourceOverrideEditor, TextFileEditor

public interface ResourceFileEditor<T extends VeilResource<?>> extends Closeable
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Factory for creating a new resource file editor.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
     
     
    boolean
     
    void
    Called to update the editor status from disk.
    void
    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 interface AutoCloseable
      Specified by:
      close in interface Closeable
    • 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 file
      resourceManager - The resource manager to write the file to
      resource - The resource to write to
      Throws:
      IOException
    • save

      default void 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