Package net.orbyfied.j8.util.mc
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends org.bukkit.inventory.meta.ItemMeta>
MetaBuilder<T,MetaBuilder<T, ?>> create()Constructs a new builder with the default item meta.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.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.empty()get()<T> TgetProperty(String name) booleanstatic <T extends org.bukkit.inventory.meta.ItemMeta>
TmakeFor(org.bukkit.Material material) Creates a new item meta for the specified material.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.setDisplayName(String name) setProperty(String name, Object o) setUnbreakable(boolean v)
-
Field Details
-
it
The meta instance.
-
-
Constructor Details
-
MetaBuilder
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 useMaterial.COMPASSas 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
-
setProperty
-
getProperty
-
setDisplayName
-
getDisplayName
-
setUnbreakable
-
isUnbreakable
public boolean isUnbreakable() -
empty
-