Package org.cloudburstmc.server.registry
Class CloudItemRegistry
java.lang.Object
org.cloudburstmc.server.registry.CloudItemRegistry
- All Implemented Interfaces:
org.cloudburstmc.api.registry.ItemRegistry,org.cloudburstmc.api.registry.Registry
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()org.cloudburstmc.api.util.IdentifierfromLegacy(int legacyId)static CloudItemRegistryget()org.cloudburstmc.api.item.behavior.ItemBehaviorgetBehavior(org.cloudburstmc.api.item.ItemType type)com.nukkitx.protocol.bedrock.packet.CreativeContentPacketintgetCreativeItemIndex(org.cloudburstmc.api.item.ItemStack item)List<org.cloudburstmc.api.item.ItemStack>org.cloudburstmc.api.util.IdentifiergetIdentifier(int runtimeId)Collection<org.cloudburstmc.api.util.Identifier>getIdentifiers(org.cloudburstmc.api.item.ItemType type)org.cloudburstmc.api.item.ItemStackgetItem(org.cloudburstmc.api.block.BlockState state, int amount)org.cloudburstmc.api.item.ItemStackList<com.nukkitx.protocol.bedrock.packet.StartGamePacket.ItemEntry>org.cloudburstmc.api.item.ItemStackgetItemLegacy(int legacyId)org.cloudburstmc.api.item.ItemStackgetItemLegacy(int legacyId, short damage)org.cloudburstmc.api.item.ItemStackgetItemLegacy(int legacyId, short damage, int amount)com.google.common.collect.ImmutableList<org.cloudburstmc.api.util.Identifier>getItems()intgetRuntimeId(org.cloudburstmc.api.util.Identifier identifier)getSerializer(Class<?> metaClass)getSerializer(org.cloudburstmc.api.item.ItemType type)org.cloudburstmc.api.item.ItemTypegetType(int legacyId)org.cloudburstmc.api.item.ItemTypegetType(org.cloudburstmc.api.util.Identifier id)voidloadCreativeItems(URI jsonFile)voidregister(org.cloudburstmc.api.item.ItemType itemType, org.cloudburstmc.api.item.behavior.ItemBehavior itemBehavior, org.cloudburstmc.api.util.Identifier... identifiers)voidregister(org.cloudburstmc.api.item.ItemType type, ItemSerializer serializer, org.cloudburstmc.api.item.behavior.ItemBehavior behavior, org.cloudburstmc.api.util.Identifier... identifiers)voidregisterCreativeItem(org.cloudburstmc.api.item.ItemStack item)<T> voidregisterDataSerializer(Class<T> metadataClass, ItemDataSerializer<T> serializer)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cloudburstmc.api.registry.ItemRegistry
getItem, getItem
-
Field Details
-
AIR
-
-
Method Details
-
get
-
registerDataSerializer
-
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
-
getSerializer
-
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:
registerin interfaceorg.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:
getItemin interfaceorg.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:
getItemin interfaceorg.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:
getIdentifierin interfaceorg.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:
getItemsin interfaceorg.cloudburstmc.api.registry.ItemRegistry
-
close
public void close() throws org.cloudburstmc.api.registry.RegistryException- Specified by:
closein interfaceorg.cloudburstmc.api.registry.Registry- Throws:
org.cloudburstmc.api.registry.RegistryException
-
getItemEntries
-
loadCreativeItems
-
registerCreativeItem
public void registerCreativeItem(org.cloudburstmc.api.item.ItemStack item) -
getCreativeItems
-
getCreativeContent
public com.nukkitx.protocol.bedrock.packet.CreativeContentPacket getCreativeContent() -
getCreativeItemIndex
public int getCreativeItemIndex(org.cloudburstmc.api.item.ItemStack item)
-