Class SimpleBlockEntityInstancingController<T extends net.minecraft.world.level.block.entity.BlockEntity>
java.lang.Object
com.jozufozu.flywheel.backend.instancing.blockentity.SimpleBlockEntityInstancingController<T>
- All Implemented Interfaces:
BlockEntityInstancingController<T>
public class SimpleBlockEntityInstancingController<T extends net.minecraft.world.level.block.entity.BlockEntity>
extends Object
implements BlockEntityInstancingController<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BiFunction<MaterialManager,T, BlockEntityInstance<? super T>> -
Constructor Summary
ConstructorsConstructorDescriptionSimpleBlockEntityInstancingController(BiFunction<MaterialManager, T, BlockEntityInstance<? super T>> instanceFactory, Predicate<T> skipRender) -
Method Summary
Modifier and TypeMethodDescriptionBlockEntityInstance<? super T>createInstance(MaterialManager materialManager, T blockEntity) Given a block entity and a material manager, constructs an instance for the block entity.booleanshouldSkipRender(T blockEntity) Checks if the given block entity should not be rendered normally.
-
Field Details
-
instanceFactory
protected BiFunction<MaterialManager,T extends net.minecraft.world.level.block.entity.BlockEntity, instanceFactoryBlockEntityInstance<? super T extends net.minecraft.world.level.block.entity.BlockEntity>> -
skipRender
-
-
Constructor Details
-
SimpleBlockEntityInstancingController
public SimpleBlockEntityInstancingController(BiFunction<MaterialManager, T, BlockEntityInstance<? super T>> instanceFactory, Predicate<T> skipRender)
-
-
Method Details
-
createInstance
public BlockEntityInstance<? super T> createInstance(MaterialManager materialManager, T blockEntity) Description copied from interface:BlockEntityInstancingControllerGiven a block entity and a material manager, constructs an instance for the block entity.- Specified by:
createInstancein interfaceBlockEntityInstancingController<T extends net.minecraft.world.level.block.entity.BlockEntity>- Parameters:
materialManager- The material manager to use.blockEntity- The block entity to construct an instance for.- Returns:
- The instance.
-
shouldSkipRender
Description copied from interface:BlockEntityInstancingControllerChecks if the given block entity should not be rendered normally.- Specified by:
shouldSkipRenderin interfaceBlockEntityInstancingController<T extends net.minecraft.world.level.block.entity.BlockEntity>- Parameters:
blockEntity- The block entity to check.- Returns:
trueif the block entity should not be rendered normally,falseif it should.
-