当前位置: 首页>>代码示例>>Java>>正文


Java Material.VINE属性代码示例

本文整理汇总了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;
}
 
开发者ID:Vrekt,项目名称:Arc-v2,代码行数:21,代码来源:LocationHelper.java

示例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);
}
 
开发者ID:Vrekt,项目名称:Arc-v2,代码行数:14,代码来源:FightHelper.java

示例3: isOnVine

/**
 * @return If the player is on a vine or not.
 */
public final boolean isOnVine() {
	return getBlockPlayerIsIn().getType() == Material.VINE;
}
 
开发者ID:davidm98,项目名称:Crescent,代码行数:6,代码来源:Behaviour.java

示例4: isClimbing

public static boolean isClimbing(Location location) {
    Material material = location.getBlock().getType();
    return material == Material.LADDER || material == Material.VINE;
}
 
开发者ID:WarzoneMC,项目名称:Warzone,代码行数:4,代码来源:PlayerBlockChecker.java

示例5: isClimbable

public static boolean isClimbable(Material material) {
    return material == Material.LADDER || material == Material.VINE;
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:3,代码来源:Materials.java

示例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;
}
 
开发者ID:Notoh,项目名称:DynamicAC,代码行数:3,代码来源:Utilities.java

示例7: isOnVine

public static boolean isOnVine(Player player) {
    return player.getLocation().getBlock().getType() == Material.VINE;
}
 
开发者ID:Notoh,项目名称:DynamicAC,代码行数:3,代码来源:Utilities.java


注:本文中的org.bukkit.Material.VINE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。