#883: Add ItemFactory#getSpawnEgg

This commit is contained in:
Jishuna 2023-07-18 21:28:00 +10:00 committed by md_5
parent 12eb5c46a8
commit 36022f0280
No known key found for this signature in database
GPG key ID: E8E901AC7C617C11

View file

@ -4,6 +4,7 @@ import org.bukkit.Color;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.EntityType;
import org.bukkit.inventory.meta.BookMeta;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;
@ -159,4 +160,15 @@ public interface ItemFactory {
@Deprecated
@NotNull
Material updateMaterial(@NotNull final ItemMeta meta, @NotNull final Material material) throws IllegalArgumentException;
/**
* Gets a {@link Material} representing the spawn egg for the provided
* {@link EntityType}. <br>
* Will return null for EntityTypes that do not have a corresponding spawn egg.
*
* @param type the entity type
* @return the Material of this EntityTypes spawn egg or null
*/
@Nullable
Material getSpawnEgg(@NotNull EntityType type);
}