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());
}
}
}
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());
}
}
}
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());
}
}
}
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());
}
}
}
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());
}
}
}
Aggregations