Class CloudItemRegistry

java.lang.Object
org.cloudburstmc.server.registry.CloudItemRegistry
All Implemented Interfaces:
org.cloudburstmc.api.registry.ItemRegistry, org.cloudburstmc.api.registry.Registry

public class CloudItemRegistry extends Object implements org.cloudburstmc.api.registry.ItemRegistry
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    org.cloudburstmc.api.util.Identifier
    fromLegacy​(int legacyId)
     
    get()
     
    org.cloudburstmc.api.item.behavior.ItemBehavior
    getBehavior​(org.cloudburstmc.api.item.ItemType type)
     
    com.nukkitx.protocol.bedrock.packet.CreativeContentPacket
     
    int
    getCreativeItemIndex​(org.cloudburstmc.api.item.ItemStack item)
     
    List<org.cloudburstmc.api.item.ItemStack>
     
    org.cloudburstmc.api.util.Identifier
    getIdentifier​(int runtimeId)
     
    Collection<org.cloudburstmc.api.util.Identifier>
    getIdentifiers​(org.cloudburstmc.api.item.ItemType type)
     
    org.cloudburstmc.api.item.ItemStack
    getItem​(org.cloudburstmc.api.block.BlockState state, int amount)
     
    org.cloudburstmc.api.item.ItemStack
    getItem​(org.cloudburstmc.api.item.ItemType type, int amount, Object... metadata)
     
    List<com.nukkitx.protocol.bedrock.packet.StartGamePacket.ItemEntry>
     
    org.cloudburstmc.api.item.ItemStack
    getItemLegacy​(int legacyId)
     
    org.cloudburstmc.api.item.ItemStack
    getItemLegacy​(int legacyId, short damage)
     
    org.cloudburstmc.api.item.ItemStack
    getItemLegacy​(int legacyId, short damage, int amount)
     
    com.google.common.collect.ImmutableList<org.cloudburstmc.api.util.Identifier>
     
    int
    getRuntimeId​(org.cloudburstmc.api.util.Identifier identifier)
     
    getSerializer​(Class<?> metaClass)
     
    getSerializer​(org.cloudburstmc.api.item.ItemType type)
     
    org.cloudburstmc.api.item.ItemType
    getType​(int legacyId)
     
    org.cloudburstmc.api.item.ItemType
    getType​(org.cloudburstmc.api.util.Identifier id)
     
    void
    loadCreativeItems​(URI jsonFile)
     
    void
    register​(org.cloudburstmc.api.item.ItemType itemType, org.cloudburstmc.api.item.behavior.ItemBehavior itemBehavior, org.cloudburstmc.api.util.Identifier... identifiers)
     
    void
    register​(org.cloudburstmc.api.item.ItemType type, ItemSerializer serializer, org.cloudburstmc.api.item.behavior.ItemBehavior behavior, org.cloudburstmc.api.util.Identifier... identifiers)
     
    void
    registerCreativeItem​(org.cloudburstmc.api.item.ItemStack item)
     
    <T> void
    registerDataSerializer​(Class<T> metadataClass, ItemDataSerializer<T> serializer)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.cloudburstmc.api.registry.ItemRegistry

    getItem, getItem
  • Field Details

  • Method Details

    • get

      public static CloudItemRegistry get()
    • registerDataSerializer

      public <T> void registerDataSerializer(Class<T> metadataClass, ItemDataSerializer<T> serializer)
    • register

      public void register(org.cloudburstmc.api.item.ItemType type, ItemSerializer serializer, org.cloudburstmc.api.item.behavior.ItemBehavior behavior, org.cloudburstmc.api.util.Identifier... identifiers) throws org.cloudburstmc.api.registry.RegistryException
      Throws:
      org.cloudburstmc.api.registry.RegistryException
    • getSerializer

      public ItemSerializer getSerializer(org.cloudburstmc.api.item.ItemType type)
    • getSerializer

      public ItemDataSerializer<?> getSerializer(Class<?> metaClass)
    • getType

      public org.cloudburstmc.api.item.ItemType getType(org.cloudburstmc.api.util.Identifier id)
    • getType

      public org.cloudburstmc.api.item.ItemType getType(int legacyId)
    • getItemLegacy

      public org.cloudburstmc.api.item.ItemStack getItemLegacy(int legacyId)
    • getItemLegacy

      public org.cloudburstmc.api.item.ItemStack getItemLegacy(int legacyId, short damage)
    • getItemLegacy

      public org.cloudburstmc.api.item.ItemStack getItemLegacy(int legacyId, short damage, int amount)
    • register

      public void register(org.cloudburstmc.api.item.ItemType itemType, org.cloudburstmc.api.item.behavior.ItemBehavior itemBehavior, org.cloudburstmc.api.util.Identifier... identifiers) throws org.cloudburstmc.api.registry.RegistryException
      Specified by:
      register in interface org.cloudburstmc.api.registry.ItemRegistry
      Throws:
      org.cloudburstmc.api.registry.RegistryException
    • getItem

      public org.cloudburstmc.api.item.ItemStack getItem(org.cloudburstmc.api.block.BlockState state, int amount) throws org.cloudburstmc.api.registry.RegistryException
      Specified by:
      getItem in interface org.cloudburstmc.api.registry.ItemRegistry
      Throws:
      org.cloudburstmc.api.registry.RegistryException
    • getItem

      public org.cloudburstmc.api.item.ItemStack getItem(org.cloudburstmc.api.item.ItemType type, int amount, Object... metadata) throws org.cloudburstmc.api.registry.RegistryException
      Specified by:
      getItem in interface org.cloudburstmc.api.registry.ItemRegistry
      Throws:
      org.cloudburstmc.api.registry.RegistryException
    • getIdentifiers

      public Collection<org.cloudburstmc.api.util.Identifier> getIdentifiers(org.cloudburstmc.api.item.ItemType type)
    • getBehavior

      public org.cloudburstmc.api.item.behavior.ItemBehavior getBehavior(org.cloudburstmc.api.item.ItemType type)
    • fromLegacy

      public org.cloudburstmc.api.util.Identifier fromLegacy(int legacyId) throws org.cloudburstmc.api.registry.RegistryException
      Throws:
      org.cloudburstmc.api.registry.RegistryException
    • getIdentifier

      public org.cloudburstmc.api.util.Identifier getIdentifier(int runtimeId) throws org.cloudburstmc.api.registry.RegistryException
      Specified by:
      getIdentifier in interface org.cloudburstmc.api.registry.ItemRegistry
      Throws:
      org.cloudburstmc.api.registry.RegistryException
    • getRuntimeId

      public int getRuntimeId(org.cloudburstmc.api.util.Identifier identifier) throws org.cloudburstmc.api.registry.RegistryException
      Throws:
      org.cloudburstmc.api.registry.RegistryException
    • getItems

      public com.google.common.collect.ImmutableList<org.cloudburstmc.api.util.Identifier> getItems()
      Specified by:
      getItems in interface org.cloudburstmc.api.registry.ItemRegistry
    • 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
    • getItemEntries

      public List<com.nukkitx.protocol.bedrock.packet.StartGamePacket.ItemEntry> getItemEntries()
    • loadCreativeItems

      public void loadCreativeItems(URI jsonFile)
    • registerCreativeItem

      public void registerCreativeItem(org.cloudburstmc.api.item.ItemStack item)
    • getCreativeItems

      public List<org.cloudburstmc.api.item.ItemStack> getCreativeItems()
    • getCreativeContent

      public com.nukkitx.protocol.bedrock.packet.CreativeContentPacket getCreativeContent()
    • getCreativeItemIndex

      public int getCreativeItemIndex(org.cloudburstmc.api.item.ItemStack item)