Package co.crystaldev.alpinecore.util
Class MappedMaterial
java.lang.Object
co.crystaldev.alpinecore.util.MappedMaterial
A helper class offering a flexible way to group and test against various material types.
- Since:
- 0.3.1
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull MappedMaterial.Builder
builder()
static @NotNull MappedMaterial
of
(@NotNull com.cryptomorin.xseries.XMaterial... materials) static @NotNull MappedMaterial
of
(@NotNull Collection<com.cryptomorin.xseries.XMaterial> materials) boolean
test
(@NotNull com.cryptomorin.xseries.XMaterial type) Tests if the specifiedXMaterial
is contained within this material map.boolean
test
(@NotNull org.bukkit.block.Block block) Tests if the specifiedBlock
is contained within this material map.boolean
test
(@NotNull org.bukkit.inventory.ItemStack item) Tests if the specifiedItemStack
is contained within this material map.boolean
test
(@NotNull org.bukkit.Material type) Tests if the specifiedMaterial
is contained within this material map.
-
Constructor Details
-
MappedMaterial
public MappedMaterial()
-
-
Method Details
-
test
public boolean test(@NotNull @NotNull com.cryptomorin.xseries.XMaterial type) Tests if the specifiedXMaterial
is contained within this material map.- Parameters:
type
- the material to test- Returns:
true
if the material map contains the specified material;false
otherwise.
-
test
public boolean test(@NotNull @NotNull org.bukkit.Material type) Tests if the specifiedMaterial
is contained within this material map.- Parameters:
type
- the material to test- Returns:
true
if the material map contains the specified material;false
otherwise.
-
test
public boolean test(@NotNull @NotNull org.bukkit.block.Block block) Tests if the specifiedBlock
is contained within this material map.- Parameters:
block
- the block to test- Returns:
true
if the material map contains the specified material;false
otherwise.
-
test
public boolean test(@NotNull @NotNull org.bukkit.inventory.ItemStack item) Tests if the specifiedItemStack
is contained within this material map.- Parameters:
item
- the item to test- Returns:
true
if the material map contains the specified material;false
otherwise.
-
of
@NotNull public static @NotNull MappedMaterial of(@NotNull @NotNull com.cryptomorin.xseries.XMaterial... materials) -
of
@NotNull public static @NotNull MappedMaterial of(@NotNull @NotNull Collection<com.cryptomorin.xseries.XMaterial> materials) -
builder
-