Interface Engine


@BackendImplemented public interface Engine
  • Method Details

    • createVisualizationContext

      VisualizationContext createVisualizationContext()
      Create a visualization context that will be used to create visuals of the given type.
      Returns:
      A new visualization context.
    • createFramePlan

      Plan<RenderContext> createFramePlan()
      Create a plan that will start execution after the start of the level render and finish execution before render(dev.engine_room.flywheel.api.RenderContext) is called.
      Returns:
      A new plan.
    • renderOrigin

      net.minecraft.core.Vec3i renderOrigin()
      Returns:
      The current render origin.
    • updateRenderOrigin

      boolean updateRenderOrigin(net.minecraft.client.Camera camera)
      Maintain the render origin to be within a certain distance from the camera in all directions, preventing floating point precision issues at high coordinates.
      Returns:
      true if the render origin changed, false otherwise.
    • lightSections

      void lightSections(it.unimi.dsi.fastutil.longs.LongSet sections)
      Assign the set of sections that visuals have requested GPU light for.

      This will be called at most once per frame, and not necessarily every frame.

      Parameters:
      sections - The set of sections.
    • onLightUpdate

      void onLightUpdate(net.minecraft.core.SectionPos sectionPos, net.minecraft.world.level.LightLayer layer)
    • render

      void render(RenderContext context)
      Render all instances necessary for the given visual type.

      This method is guaranteed to be called after the frame plan has finished execution and before renderCrumbling(dev.engine_room.flywheel.api.RenderContext, java.util.List<dev.engine_room.flywheel.api.backend.Engine.CrumblingBlock>) are called. This method is guaranteed to be called on the render thread.

      Parameters:
      context - The context for the current level render.
    • renderCrumbling

      void renderCrumbling(RenderContext context, List<Engine.CrumblingBlock> crumblingBlocks)
      Render the given instances as a crumbling overlay.

      This method is guaranteed to be called after render(dev.engine_room.flywheel.api.RenderContext) for the current level render. This method is guaranteed to be called on the render thread.

      Parameters:
      context - The context for the current level render.
      crumblingBlocks - The instances to render. This list is never empty.
    • delete

      void delete()
      Free all resources associated with this engine.

      This engine will not be used again after this method is called.

      This method is guaranteed to be called on the render thread.