Class CustomBannedItem

java.lang.Object
fr.andross.banitem.items.BannedItem
fr.andross.banitem.items.CustomBannedItem
All Implemented Interfaces:
ICustomName

public final class CustomBannedItem extends BannedItem implements ICustomName
An item wrapper, which store custom item meta.
Version:
3.3.2
Author:
Andross
  • Constructor Details

    • CustomBannedItem

      public CustomBannedItem(@NotNull @NotNull String name, @NotNull @NotNull org.bukkit.configuration.ConfigurationSection section, @NotNull @NotNull Debug debug)
      Represents a custom item, handled by BanItem, which will match specific meta types on the item.
      Parameters:
      name - name of the custom item
      section - the section in the configuration file
      debug - the debug
  • Method Details

    • matches

      public boolean matches(@NotNull @NotNull BannedItem bannedItem)
      Comparing the ItemMeta of the item with the item meta stored.
      Parameters:
      bannedItem - the item to compare
      Returns:
      true if the item meta matches, otherwise false
    • getName

      @NotNull public @NotNull String getName()
      Get the custom banned item name from customitems.yml.
      Specified by:
      getName in interface ICustomName
      Returns:
      the custom banned item name from customitems.yml
    • getMaterials

      @NotNull public @NotNull Set<org.bukkit.Material> getMaterials()
      Get the materials represented by this custom item.
      Returns:
      set of materials
    • getMeta

      @NotNull public @NotNull Map<MetaType,MetaTypeComparator> getMeta()
      Get the map of meta to compare.
      Returns:
      the map of meta to compare
    • isValid

      public boolean isValid()
      If the custom item is correctly loaded.
      Returns:
      if the custom item is correctly loaded
    • isReverted

      public boolean isReverted()
      If the custom item match is reverted.
      Returns:
      if the custom item match is reverted
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class BannedItem
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class BannedItem