Package org.cloudburstmc.server.registry
Class EntityRegistry
java.lang.Object
org.cloudburstmc.server.registry.EntityRegistry
- All Implemented Interfaces:
org.cloudburstmc.api.registry.Registry
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static EntityRegistryget()com.nukkitx.nbt.NbtMaporg.cloudburstmc.api.entity.EntityType<?>getEntityType(int runtimeId)org.cloudburstmc.api.entity.EntityType<?>getEntityType(org.cloudburstmc.api.util.Identifier identifier)com.google.common.collect.ImmutableSet<org.cloudburstmc.api.entity.EntityType<?>>org.cloudburstmc.api.util.IdentifiergetIdentifier(String legacyName)getLegacyName(org.cloudburstmc.api.util.Identifier identifier)intgetRuntimeType(org.cloudburstmc.api.entity.EntityType<?> type)<T extends org.cloudburstmc.api.entity.Entity>
TnewEntity(org.cloudburstmc.api.entity.EntityType<T> type, Object plugin, org.cloudburstmc.api.level.Location location)Creates new entity of given type from specific plugin factory<T extends org.cloudburstmc.api.entity.Entity>
TnewEntity(org.cloudburstmc.api.entity.EntityType<T> type, org.cloudburstmc.api.level.Location location)Creates new entity of given typelongAllocate new entity ID<T extends org.cloudburstmc.api.entity.Entity>
voidregister(Object plugin, org.cloudburstmc.api.entity.EntityType<T> type, org.cloudburstmc.api.entity.EntityFactory<T> factory, int priority, boolean hasSpawnEgg)
-
Method Details
-
get
-
register
public <T extends org.cloudburstmc.api.entity.Entity> void register(Object plugin, org.cloudburstmc.api.entity.EntityType<T> type, org.cloudburstmc.api.entity.EntityFactory<T> factory, int priority, boolean hasSpawnEgg) -
getRuntimeType
public int getRuntimeType(org.cloudburstmc.api.entity.EntityType<?> type) -
getEntityType
public org.cloudburstmc.api.entity.EntityType<?> getEntityType(int runtimeId) -
getEntityType
public org.cloudburstmc.api.entity.EntityType<?> getEntityType(org.cloudburstmc.api.util.Identifier identifier) -
newEntity
public <T extends org.cloudburstmc.api.entity.Entity> T newEntity(org.cloudburstmc.api.entity.EntityType<T> type, org.cloudburstmc.api.level.Location location)Creates new entity of given type- Type Parameters:
T- entity class type- Parameters:
type- entity typelocation- location to spawn entity- Returns:
- new entity
-
newEntity
public <T extends org.cloudburstmc.api.entity.Entity> T newEntity(org.cloudburstmc.api.entity.EntityType<T> type, Object plugin, org.cloudburstmc.api.level.Location location)Creates new entity of given type from specific plugin factory- Type Parameters:
T- entity class type- Parameters:
type- entity typelocation- location to spawn entity- Returns:
- new entity
-
newEntityId
public long newEntityId()Allocate new entity ID- Returns:
- entity ID
-
getIdentifier
-
getLegacyName
-
getEntityIdentifiersPalette
public com.nukkitx.nbt.NbtMap getEntityIdentifiersPalette() -
getEntityTypes
public com.google.common.collect.ImmutableSet<org.cloudburstmc.api.entity.EntityType<?>> getEntityTypes() -
close
public void close() throws org.cloudburstmc.api.registry.RegistryException- Specified by:
closein interfaceorg.cloudburstmc.api.registry.Registry- Throws:
org.cloudburstmc.api.registry.RegistryException
-