本文整理匯總了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;
}
}
}