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 Details

  • Method Details

    • get

      public static CloudItemRegistry get()
    • registerDataSerializer

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

      public int getNetId()
    • addNetId

      public void addNetId(@Nonnull CloudItemStack item)
    • getItemByNetId

      @Nonnull public CloudItemStack getItemByNetId(@Nonnull int stackNetId)
    • clearQueue

      public void clearQueue()
    • 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)