Class BlockEntityRegistry

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

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

    Modifier and Type
    Method
    Description
    void
     
    get()
     
    org.cloudburstmc.api.blockentity.BlockEntityType<?>
    getBlockEntityType​(String persistentId)
     
    getPersistentId​(org.cloudburstmc.api.blockentity.BlockEntityType<?> type)
     
    <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
    <T extends org.cloudburstmc.api.blockentity.BlockEntity>
    T
    newEntity​(org.cloudburstmc.api.blockentity.BlockEntityType<T> type, org.cloudburstmc.api.block.Block block)
     
    <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
    <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)
     

    Methods inherited from class java.lang.Object

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

    • get

      public static BlockEntityRegistry 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

      public String getPersistentId(org.cloudburstmc.api.blockentity.BlockEntityType<?> type)
    • 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 type
      chunk - chunk of block entity
      position - 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 type
      chunk - chunk of block entity
      position - position of block entity in world
      Returns:
      new entity
    • 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