Class CustomItemResolver

All Implemented Interfaces:
IConf, Function<String,ItemStack>, IItemDb.ItemResolver

public class CustomItemResolver extends Object implements IItemDb.ItemResolver, IConf
  • Constructor Details

    • CustomItemResolver

      public CustomItemResolver(Essentials ess)
  • Method Details

    • apply

      public ItemStack apply(String item)
      Description copied from interface: IItemDb.ItemResolver
      Creates an item stack from the given name, if the given name is recognised by this resolver.
      Specified by:
      apply in interface Function<String,ItemStack>
      Specified by:
      apply in interface IItemDb.ItemResolver
      item - The name of the item to resolve
      A default stack of the item, or null if not recognised by this resolver.
    • getNames

      public Collection<String> getNames()
      Description copied from interface: IItemDb.ItemResolver
      Get all possible names that are recognised by this item resolver.

      Implementing this method is optional but recommended, since it enables custom items to be seen in tab complete.

      Specified by:
      getNames in interface IItemDb.ItemResolver
      A collection of all the possible names for items that this resolver recognises.
    • getAliasesFor

      public List<String> getAliasesFor(String item) throws Exception
    • reloadConfig

      public void reloadConfig()
      Specified by:
      reloadConfig in interface IConf
    • setAlias

      public void setAlias(String alias, String target)
    • removeAlias

      public void removeAlias(String alias)