Search in sources :

Example 6 with SoundType

use of net.minecraft.world.level.block.SoundType in project MyPet by xXKeyleXx.

the class EntityMyHorse method playStepSound.

@Override
public void playStepSound(BlockPos blockposition, BlockState blockdata) {
    if (!blockdata.getMaterial().isLiquid()) {
        BlockState blockdataUp = this.level.getBlockState(blockposition.above());
        SoundType soundeffecttype = blockdata.getSoundType();
        if (blockdataUp.getBlock() == Blocks.SNOW) {
            soundeffecttype = blockdata.getSoundType();
        }
        if (this.isVehicle()) {
            ++this.soundCounter;
            if (this.soundCounter > 5 && this.soundCounter % 3 == 0) {
                this.playSound(SoundEvents.HORSE_GALLOP, soundeffecttype.getVolume() * 0.15F, soundeffecttype.getPitch());
            } else if (this.soundCounter <= 5) {
                this.playSound(SoundEvents.HORSE_STEP_WOOD, soundeffecttype.getVolume() * 0.15F, soundeffecttype.getPitch());
            }
        } else if (!blockdata.getMaterial().isLiquid()) {
            this.soundCounter += 1;
            playSound(SoundEvents.HORSE_STEP_WOOD, soundeffecttype.getVolume() * 0.15F, soundeffecttype.getPitch());
        } else {
            playSound(SoundEvents.HORSE_STEP, soundeffecttype.getVolume() * 0.15F, soundeffecttype.getPitch());
        }
    }
}
Also used : SoundType(net.minecraft.world.level.block.SoundType) BlockState(net.minecraft.world.level.block.state.BlockState)

Example 7 with SoundType

use of net.minecraft.world.level.block.SoundType in project MyPet by xXKeyleXx.

the class EntityMyDonkey method playStepSound.

@Override
public void playStepSound(BlockPos blockposition, BlockState blockdata) {
    if (!blockdata.getMaterial().isLiquid()) {
        BlockState blockdataUp = this.level.getBlockState(blockposition.above());
        SoundType soundeffecttype = blockdata.getSoundType();
        if (blockdataUp.getBlock() == Blocks.SNOW) {
            soundeffecttype = blockdata.getSoundType();
        }
        if (this.isVehicle()) {
            ++this.soundCounter;
            if (this.soundCounter > 5 && this.soundCounter % 3 == 0) {
                this.playSound(SoundEvents.HORSE_GALLOP, soundeffecttype.getVolume() * 0.16F, soundeffecttype.getPitch());
            } else if (this.soundCounter <= 5) {
                this.playSound(SoundEvents.HORSE_STEP_WOOD, soundeffecttype.getVolume() * 0.16F, soundeffecttype.getPitch());
            }
        } else if (!blockdata.getMaterial().isLiquid()) {
            this.soundCounter += 1;
            playSound(SoundEvents.HORSE_STEP_WOOD, soundeffecttype.getVolume() * 0.16F, soundeffecttype.getPitch());
        } else {
            playSound(SoundEvents.HORSE_STEP, soundeffecttype.getVolume() * 0.16F, soundeffecttype.getPitch());
        }
    }
}
Also used : SoundType(net.minecraft.world.level.block.SoundType) BlockState(net.minecraft.world.level.block.state.BlockState)

Example 8 with SoundType

use of net.minecraft.world.level.block.SoundType in project MyPet by xXKeyleXx.

the class EntityMySkeletonHorse method playStepSound.

@Override
public void playStepSound(BlockPos blockposition, BlockState blockdata) {
    if (!blockdata.getMaterial().isLiquid()) {
        BlockState blockdataUp = this.level.getBlockState(blockposition.above());
        SoundType soundeffecttype = blockdata.getSoundType();
        if (blockdataUp.getBlock() == Blocks.SNOW) {
            soundeffecttype = blockdata.getSoundType();
        }
        if (this.isVehicle()) {
            ++this.soundCounter;
            if (this.soundCounter > 5 && this.soundCounter % 3 == 0) {
                this.playSound(SoundEvents.HORSE_GALLOP, soundeffecttype.getVolume() * 0.15F, soundeffecttype.getPitch());
            } else if (this.soundCounter <= 5) {
                this.playSound(SoundEvents.HORSE_STEP_WOOD, soundeffecttype.getVolume() * 0.15F, soundeffecttype.getPitch());
            }
        } else if (!blockdata.getMaterial().isLiquid()) {
            this.soundCounter += 1;
            playSound(SoundEvents.HORSE_STEP_WOOD, soundeffecttype.getVolume() * 0.15F, soundeffecttype.getPitch());
        } else {
            playSound(SoundEvents.HORSE_STEP, soundeffecttype.getVolume() * 0.15F, soundeffecttype.getPitch());
        }
    }
}
Also used : SoundType(net.minecraft.world.level.block.SoundType) BlockState(net.minecraft.world.level.block.state.BlockState)

Example 9 with SoundType

use of net.minecraft.world.level.block.SoundType in project MyPet by xXKeyleXx.

the class EntityMyDonkey method playStepSound.

@Override
public void playStepSound(BlockPos blockposition, BlockState blockdata) {
    if (!blockdata.getMaterial().isLiquid()) {
        BlockState blockdataUp = this.level.getBlockState(blockposition.up());
        SoundType soundeffecttype = blockdata.getSoundType();
        if (blockdataUp.getBlock() == Blocks.SNOW) {
            soundeffecttype = blockdata.getSoundType();
        }
        if (this.isVehicle()) {
            ++this.soundCounter;
            if (this.soundCounter > 5 && this.soundCounter % 3 == 0) {
                this.playSound(SoundEvents.HORSE_GALLOP, soundeffecttype.getVolume() * 0.16F, soundeffecttype.getPitch());
            } else if (this.soundCounter <= 5) {
                this.playSound(SoundEvents.HORSE_STEP_WOOD, soundeffecttype.getVolume() * 0.16F, soundeffecttype.getPitch());
            }
        } else if (!blockdata.getMaterial().isLiquid()) {
            this.soundCounter += 1;
            playSound(SoundEvents.HORSE_STEP_WOOD, soundeffecttype.getVolume() * 0.16F, soundeffecttype.getPitch());
        } else {
            playSound(SoundEvents.HORSE_STEP, soundeffecttype.getVolume() * 0.16F, soundeffecttype.getPitch());
        }
    }
}
Also used : SoundType(net.minecraft.world.level.block.SoundType) BlockState(net.minecraft.world.level.block.state.BlockState)

Example 10 with SoundType

use of net.minecraft.world.level.block.SoundType in project MyPet by xXKeyleXx.

the class EntityMyZombieHorse method playStepSound.

@Override
public void playStepSound(BlockPos blockposition, BlockState blockdata) {
    if (!blockdata.getMaterial().isLiquid()) {
        BlockState blockdataUp = this.level.getBlockState(blockposition.up());
        SoundType soundeffecttype = blockdata.getSoundType();
        if (blockdataUp.getBlock() == Blocks.SNOW) {
            soundeffecttype = blockdata.getSoundType();
        }
        if (this.isVehicle()) {
            ++this.soundCounter;
            if (this.soundCounter > 5 && this.soundCounter % 3 == 0) {
                this.playSound(SoundEvents.HORSE_GALLOP, soundeffecttype.getVolume() * 0.15F, soundeffecttype.getPitch());
            } else if (this.soundCounter <= 5) {
                this.playSound(SoundEvents.HORSE_STEP_WOOD, soundeffecttype.getVolume() * 0.15F, soundeffecttype.getPitch());
            }
        } else if (!blockdata.getMaterial().isLiquid()) {
            this.soundCounter += 1;
            playSound(SoundEvents.HORSE_STEP_WOOD, soundeffecttype.getVolume() * 0.15F, soundeffecttype.getPitch());
        } else {
            playSound(SoundEvents.HORSE_STEP, soundeffecttype.getVolume() * 0.15F, soundeffecttype.getPitch());
        }
    }
}
Also used : SoundType(net.minecraft.world.level.block.SoundType) BlockState(net.minecraft.world.level.block.state.BlockState)

Aggregations

SoundType (net.minecraft.world.level.block.SoundType)10 BlockState (net.minecraft.world.level.block.state.BlockState)10