Class BlockEntityInstance<T extends net.minecraft.world.level.block.entity.BlockEntity>
java.lang.Object
com.jozufozu.flywheel.backend.instancing.AbstractInstance
com.jozufozu.flywheel.backend.instancing.blockentity.BlockEntityInstance<T>
- Type Parameters:
T- The type ofBlockEntityyour class is an instance of.
- All Implemented Interfaces:
Instance,LightListener
- Direct Known Subclasses:
BellInstance,ChestInstance,ShulkerBoxInstance
public abstract class BlockEntityInstance<T extends net.minecraft.world.level.block.entity.BlockEntity>
extends AbstractInstance
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 a
BlockEntity and the Flywheel backend.
AbstractInstance.updateLight() is called after construction.
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 a
BlockEntityInstance access
to more interesting and regular points within a tick or a frame.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Tprotected final net.minecraft.world.level.block.state.BlockStateprotected final net.minecraft.core.BlockPosprotected final net.minecraft.core.BlockPosFields inherited from class com.jozufozu.flywheel.backend.instancing.AbstractInstance
materialManager, removed, world -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.BlockPosIn order to accommodate for floating point precision errors at high coordinates,BlockEntityInstanceManagers are allowed to arbitrarily adjust the origin, and shift the world matrix provided as a shader uniform accordingly.protected Material<OrientedData>net.minecraft.core.BlockPosbooleanJust beforeAbstractInstance.update()would be called,shouldReset()is checked.Methods inherited from class com.jozufozu.flywheel.backend.instancing.AbstractInstance
init, isListenerInvalid, onLightUpdate, relight, relight, relight, relight, remove, removeAndMark, update, updateLightMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jozufozu.flywheel.light.LightListener
onLightPacket
-
Field Details
-
blockEntity
-
pos
protected final net.minecraft.core.BlockPos pos -
instancePos
protected final net.minecraft.core.BlockPos instancePos -
blockState
protected final net.minecraft.world.level.block.state.BlockState blockState
-
-
Constructor Details
-
BlockEntityInstance
-
-
Method Details
-
shouldReset
public boolean shouldReset()Just beforeAbstractInstance.update()would be called,shouldReset()is checked. If this function returnstrue, then this instance will beremoved, and another instance will be constructed to replace it. This allows for more sane resource acquisition compared to trying to update everything within the lifetime of an instance.- Overrides:
shouldResetin classAbstractInstance- Returns:
trueif this instance should be discarded and refreshed.
-
getInstancePosition
public net.minecraft.core.BlockPos getInstancePosition()In order to accommodate for floating point precision errors at high coordinates,BlockEntityInstanceManagers are allowed to arbitrarily adjust the origin, and shift the world matrix provided as a shader uniform accordingly.- Returns:
- The
positionof theBlockEntitythis instance represents should be rendered at to appear in the correct location.
-
getWorldPosition
public net.minecraft.core.BlockPos getWorldPosition() -
getTransformMaterial
-
getOrientedMaterial
-
getVolume
-