StormSplashRenderer.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:DynamicSurroundings 作者:
protected void playSplashSound(final EntityRenderer renderer, final World world, final Entity player, double x,
        double y, double z) {

    this.pos.setPos(x, y - 1, z);
    final boolean hasDust = biomeHasDust(world.getBiome(this.pos));
    final Block block = WorldUtils.getBlockState(world, this.pos).getBlock();
    final SoundEvent sound = getBlockSoundFX(block, hasDust, world);
    if (sound != null) {
        final float volume = calculateRainSoundVolume(world);
        float pitch = 1.0F;
        final int playerY = MathHelper.floor(player.posY);
        this.pos.setPos(player.posX, 0, player.posZ);
        if (y > player.posY + 1.0D && getPrecipitationHeight(world, 0, this.pos).getY() > playerY)
            pitch = 0.5F;
        pitch -= (this.RANDOM.nextFloat() - this.RANDOM.nextFloat()) * 0.1F;
        this.pos.setPos(x, y, z);
        SoundEngine.instance().playSound(this.pos, sound, SoundCategory.WEATHER, volume, pitch);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号