ImmersiveMC

ImmersiveMC

2M Downloads

Render Screens in Book

hammy275 opened this issue ยท 1 comments

commented

I don't think it's realistically possible to do issues like #343 and #459 by parsing the data provided directly. No matter where we get the data from (the mod-provided data files, some internal representation of the book, etc.), it's always going to be bad in some way (a changing API, extremely difficult to replicate the same look, etc.)

Instead, I think it makes more sense to have the ability to render a screen onto the book itself. There are many parts to doing this:

  • Getting an actually working implementation.
    • Rendering the screen in-world.
    • Adding an AABB to cover the entire book, which gets translated to "in-screen" coordinates.
      • Since screen interactions may not be tied to defined widgets, we can't just put hitboxes for each widget.
      • Hover effects would need to be handled as well.
  • Running up against all the things Minecraft disables when a screen is open.
    • Screens seem fairly straightforward to work with even without setting Minecraft's active screen. I think this would be the best approach.
  • Allowing for a split point so each screen half can be rendered on different sides.
    • Alternatively, we could just make the book flat. This would require re-working the book model, though.
  • Running up against Vivecraft's screen handling (makes me wonder if this would be better incorporate in Vivecraft itself? May investigate at a later date)
    • May not be an issue if we don't set Minecraft's active screen.

This has many upsides if done, though:

  • Patchouli and Modnomicon support become (hopefully) trivial, and I could look into adding other mods' screens to be in-world.
  • ImmersiveMC config could be customized in-world (finally!)
  • Would be a great API addition to ImmersiveMC. An Immersive book is as easy to make as a normal Screen for other mod developers!

Depends on #407