Class ShadowElement

java.lang.Object
dev.engine_room.flywheel.lib.visual.AbstractVisual
dev.engine_room.vanillin.elements.ShadowElement
All Implemented Interfaces:
dev.engine_room.flywheel.api.visual.DynamicVisual, dev.engine_room.flywheel.api.visual.Visual, dev.engine_room.flywheel.lib.visual.SimpleDynamicVisual

public final class ShadowElement extends dev.engine_room.flywheel.lib.visual.AbstractVisual implements dev.engine_room.flywheel.lib.visual.SimpleDynamicVisual
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.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
     

    Nested classes/interfaces inherited from interface dev.engine_room.flywheel.api.visual.DynamicVisual

    dev.engine_room.flywheel.api.visual.DynamicVisual.Context
  • Field Summary

    Fields inherited from class dev.engine_room.flywheel.lib.visual.AbstractVisual

    deleted, level, visualizationContext
  • Constructor Summary

    Constructors
    Constructor
    Description
    ShadowElement(dev.engine_room.flywheel.api.visualization.VisualizationContext ctx, net.minecraft.world.entity.Entity entity, float partialTick, ShadowElement.Config config)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    void
    beginFrame(dev.engine_room.flywheel.api.visual.DynamicVisual.Context context)
    Update the shadow instances.
    float
     
    radius(float radius)
    Set the radius of the shadow, in blocks, clamped to a maximum of 32.
    float
     
    strength(float strength)
    Set the strength of the shadow.

    Methods inherited from class dev.engine_room.flywheel.lib.visual.AbstractVisual

    delete, instancerProvider, renderOrigin, update

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface dev.engine_room.flywheel.lib.visual.SimpleDynamicVisual

    planFrame

    Methods inherited from interface dev.engine_room.flywheel.api.visual.Visual

    delete, update
  • Constructor Details

    • ShadowElement

      public ShadowElement(dev.engine_room.flywheel.api.visualization.VisualizationContext ctx, net.minecraft.world.entity.Entity entity, float partialTick, ShadowElement.Config config)
  • Method Details

    • radius

      public float radius()
    • strength

      public float strength()
    • radius

      public ShadowElement 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 ShadowElement strength(float strength)
      Set the strength of the shadow.
      Parameters:
      strength - The strength of the shadow.
    • beginFrame

      public void beginFrame(dev.engine_room.flywheel.api.visual.DynamicVisual.Context context)
      Update the shadow instances. You'd typically call this in your visual's beginFrame method.
      Specified by:
      beginFrame in interface dev.engine_room.flywheel.lib.visual.SimpleDynamicVisual
      Parameters:
      context - The frame context.
    • _delete

      protected void _delete()
      Specified by:
      _delete in class dev.engine_room.flywheel.lib.visual.AbstractVisual