Class GeyserDefineCustomItemsEventImpl

java.lang.Object
org.geysermc.geyser.event.type.GeyserDefineCustomItemsEventImpl
All Implemented Interfaces:
org.geysermc.event.Event, org.geysermc.geyser.api.event.lifecycle.GeyserDefineCustomItemsEvent

public abstract class GeyserDefineCustomItemsEventImpl extends Object implements org.geysermc.geyser.api.event.lifecycle.GeyserDefineCustomItemsEvent
  • Constructor Summary

    Constructors
    Constructor
    Description
    GeyserDefineCustomItemsEventImpl(com.google.common.collect.Multimap<String,org.geysermc.geyser.api.item.custom.CustomItemData> customItems, List<org.geysermc.geyser.api.item.custom.NonVanillaCustomItemData> nonVanillaCustomItems)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull Map<String,Collection<org.geysermc.geyser.api.item.custom.CustomItemData>>
    Gets a multimap of all the already registered custom items indexed by the item's extended java item's identifier.
    @NonNull List<org.geysermc.geyser.api.item.custom.NonVanillaCustomItemData>
    Gets the list of the already registered non-vanilla custom items.
    abstract boolean
    register(@NonNull String identifier, @NonNull org.geysermc.geyser.api.item.custom.CustomItemData customItemData)
    Registers a custom item with a base Java item.
    abstract boolean
    register(@NonNull org.geysermc.geyser.api.item.custom.NonVanillaCustomItemData customItemData)
    Registers a custom item with no base item.

    Methods inherited from class java.lang.Object

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

    • GeyserDefineCustomItemsEventImpl

      public GeyserDefineCustomItemsEventImpl(com.google.common.collect.Multimap<String,org.geysermc.geyser.api.item.custom.CustomItemData> customItems, List<org.geysermc.geyser.api.item.custom.NonVanillaCustomItemData> nonVanillaCustomItems)
  • Method Details

    • getExistingCustomItems

      public @NonNull Map<String,Collection<org.geysermc.geyser.api.item.custom.CustomItemData>> getExistingCustomItems()
      Gets a multimap of all the already registered custom items indexed by the item's extended java item's identifier.
      Specified by:
      getExistingCustomItems in interface org.geysermc.geyser.api.event.lifecycle.GeyserDefineCustomItemsEvent
      Returns:
      a multimap of all the already registered custom items
    • getExistingNonVanillaCustomItems

      public @NonNull List<org.geysermc.geyser.api.item.custom.NonVanillaCustomItemData> getExistingNonVanillaCustomItems()
      Gets the list of the already registered non-vanilla custom items.
      Specified by:
      getExistingNonVanillaCustomItems in interface org.geysermc.geyser.api.event.lifecycle.GeyserDefineCustomItemsEvent
      Returns:
      the list of the already registered non-vanilla custom items
    • register

      public abstract boolean register(@NonNull String identifier, @NonNull org.geysermc.geyser.api.item.custom.CustomItemData customItemData)
      Registers a custom item with a base Java item. This is used to register items with custom textures and properties based on NBT data.
      Specified by:
      register in interface org.geysermc.geyser.api.event.lifecycle.GeyserDefineCustomItemsEvent
      Parameters:
      identifier - the base (java) item
      customItemData - the custom item data to register
      Returns:
      if the item was registered
    • register

      public abstract boolean register(@NonNull org.geysermc.geyser.api.item.custom.NonVanillaCustomItemData customItemData)
      Registers a custom item with no base item. This is used for mods.
      Specified by:
      register in interface org.geysermc.geyser.api.event.lifecycle.GeyserDefineCustomItemsEvent
      Parameters:
      customItemData - the custom item data to register
      Returns:
      if the item was registered