當前位置: 首頁>>代碼示例>>Java>>正文


Java Material.LAVA屬性代碼示例

本文整理匯總了Java中org.bukkit.Material.LAVA屬性的典型用法代碼示例。如果您正苦於以下問題:Java Material.LAVA屬性的具體用法?Java Material.LAVA怎麽用?Java Material.LAVA使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.bukkit.Material的用法示例。


在下文中一共展示了Material.LAVA屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isSwimming

public static boolean isSwimming(Location location, Material liquidType) {
    Material material = location.getBlock().getType();
    switch(liquidType) {
        case WATER:
        case STATIONARY_WATER:
            return material == Material.WATER || material == Material.STATIONARY_WATER;

        case LAVA:
        case STATIONARY_LAVA:
            return material == Material.LAVA || material == Material.STATIONARY_LAVA;

        default:
            return false;
    }
}
 
開發者ID:WarzoneMC,項目名稱:Warzone,代碼行數:15,代碼來源:PlayerBlockChecker.java

示例2: tickBurn

public void tickBurn() {
    burnTicks--;
    Location loc = entity.getLocation().add(0, entity.getEyeHeight() * 0.6, 0);
    BlockData data = new BlockData(Material.LAVA, (byte) 0);
    RParticles.showWithData(ParticleEffect.BLOCK_CRACK, loc, data, 10);
    double multiplier = 0.001;
    switch (burnTier) {
        default:
        case 1:
            multiplier = 0.01;
            break;
        case 2:
            multiplier = 0.015;
            break;
        case 3:
            multiplier = 0.020;
            break;
        case 4:
            multiplier = 0.030;
            break;
        case 5:
            multiplier = 0.050;
            break;
    }
    int amount = (int) (multiplier * hp);
    if (amount < 1)
        amount = 1;
    damage(amount, null, DamageType.ENVIRONMENTAL_INSTANT);
}
 
開發者ID:edasaki,項目名稱:ZentrelaRPG,代碼行數:29,代碼來源:MobData.java

示例3: materialInBucket

public static Material materialInBucket(Material bucket) {
    switch(bucket) {
        case BUCKET:
        case MILK_BUCKET:
            return Material.AIR;

        case LAVA_BUCKET: return Material.LAVA;
        case WATER_BUCKET: return Material.WATER;

        default: throw new IllegalArgumentException(bucket + " is not a bucket");
    }
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:12,代碼來源:Materials.java

示例4: isLiquid

public boolean isLiquid() {
    return (getType() == Material.WATER) || (getType() == Material.STATIONARY_WATER) || (getType() == Material.LAVA) || (getType() == Material.STATIONARY_LAVA);
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:3,代碼來源:CraftBlock.java

示例5: isLava

public static boolean isLava(Material material) {
    return material == Material.LAVA || material == Material.STATIONARY_LAVA;
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:3,代碼來源:Materials.java


注:本文中的org.bukkit.Material.LAVA屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。