feather icon indicating copy to clipboard operation
feather copied to clipboard

Plugin API Roadmap (Quill)

Open caelunshun opened this issue 3 years ago • 5 comments

#307 introduces a preliminary draft of Feather's plugin API, quill. This is tracking issue for features needed in the plugin API to achieve the goals laid out in our mid-term roadmap.

Foundational features:

  • [x] Plugin state struct
  • [x] Access to Copy components from the host
  • [x] Mutating Copy components from the host
  • [ ] Defining, accessing, and mutating custom components
  • [x] Creating and removing entities
  • [ ] Access to opaque, non-Copy components from the host
    • [x] Name
    • [ ] Inventory
    • [ ] Window

Features needed for a hub plugin implemented with Quill:

  • [x] Support all vanilla entities in Feather: armor stands, mobs
  • [x] Particles
  • [x] Entities
  • [ ] Custom GUIs for server selection
  • [x] Sending plugin messages (needed for BungeeCord server transfer)
  • [ ] Potion effects
  • [ ] Others?

Features needed for minigames implemented with Quill:

  • [x] Block access, ideally with bulk operation support ("fill this chunk section with the given block")
  • [ ] Custom WorldSources defined in plugins for custom world loading/saving logic
  • [ ] Others?

Miscallaneous:

  • [ ] Plugin assets - stored in the plugin's tar file?

caelunshun avatar Feb 09 '21 05:02 caelunshun

@caelunshun I'd like to tackle the particle system if that's possible :)

oxkitsune avatar Feb 22 '21 23:02 oxkitsune

I'd like to tackle the particle system if that's possible :)

Sure thing, thanks!

We'll probably want a Particle type in libcraft that defines all possible particles, plus their associated metadata.

The steps for implementing this are:

  • Add support for spawning particles in quill. That means a particle_spawn method in the quill-sys crate, plus a method on quill::Game that invokes the raw quill_sys::particle_spawn.
  • Implement the particle_spawn host call in Feather. This involves adding the function to crates/plugin-host/src/host_calls.rs.
  • Add whatever is needed to send particles to clients.

Let me know if you have any questions, either here or on Discord.

caelunshun avatar Feb 23 '21 02:02 caelunshun

@caelunshun I have a question on the design. Are you planning on making it possible to spawn generic ecs-entities into the ecs system directly through quill.

Or is it going to stay like the way it's done for the minecraft-entity builder is, where we just pass a struct containing all the required data back from the client (the plugin/quill) to the host (feather) and create the ecs-entity there.

oxkitsune avatar Feb 23 '21 21:02 oxkitsune

Are you planning on making it possible to spawn generic ecs-entities into the ecs system directly through quill.

Or is it going to stay like the way it's done for the minecraft-entity builder is, where we just pass a struct containing all the required data back from the client (the plugin/quill) to the host (feather) and create the ecs-entity there.

Spawning raw entities without any default components is probably necessary, yes. The simplest way to do this would be to add a new entity_builder_new_empty function in quill-sys that creates an empty EntityBuilder. (The current entity_builder_new function adds default components to the builder for vanilla entities).

caelunshun avatar Feb 24 '21 00:02 caelunshun

Quick summary of recent progress:

  • 144f30693aad796b9b3622fe74f2b5375f220819 added block access to plugins.
  • 4c78806965b0065dc5a658e50c750a3e59998eb3 added the first bulk block operation.
  • #364 added particles.
  • #349 added a temporary solution for plugins requiring networking, since WASI is currently moving slowly.

Next up:

  • I'm working on custom components right now.
  • @amberkowalski is working on window / inventories for custom GUIs.
  • @OxKitsune is working on title messages.

caelunshun avatar Mar 03 '21 00:03 caelunshun