本文整理汇总了Java中net.minecraft.init.SoundEvents.ITEM_BUCKET_EMPTY_LAVA属性的典型用法代码示例。如果您正苦于以下问题:Java SoundEvents.ITEM_BUCKET_EMPTY_LAVA属性的具体用法?Java SoundEvents.ITEM_BUCKET_EMPTY_LAVA怎么用?Java SoundEvents.ITEM_BUCKET_EMPTY_LAVA使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.init.SoundEvents
的用法示例。
在下文中一共展示了SoundEvents.ITEM_BUCKET_EMPTY_LAVA属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEmptySound
public SoundEvent getEmptySound()
{
if(emptySound == null)
{
if(getBlock() != null && getBlock().getDefaultState().getMaterial() == Material.LAVA)
{
emptySound = SoundEvents.ITEM_BUCKET_EMPTY_LAVA;
}
else
{
emptySound = SoundEvents.ITEM_BUCKET_EMPTY;
}
}
return emptySound;
}
示例2: tryPlaceContainedLiquid
public boolean tryPlaceContainedLiquid(@Nullable EntityPlayer player, World worldIn, BlockPos posIn)
{
if (this.containedBlock == Blocks.AIR)
{
return false;
}
else
{
IBlockState iblockstate = worldIn.getBlockState(posIn);
Material material = iblockstate.getMaterial();
boolean flag = !material.isSolid();
boolean flag1 = iblockstate.getBlock().isReplaceable(worldIn, posIn);
if (!worldIn.isAirBlock(posIn) && !flag && !flag1)
{
return false;
}
else
{
if (worldIn.provider.doesWaterVaporize() && this.containedBlock == Blocks.FLOWING_WATER)
{
int l = posIn.getX();
int i = posIn.getY();
int j = posIn.getZ();
worldIn.playSound(player, posIn, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 0.5F, 2.6F + (worldIn.rand.nextFloat() - worldIn.rand.nextFloat()) * 0.8F);
for (int k = 0; k < 8; ++k)
{
worldIn.spawnParticle(EnumParticleTypes.SMOKE_LARGE, (double)l + Math.random(), (double)i + Math.random(), (double)j + Math.random(), 0.0D, 0.0D, 0.0D, new int[0]);
}
}
else
{
if (!worldIn.isRemote && (flag || flag1) && !material.isLiquid())
{
worldIn.destroyBlock(posIn, true);
}
SoundEvent soundevent = this.containedBlock == Blocks.FLOWING_LAVA ? SoundEvents.ITEM_BUCKET_EMPTY_LAVA : SoundEvents.ITEM_BUCKET_EMPTY;
worldIn.playSound(player, posIn, soundevent, SoundCategory.BLOCKS, 1.0F, 1.0F);
worldIn.setBlockState(posIn, this.containedBlock.getDefaultState(), 11);
}
return true;
}
}
}