Class MetaBuilder<V extends org.bukkit.inventory.meta.ItemMeta,Self extends MetaBuilder<V,?>>

java.lang.Object
net.orbyfied.j8.util.mc.MetaBuilder<V,Self>
Type Parameters:
V -
Self -

public class MetaBuilder<V extends org.bukkit.inventory.meta.ItemMeta,Self extends MetaBuilder<V,?>> extends Object
Builds item meta's.
  • Field Details

    • it

      protected V extends org.bukkit.inventory.meta.ItemMeta it
      The meta instance.
  • Constructor Details

    • MetaBuilder

      protected MetaBuilder(V it)
      Protected constructor.
  • Method Details

    • makeFor

      public static <T extends org.bukkit.inventory.meta.ItemMeta> T makeFor(org.bukkit.Material material)
      Creates a new item meta for the specified material.
    • create

      public static <T extends org.bukkit.inventory.meta.ItemMeta> MetaBuilder<T,MetaBuilder<T,?>> create(org.bukkit.Material material)
      Constructs a new builder with the initial item meta set to the appropriate item meta for the supplied material.
      Parameters:
      material - The material to create the item meta for. For example: If you have a MetaBuilder of CompassMeta, you want to use Material.COMPASS as parameter.
      Returns:
      The new builder.
    • create

      public static <T extends org.bukkit.inventory.meta.ItemMeta> MetaBuilder<T,MetaBuilder<T,?>> create()
      Constructs a new builder with the default item meta.
      Returns:
      The new builder.
    • create

      public static <T extends org.bukkit.inventory.meta.ItemMeta> MetaBuilder<T,MetaBuilder<T,?>> create(T it)
      Constructs a new builder with a clone of the provided item meta as editable meta.
      Parameters:
      it - The meta.
      Returns:
      The new builder.
    • of

      public static <T extends org.bukkit.inventory.meta.ItemMeta> MetaBuilder<T,MetaBuilder<T,?>> of(T it)
      Constructs a new builder with a reference of the provided item meta as editable meta. This allows you to use this class to edit already existent item meta's.
      Parameters:
      it - The item meta.
      Returns:
      The new builder.
    • get

      public V get()
    • setProperty

      public Self setProperty(String name, Object o)
    • getProperty

      public <T> T getProperty(String name)
    • setDisplayName

      public Self setDisplayName(String name)
    • getDisplayName

      public String getDisplayName()
    • setUnbreakable

      public Self setUnbreakable(boolean v)
    • isUnbreakable

      public boolean isUnbreakable()
    • empty

      public Self empty()