Class ShadowComponent

java.lang.Object
dev.engine_room.flywheel.lib.visual.component.ShadowComponent
All Implemented Interfaces:
EntityComponent

public final class ShadowComponent extends Object implements EntityComponent
A component that uses instances to render an entity's shadow.

Use radius(float) to set the radius of the shadow, in blocks.
Use strength(float) to set the strength of the shadow.
The shadow will be cast on blocks at most min(radius, 2 * strength) blocks below the entity.

  • Constructor Details

    • ShadowComponent

      public ShadowComponent(VisualizationContext context, net.minecraft.world.entity.Entity entity)
  • Method Details

    • radius

      public float radius()
    • strength

      public float strength()
    • radius

      public ShadowComponent radius(float radius)
      Set the radius of the shadow, in blocks, clamped to a maximum of 32.

      Setting this to <= 0 will disable the shadow.

      Parameters:
      radius - The radius of the shadow, in blocks.
    • strength

      public ShadowComponent strength(float strength)
      Set the strength of the shadow.
      Parameters:
      strength - The strength of the shadow.
    • beginFrame

      public void beginFrame(DynamicVisual.Context context)
      Update the shadow instances. You'd typically call this in your visual's beginFrame method.
      Specified by:
      beginFrame in interface EntityComponent
      Parameters:
      context - The frame context.
    • delete

      public void delete()
      Specified by:
      delete in interface EntityComponent