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 ClassesNested 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
ConstructorsConstructorDescriptionShadowElement(dev.engine_room.flywheel.api.visualization.VisualizationContext ctx, net.minecraft.world.entity.Entity entity, float partialTick, ShadowElement.Config config) -
Method Summary
Modifier and TypeMethodDescriptionprotected void_delete()voidbeginFrame(dev.engine_room.flywheel.api.visual.DynamicVisual.Context context) Update the shadow instances.floatradius()radius(float radius) Set the radius of the shadow, in blocks, clamped to a maximum of 32.floatstrength()strength(float strength) Set the strength of the shadow.Methods inherited from class dev.engine_room.flywheel.lib.visual.AbstractVisual
delete, instancerProvider, renderOrigin, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.engine_room.flywheel.lib.visual.SimpleDynamicVisual
planFrameMethods 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
Set the radius of the shadow, in blocks, clamped to a maximum of 32.Setting this to
<= 0will disable the shadow.- Parameters:
radius- The radius of the shadow, in blocks.
-
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'sbeginFramemethod.- Specified by:
beginFramein interfacedev.engine_room.flywheel.lib.visual.SimpleDynamicVisual- Parameters:
context- The frame context.
-
_delete
protected void _delete()- Specified by:
_deletein classdev.engine_room.flywheel.lib.visual.AbstractVisual
-