Package org.geysermc.geyser.event.type
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
ConstructorsConstructorDescriptionGeyserDefineCustomItemsEventImpl(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 TypeMethodDescription@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 booleanregister(@NonNull String identifier, @NonNull org.geysermc.geyser.api.item.custom.CustomItemData customItemData)Registers a custom item with a base Java item.abstract booleanregister(@NonNull org.geysermc.geyser.api.item.custom.NonVanillaCustomItemData customItemData)Registers a custom item with no base item.
-
Constructor Details
-
GeyserDefineCustomItemsEventImpl
-
-
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:
getExistingCustomItemsin interfaceorg.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:
getExistingNonVanillaCustomItemsin interfaceorg.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:
registerin interfaceorg.geysermc.geyser.api.event.lifecycle.GeyserDefineCustomItemsEvent- Parameters:
identifier- the base (java) itemcustomItemData- 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:
registerin interfaceorg.geysermc.geyser.api.event.lifecycle.GeyserDefineCustomItemsEvent- Parameters:
customItemData- the custom item data to register- Returns:
- if the item was registered
-