Class AbstractBlockEntityVisual<T extends net.minecraft.world.level.block.entity.BlockEntity>
java.lang.Object
dev.engine_room.flywheel.lib.visual.AbstractVisual
dev.engine_room.flywheel.lib.visual.AbstractBlockEntityVisual<T>
- Type Parameters:
T- The type ofBlockEntity.
- All Implemented Interfaces:
BlockEntityVisual<T>,LightUpdatedVisual,SectionTrackedVisual,Visual
public abstract class AbstractBlockEntityVisual<T extends net.minecraft.world.level.block.entity.BlockEntity>
extends AbstractVisual
implements BlockEntityVisual<T>, LightUpdatedVisual
The layer between a
There are a few additional features that overriding classes can opt in to: See the interfaces' documentation for more information about each one.
Implementing one or more of these will give an
BlockEntity and the Flywheel backend.
There are a few additional features that overriding classes can opt in to: See the interfaces' documentation for more information about each one.
Implementing one or more of these will give an
AbstractBlockEntityVisual access
to more interesting and regular points within a tick or a frame.-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.engine_room.flywheel.api.visual.SectionTrackedVisual
SectionTrackedVisual.SectionCollector -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Tprotected final net.minecraft.world.level.block.state.BlockStateprotected @UnknownNullability SectionTrackedVisual.SectionCollectorprotected final net.minecraft.core.BlockPosprotected final net.minecraft.core.BlockPosFields inherited from class dev.engine_room.flywheel.lib.visual.AbstractVisual
deleted, level, visualizationContext -
Constructor Summary
ConstructorsConstructorDescriptionAbstractBlockEntityVisual(VisualizationContext ctx, T blockEntity, float partialTick) -
Method Summary
Modifier and TypeMethodDescriptionprotected intbooleanLimits which frames this visual is updated on based on its distance from the camera.net.minecraft.core.BlockPosIn order to accommodate for floating point precision errors at high coordinates,VisualManagers are allowed to arbitrarily adjust the origin, and shift the level matrix provided as a shader uniform accordingly.booleanisVisible(org.joml.FrustumIntersection frustum) Check if this visual is within the given frustum.protected voidprotected voidprotected voidprotected voidprotected voidprotected voidvoidsetSectionCollector(SectionTrackedVisual.SectionCollector sectionCollector) Set the section collector object.Methods inherited from class dev.engine_room.flywheel.lib.visual.AbstractVisual
_delete, 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.api.visual.BlockEntityVisual
collectCrumblingInstancesMethods inherited from interface dev.engine_room.flywheel.api.visual.LightUpdatedVisual
updateLight
-
Field Details
-
blockEntity
-
pos
protected final net.minecraft.core.BlockPos pos -
visualPos
protected final net.minecraft.core.BlockPos visualPos -
blockState
protected final net.minecraft.world.level.block.state.BlockState blockState -
lightSections
-
-
Constructor Details
-
AbstractBlockEntityVisual
-
-
Method Details
-
setSectionCollector
Description copied from interface:SectionTrackedVisualSet the section collector object.This method is only called once, upon visual creation.
If the collector is invoked in this method, the visual will immediately be tracked in the given sections.- Specified by:
setSectionCollectorin interfaceSectionTrackedVisual- Parameters:
sectionCollector- The collector.
-
getVisualPosition
public net.minecraft.core.BlockPos getVisualPosition()In order to accommodate for floating point precision errors at high coordinates,VisualManagers are allowed to arbitrarily adjust the origin, and shift the level matrix provided as a shader uniform accordingly.- Returns:
- The
positionof theBlockEntitythis visual represents should be rendered at to appear in the correct location.
-
isVisible
public boolean isVisible(org.joml.FrustumIntersection frustum) Check if this visual is within the given frustum.- Parameters:
frustum- The current frustum.- Returns:
trueif this visual is possibly visible.
-
doDistanceLimitThisFrame
Limits which frames this visual is updated on based on its distance from the camera.You may optionally do this check to avoid updating your visual every frame when it is far away.
- Parameters:
context- The current frame context.- Returns:
trueif this visual shouldn't be updated this frame based on its distance from the camera.
-
computePackedLight
protected int computePackedLight() -
relight
-
relight
-
relight
-
relight
-
relight
-
relight
-