Class EntityRegistry

java.lang.Object
org.cloudburstmc.server.registry.EntityRegistry
All Implemented Interfaces:
org.cloudburstmc.api.registry.Registry

public class EntityRegistry extends Object implements org.cloudburstmc.api.registry.Registry
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    get()
     
    com.nukkitx.nbt.NbtMap
     
    org.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.Identifier
    getIdentifier​(String legacyName)
     
    getLegacyName​(org.cloudburstmc.api.util.Identifier identifier)
     
    int
    getRuntimeType​(org.cloudburstmc.api.entity.EntityType<?> type)
     
    <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
    <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
    long
    Allocate new entity ID
    <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)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • get

      public static EntityRegistry 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 type
      location - 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 type
      location - location to spawn entity
      Returns:
      new entity
    • newEntityId

      public long newEntityId()
      Allocate new entity ID
      Returns:
      entity ID
    • getIdentifier

      public org.cloudburstmc.api.util.Identifier getIdentifier(String legacyName)
    • getLegacyName

      public String getLegacyName(org.cloudburstmc.api.util.Identifier identifier)
    • 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:
      close in interface org.cloudburstmc.api.registry.Registry
      Throws:
      org.cloudburstmc.api.registry.RegistryException