public final class Materials
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static org.bukkit.Material |
getBucketBlockMaterial(org.bukkit.Material type)
Get the material of the block placed by the given bucket, defaulting
to water if the bucket type is not known.
|
static org.bukkit.entity.EntityType |
getEntitySpawnEgg(org.bukkit.Material material) |
static org.bukkit.entity.EntityType |
getRelatedEntity(org.bukkit.Material material)
Get the related entity type for a material.
|
static org.bukkit.Material |
getRelatedMaterial(org.bukkit.entity.EntityType type)
Get the related material for an entity type.
|
static boolean |
hasDamageEffect(java.util.Collection<org.bukkit.potion.PotionEffect> effects)
Test whether a list of potion effects contains one or more potion
effects used for doing damage.
|
static boolean |
isAnvil(org.bukkit.Material material) |
static boolean |
isArmor(org.bukkit.Material type)
Check if the material is equippable armor (i.e.
|
static boolean |
isBed(org.bukkit.Material material) |
static boolean |
isBlockModifiedOnClick(org.bukkit.Material material,
boolean rightClick)
Test whether the given material is a block that is modified when it is
left or right clicked.
|
static boolean |
isBoat(org.bukkit.Material material)
Test whether the given material is a Boat.
|
static boolean |
isConsideredBuildingIfUsed(org.bukkit.Material type)
Test whether the given material should be tested as "building" when
it is used.
|
static boolean |
isCoral(org.bukkit.Material material) |
static boolean |
isCrop(org.bukkit.Material type)
Test whether the material is a crop.
|
static boolean |
isFire(org.bukkit.Material type) |
static boolean |
isInventoryBlock(org.bukkit.Material material)
Test whether the given material is an inventory block.
|
static boolean |
isItemAppliedToBlock(org.bukkit.Material item,
org.bukkit.Material block)
Test whether the given item modifies a given block when right clicked.
|
static boolean |
isLava(org.bukkit.Material material)
Test whether the given material is lava.
|
static boolean |
isLeaf(org.bukkit.Material material)
Test whether the given material is a leaf block.
|
static boolean |
isLiquid(org.bukkit.Material material)
Test whether the given material is a liquid block.
|
static boolean |
isMinecart(org.bukkit.Material material)
Test whether the given material is a Minecart.
|
static boolean |
isMushroom(org.bukkit.Material material)
Test whether the given material is a mushroom.
|
static boolean |
isPistonBlock(org.bukkit.Material material)
Test whether the given material is a piston block, not including
the "technical blocks" such as the piston extension block.
|
static boolean |
isPortal(org.bukkit.Material material)
Test whether the given material is a portal material.
|
static boolean |
isRailBlock(org.bukkit.Material material)
Test whether the given material is a rail block.
|
static boolean |
isSpawnEgg(org.bukkit.Material material) |
static boolean |
isToolApplicable(org.bukkit.Material toolMaterial,
org.bukkit.Material targetMaterial)
Check if the material is usable via right-click on the target
material.
|
static boolean |
isUseFlagApplicable(org.bukkit.Material material)
Test whether the given material is affected by
Flags.USE. |
static boolean |
isVine(org.bukkit.Material newType)
Test whether the material should be handled as vine.
|
static boolean |
isWater(org.bukkit.Material material)
Test whether the given material is water.
|
@Nullable public static org.bukkit.Material getRelatedMaterial(org.bukkit.entity.EntityType type)
type - the entity typenull if one is not known or exists@Nullable public static org.bukkit.entity.EntityType getRelatedEntity(org.bukkit.Material material)
material - the materialnull if one is not known or existspublic static org.bukkit.Material getBucketBlockMaterial(org.bukkit.Material type)
If a non-bucket material is given, it will be assumed to be an unknown bucket type. If the given bucket doesn't have a block form (it can't be placed), then water will be returned (i.e. for milk). Be aware that either the stationary or non-stationary material may be returned.
type - the bucket materialpublic static boolean isMushroom(org.bukkit.Material material)
material - the materialpublic static boolean isLeaf(org.bukkit.Material material)
material - the materialpublic static boolean isLiquid(org.bukkit.Material material)
material - the materialpublic static boolean isWater(org.bukkit.Material material)
material - the materialpublic static boolean isLava(org.bukkit.Material material)
material - the materialpublic static boolean isPortal(org.bukkit.Material material)
material - the materialpublic static boolean isRailBlock(org.bukkit.Material material)
material - the materialpublic static boolean isPistonBlock(org.bukkit.Material material)
material - the materialpublic static boolean isMinecart(org.bukkit.Material material)
material - the materialpublic static boolean isBoat(org.bukkit.Material material)
material - the materialpublic static boolean isInventoryBlock(org.bukkit.Material material)
material - the materialpublic static boolean isSpawnEgg(org.bukkit.Material material)
public static org.bukkit.entity.EntityType getEntitySpawnEgg(org.bukkit.Material material)
public static boolean isBed(org.bukkit.Material material)
public static boolean isAnvil(org.bukkit.Material material)
public static boolean isCoral(org.bukkit.Material material)
public static boolean isCrop(org.bukkit.Material type)
type - the materialpublic static boolean isVine(org.bukkit.Material newType)
newType - the materialpublic static boolean isUseFlagApplicable(org.bukkit.Material material)
Flags.USE.
Generally, materials that are considered by this method are those that are not inventories but can be used.
material - the materialpublic static boolean isBlockModifiedOnClick(org.bukkit.Material material,
boolean rightClick)
This test is conservative, returning true for blocks that it is not aware of.
material - the materialrightClick - whether it is a right clickpublic static boolean isItemAppliedToBlock(org.bukkit.Material item,
org.bukkit.Material block)
This test is conservative, returning true for items that it is not aware of or does not have the details for.
item - the itemblock - the blockpublic static boolean isConsideredBuildingIfUsed(org.bukkit.Material type)
type - the typepublic static boolean hasDamageEffect(java.util.Collection<org.bukkit.potion.PotionEffect> effects)
effects - A collection of effectspublic static boolean isArmor(org.bukkit.Material type)
type - material to checkpublic static boolean isToolApplicable(org.bukkit.Material toolMaterial,
org.bukkit.Material targetMaterial)
toolMaterial - the tool material being usedtargetMaterial - the target material to checkpublic static boolean isFire(org.bukkit.Material type)