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


Java Material.LADDER属性代码示例

本文整理汇总了Java中org.bukkit.Material.LADDER属性的典型用法代码示例。如果您正苦于以下问题:Java Material.LADDER属性的具体用法?Java Material.LADDER怎么用?Java Material.LADDER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.bukkit.Material的用法示例。


在下文中一共展示了Material.LADDER属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: isCritical

public static boolean isCritical(Player player) {
    Location location = player.getLocation();
    location.setY(player.getLocation().getY() -2);
    return player.getFallDistance() > 0.0f && player.getLocation().getY() % 1 != 0 && !player.isInsideVehicle() && !player.hasPotionEffect(PotionEffectType.BLINDNESS) && !Utilities.isHoveringOverWater(location) &&
            player
            .getEyeLocation()
            .getBlock()
            .getType
            () !=
            Material
            .LADDER;
}
 
开发者ID:Notoh,项目名称:DynamicAC,代码行数:12,代码来源:DynamicAC.java

示例4: isOnLadder

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

示例5: 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

示例6: isClimbable

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

示例7: playerIsOnLadder

private boolean playerIsOnLadder(Player player) {
    return player.getLocation().getBlock().getType() == Material.LADDER;
}
 
开发者ID:EndlessCodeGroup,项目名称:RPGInventory,代码行数:3,代码来源:ElytraListener.java

示例8: 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


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