本文整理汇总了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;
}
}
示例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);
}
示例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");
}
}
示例4: isLiquid
public boolean isLiquid() {
return (getType() == Material.WATER) || (getType() == Material.STATIONARY_WATER) || (getType() == Material.LAVA) || (getType() == Material.STATIONARY_LAVA);
}
示例5: isLava
public static boolean isLava(Material material) {
return material == Material.LAVA || material == Material.STATIONARY_LAVA;
}