當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。