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


Java SoundEvents.ITEM_BUCKET_EMPTY_LAVA属性代码示例

本文整理汇总了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;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:16,代码来源:Fluid.java

示例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;
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:47,代码来源:ItemBucket.java


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