Class InstancedRenderRegistry
java.lang.Object
com.jozufozu.flywheel.backend.instancing.InstancedRenderRegistry
A utility class for registering and retrieving
InstancingControllers.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInstancedRenderRegistry.BlockEntityConfig<T extends net.minecraft.world.level.block.entity.BlockEntity>An object to configure the instancing controller for a block entity.static classInstancedRenderRegistry.EntityConfig<T extends net.minecraft.world.entity.Entity>An object to configure the instancing controller for an entity. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends net.minecraft.world.entity.Entity>
booleancanInstance(net.minecraft.world.entity.EntityType<? extends T> type) Checks if the given entity type can be instanced.static <T extends net.minecraft.world.level.block.entity.BlockEntity>
booleancanInstance(net.minecraft.world.level.block.entity.BlockEntityType<? extends T> type) Checks if the given block entity type can be instanced.static <T extends net.minecraft.world.entity.Entity>
InstancedRenderRegistry.EntityConfig<T>configure(net.minecraft.world.entity.EntityType<T> type) Get an object to configure the instancing controller for the given entity type.static <T extends net.minecraft.world.level.block.entity.BlockEntity>
InstancedRenderRegistry.BlockEntityConfig<T>configure(net.minecraft.world.level.block.entity.BlockEntityType<T> type) Get an object to configure the instancing controller for the given block entity type.static <T extends net.minecraft.world.level.block.entity.BlockEntity>
BlockEntityInstance<? super T>createInstance(MaterialManager materialManager, T blockEntity) Creates an instance for the given block entity, if possible.static <T extends net.minecraft.world.entity.Entity>
EntityInstancingController<? super T>getController(net.minecraft.world.entity.EntityType<T> type) Gets the instancing controller for the given entity type, if one exists.static <T extends net.minecraft.world.level.block.entity.BlockEntity>
BlockEntityInstancingController<? super T>getController(net.minecraft.world.level.block.entity.BlockEntityType<T> type) Gets the instancing controller for the given block entity type, if one exists.static <T extends net.minecraft.world.level.block.entity.BlockEntity>
net.minecraft.world.level.block.entity.BlockEntityType<? super T>getType(T blockEntity) Gets the type of the given block entity.static <T extends net.minecraft.world.entity.Entity>
voidsetController(net.minecraft.world.entity.EntityType<T> type, EntityInstancingController<? super T> instancingController) Sets the instancing controller for the given entity type.static <T extends net.minecraft.world.level.block.entity.BlockEntity>
voidsetController(net.minecraft.world.level.block.entity.BlockEntityType<T> type, BlockEntityInstancingController<? super T> instancingController) Sets the instancing controller for the given block entity type.static <T extends net.minecraft.world.level.block.entity.BlockEntity>
booleanshouldSkipRender(T blockEntity) Checks if the given block entity is instanced and should not be rendered normally.
-
Constructor Details
-
InstancedRenderRegistry
public InstancedRenderRegistry()
-
-
Method Details
-
canInstance
public static <T extends net.minecraft.world.level.block.entity.BlockEntity> boolean canInstance(net.minecraft.world.level.block.entity.BlockEntityType<? extends T> type) Checks if the given block entity type can be instanced.- Type Parameters:
T- The type of the block entity.- Parameters:
type- The block entity type to check.- Returns:
trueif the block entity type can be instanced.
-
canInstance
public static <T extends net.minecraft.world.entity.Entity> boolean canInstance(net.minecraft.world.entity.EntityType<? extends T> type) Checks if the given entity type can be instanced.- Type Parameters:
T- The type of the entity.- Parameters:
type- The entity type to check.- Returns:
trueif the entity type can be instanced.
-
createInstance
@Nullable public static <T extends net.minecraft.world.level.block.entity.BlockEntity> BlockEntityInstance<? super T> createInstance(MaterialManager materialManager, T blockEntity) Creates an instance for the given block entity, if possible.- Type Parameters:
T- The type of the block entity.- Parameters:
materialManager- The material manager to use.blockEntity- The block entity to create an instance of.- Returns:
- An instance of the block entity, or
nullif the block entity cannot be instanced.
-
createInstance
@Nullable public static <T extends net.minecraft.world.entity.Entity> EntityInstance<? super T> createInstance(MaterialManager materialManager, T entity) Creates an instance for the given entity, if possible.- Type Parameters:
T- The type of the entity.- Parameters:
materialManager- The material manager to use.entity- The entity to create an instance of.- Returns:
- An instance of the entity, or
nullif the entity cannot be instanced.
-
shouldSkipRender
public static <T extends net.minecraft.world.level.block.entity.BlockEntity> boolean shouldSkipRender(T blockEntity) Checks if the given block entity is instanced and should not be rendered normally.- Type Parameters:
T- The type of the block entity.- Parameters:
blockEntity- The block entity to check.- Returns:
trueif the block entity is instanced and should not be rendered normally.
-
shouldSkipRender
public static <T extends net.minecraft.world.entity.Entity> boolean shouldSkipRender(T entity) Checks if the given entity is instanced and should not be rendered normally.- Type Parameters:
T- The type of the entity.- Parameters:
entity- The entity to check.- Returns:
trueif the entity is instanced and should not be rendered normally.
-
configure
public static <T extends net.minecraft.world.level.block.entity.BlockEntity> InstancedRenderRegistry.BlockEntityConfig<T> configure(net.minecraft.world.level.block.entity.BlockEntityType<T> type) Get an object to configure the instancing controller for the given block entity type.- Type Parameters:
T- The type of the block entity.- Parameters:
type- The block entity type to configure.- Returns:
- The configuration object.
-
configure
public static <T extends net.minecraft.world.entity.Entity> InstancedRenderRegistry.EntityConfig<T> configure(net.minecraft.world.entity.EntityType<T> type) Get an object to configure the instancing controller for the given entity type.- Type Parameters:
T- The type of the entity.- Parameters:
type- The entity type to configure.- Returns:
- The configuration object.
-
getController
@Nullable public static <T extends net.minecraft.world.level.block.entity.BlockEntity> BlockEntityInstancingController<? super T> getController(net.minecraft.world.level.block.entity.BlockEntityType<T> type) Gets the instancing controller for the given block entity type, if one exists.- Type Parameters:
T- The type of the block entity.- Parameters:
type- The block entity type to get the instancing controller for.- Returns:
- The instancing controller for the given block entity type, or
nullif none exists.
-
getController
@Nullable public static <T extends net.minecraft.world.entity.Entity> EntityInstancingController<? super T> getController(net.minecraft.world.entity.EntityType<T> type) Gets the instancing controller for the given entity type, if one exists.- Type Parameters:
T- The type of the entity.- Parameters:
type- The entity type to get the instancing controller for.- Returns:
- The instancing controller for the given entity type, or
nullif none exists.
-
setController
public static <T extends net.minecraft.world.level.block.entity.BlockEntity> void setController(net.minecraft.world.level.block.entity.BlockEntityType<T> type, BlockEntityInstancingController<? super T> instancingController) Sets the instancing controller for the given block entity type.- Type Parameters:
T- The type of the block entity.- Parameters:
type- The block entity type to set the instancing controller for.instancingController- The instancing controller to set.
-
setController
public static <T extends net.minecraft.world.entity.Entity> void setController(net.minecraft.world.entity.EntityType<T> type, EntityInstancingController<? super T> instancingController) Sets the instancing controller for the given entity type.- Type Parameters:
T- The type of the entity.- Parameters:
type- The entity type to set the instancing controller for.instancingController- The instancing controller to set.
-
getType
public static <T extends net.minecraft.world.level.block.entity.BlockEntity> net.minecraft.world.level.block.entity.BlockEntityType<? super T> getType(T blockEntity) Gets the type of the given block entity.- Type Parameters:
T- The type of the block entity.- Parameters:
blockEntity- The block entity to get the type of.- Returns:
- The
BlockEntityTypeassociated with the given block entity.
-
getType
public static <T extends net.minecraft.world.entity.Entity> net.minecraft.world.entity.EntityType<? super T> getType(T entity) Gets the type of the given entity.- Type Parameters:
T- The type of the entity.- Parameters:
entity- The entity to get the type of.- Returns:
- The
EntityTypeassociated with the given entity.
-