Class InstanceWorld

java.lang.Object
com.jozufozu.flywheel.backend.instancing.InstanceWorld

public class InstanceWorld extends Object
A manager class for a single world where instancing is supported.

The material manager is shared between the different instance managers.

  • Field Details

    • engine

      protected final Engine engine
    • entityInstanceManager

      protected final InstanceManager<net.minecraft.world.entity.Entity> entityInstanceManager
    • blockEntityInstanceManager

      protected final InstanceManager<net.minecraft.world.level.block.entity.BlockEntity> blockEntityInstanceManager
    • taskEngine

      public final ParallelTaskEngine taskEngine
  • Constructor Details

    • InstanceWorld

      public InstanceWorld(Engine engine, InstanceManager<net.minecraft.world.entity.Entity> entityInstanceManager, InstanceManager<net.minecraft.world.level.block.entity.BlockEntity> blockEntityInstanceManager)
  • Method Details

    • create

      public static InstanceWorld create(net.minecraft.world.level.LevelAccessor level)
    • getEntityInstanceManager

      public InstanceManager<net.minecraft.world.entity.Entity> getEntityInstanceManager()
    • getBlockEntityInstanceManager

      public InstanceManager<net.minecraft.world.level.block.entity.BlockEntity> getBlockEntityInstanceManager()
    • delete

      public void delete()
      Free all acquired resources and invalidate this instance world.
    • beginFrame

      public void beginFrame(BeginFrameEvent event)
      Get ready to render a frame.

      Check and shift the origin coordinate.
      Call DynamicInstance.beginFrame() on all instances in this world.

    • tick

      public void tick()
      Tick the renderers after the game has ticked:

      Call TickableInstance.tick() on all instances in this world.

    • renderLayer

      public void renderLayer(RenderLayerEvent event)
      Draw the given layer.
    • loadEntities

      public void loadEntities(net.minecraft.client.multiplayer.ClientLevel world)
      Instantiate all the necessary instances to render the given world.