Package org.cloudburstmc.server.registry
Class BlockEntityRegistry
java.lang.Object
org.cloudburstmc.server.registry.BlockEntityRegistry
- All Implemented Interfaces:
org.cloudburstmc.api.registry.Registry
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static BlockEntityRegistryget()org.cloudburstmc.api.blockentity.BlockEntityType<?>getBlockEntityType(String persistentId)getPersistentId(org.cloudburstmc.api.blockentity.BlockEntityType<?> type)<T extends org.cloudburstmc.api.blockentity.BlockEntity>
TnewEntity(org.cloudburstmc.api.blockentity.BlockEntityType<T> type, Object plugin, CloudChunk chunk, com.nukkitx.math.vector.Vector3i position)Creates new entity of given type from specific plugin factory<T extends org.cloudburstmc.api.blockentity.BlockEntity>
TnewEntity(org.cloudburstmc.api.blockentity.BlockEntityType<T> type, org.cloudburstmc.api.block.Block block)<T extends org.cloudburstmc.api.blockentity.BlockEntity>
TnewEntity(org.cloudburstmc.api.blockentity.BlockEntityType<T> type, CloudChunk chunk, com.nukkitx.math.vector.Vector3i position)Creates new entity of given type<T extends org.cloudburstmc.api.blockentity.BlockEntity>
voidregister(Object plugin, org.cloudburstmc.api.blockentity.BlockEntityType<T> type, org.cloudburstmc.api.blockentity.BlockEntityFactory<T> factory, int priority)
-
Method Details
-
get
-
register
public <T extends org.cloudburstmc.api.blockentity.BlockEntity> void register(Object plugin, org.cloudburstmc.api.blockentity.BlockEntityType<T> type, org.cloudburstmc.api.blockentity.BlockEntityFactory<T> factory, int priority) throws org.cloudburstmc.api.registry.RegistryException- Throws:
org.cloudburstmc.api.registry.RegistryException
-
getPersistentId
-
getBlockEntityType
@Nonnull public org.cloudburstmc.api.blockentity.BlockEntityType<?> getBlockEntityType(String persistentId) -
newEntity
public <T extends org.cloudburstmc.api.blockentity.BlockEntity> T newEntity(org.cloudburstmc.api.blockentity.BlockEntityType<T> type, org.cloudburstmc.api.block.Block block) -
newEntity
public <T extends org.cloudburstmc.api.blockentity.BlockEntity> T newEntity(org.cloudburstmc.api.blockentity.BlockEntityType<T> type, CloudChunk chunk, com.nukkitx.math.vector.Vector3i position)Creates new entity of given type- Type Parameters:
T- entity class type- Parameters:
type- entity typechunk- chunk of block entityposition- position of block entity in world- Returns:
- new entity
-
newEntity
public <T extends org.cloudburstmc.api.blockentity.BlockEntity> T newEntity(org.cloudburstmc.api.blockentity.BlockEntityType<T> type, Object plugin, CloudChunk chunk, com.nukkitx.math.vector.Vector3i position)Creates new entity of given type from specific plugin factory- Type Parameters:
T- entity class type- Parameters:
type- entity typechunk- chunk of block entityposition- position of block entity in world- Returns:
- new entity
-
close
public void close() throws org.cloudburstmc.api.registry.RegistryException- Specified by:
closein interfaceorg.cloudburstmc.api.registry.Registry- Throws:
org.cloudburstmc.api.registry.RegistryException
-