本文整理汇总了Java中org.bukkit.Material.VINE属性的典型用法代码示例。如果您正苦于以下问题:Java Material.VINE属性的具体用法?Java Material.VINE怎么用?Java Material.VINE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.Material
的用法示例。
在下文中一共展示了Material.VINE属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isClimbing
/**
* @return if we are climbing on ladder/vine.
*/
public static boolean isClimbing(Location location) {
boolean alreadyHasLadder = location.getBlock().getType() == Material.LADDER;
boolean alreadyHasVine = location.getBlock().getType() == Material.VINE;
if (alreadyHasLadder || alreadyHasVine) {
return true;
}
LocationBit bit = new LocationBit(0.1);
for (int i = 1; i <= 4; i++) {
Location newLocation = location.clone().add(bit.getX(), -0.06, bit.getZ());
Block block = newLocation.getBlock();
if (block.getType() == Material.LADDER || block.getType() == Material.VINE) {
return true;
}
bit.shift(i);
}
return false;
}
示例2: isCritical
/**
* Check if an attack was a critical.
*
* @param player the player
* @return true, if the attack was registered as a critical.
*/
public static boolean isCritical(Player player) {
boolean onGround = ((Entity) player).isOnGround();
return !onGround && player.getFallDistance() > 0.0F && !LocationHelper.isInLiquid(player.getLocation())
&& (player.getLocation().getBlock().getType() != Material.LADDER
|| player.getLocation().getBlock().getType() != Material.VINE)
&& player.getVehicle() == null && !player.hasPotionEffect(PotionEffectType.BLINDNESS);
}
示例3: isOnVine
/**
* @return If the player is on a vine or not.
*/
public final boolean isOnVine() {
return getBlockPlayerIsIn().getType() == Material.VINE;
}
示例4: isClimbing
public static boolean isClimbing(Location location) {
Material material = location.getBlock().getType();
return material == Material.LADDER || material == Material.VINE;
}
示例5: isClimbable
public static boolean isClimbable(Material material) {
return material == Material.LADDER || material == Material.VINE;
}
示例6: isClimbableBlock
public static boolean isClimbableBlock(Block block) {
return block.getType() == Material.VINE || block.getType() == Material.LADDER || block.getType() == Material.WATER || block.getType() == Material.STATIONARY_WATER;
}
示例7: isOnVine
public static boolean isOnVine(Player player) {
return player.getLocation().getBlock().getType() == Material.VINE;
}