Added config options for ambient sound volume and pitch.
This commit is contained in:
@ -30,7 +30,14 @@ public class FireflyBushBlock extends BushBlock implements BonemealableBlock {
|
|||||||
if (randomSource.nextInt(Config.Client.bushFireflyAmbientSoundChanceOneIn.get()) == 0
|
if (randomSource.nextInt(Config.Client.bushFireflyAmbientSoundChanceOneIn.get()) == 0
|
||||||
&& isMoonVisible(level)
|
&& isMoonVisible(level)
|
||||||
&& level.getHeight(Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, blockPos.getX(), blockPos.getZ()) <= blockPos.getY()) {
|
&& level.getHeight(Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, blockPos.getX(), blockPos.getZ()) <= blockPos.getY()) {
|
||||||
level.playLocalSound(blockPos, ModSounds.FIREFLY_BUSH_IDLE.get(), SoundSource.AMBIENT, 1.0F, 1.0F, false);
|
level.playLocalSound(
|
||||||
|
blockPos,
|
||||||
|
ModSounds.FIREFLY_BUSH_IDLE.get(),
|
||||||
|
SoundSource.AMBIENT,
|
||||||
|
Config.Client.bushFireflyAmbientSoundVolume.get().floatValue(),
|
||||||
|
Config.Client.bushFireflyAmbientSoundPitch.get().floatValue(),
|
||||||
|
false
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((isMoonVisible(level) || level.getMaxLocalRawBrightness(blockPos) <= Config.Client.bushFireflySpawnMaxBrightnessLevel.get()) &&
|
if ((isMoonVisible(level) || level.getMaxLocalRawBrightness(blockPos) <= Config.Client.bushFireflySpawnMaxBrightnessLevel.get()) &&
|
||||||
|
@ -55,6 +55,8 @@ public final class Config {
|
|||||||
public static ForgeConfigSpec.DoubleValue bushFireflyVerticalRange;
|
public static ForgeConfigSpec.DoubleValue bushFireflyVerticalRange;
|
||||||
public static ForgeConfigSpec.IntValue bushFireflySpawnMaxBrightnessLevel;
|
public static ForgeConfigSpec.IntValue bushFireflySpawnMaxBrightnessLevel;
|
||||||
public static ForgeConfigSpec.IntValue bushFireflyAmbientSoundChanceOneIn;
|
public static ForgeConfigSpec.IntValue bushFireflyAmbientSoundChanceOneIn;
|
||||||
|
public static ForgeConfigSpec.DoubleValue bushFireflyAmbientSoundVolume;
|
||||||
|
public static ForgeConfigSpec.DoubleValue bushFireflyAmbientSoundPitch;
|
||||||
|
|
||||||
Client(ForgeConfigSpec.Builder builder) {
|
Client(ForgeConfigSpec.Builder builder) {
|
||||||
builder.comment("Official settings for the firefly bush.").push("bush");
|
builder.comment("Official settings for the firefly bush.").push("bush");
|
||||||
@ -68,6 +70,10 @@ public final class Config {
|
|||||||
.defineInRange("bushFireflySpawnMaxBrightnessLevel", 13, 0, Level.MAX_BRIGHTNESS);
|
.defineInRange("bushFireflySpawnMaxBrightnessLevel", 13, 0, Level.MAX_BRIGHTNESS);
|
||||||
bushFireflyAmbientSoundChanceOneIn = builder
|
bushFireflyAmbientSoundChanceOneIn = builder
|
||||||
.defineInRange("bushFireflyAmbientSoundChanceOneIn", 30, 0, Integer.MAX_VALUE);
|
.defineInRange("bushFireflyAmbientSoundChanceOneIn", 30, 0, Integer.MAX_VALUE);
|
||||||
|
bushFireflyAmbientSoundVolume = builder
|
||||||
|
.defineInRange("bushFireflyAmbientSoundVolume", 1.0, 0, Double.MAX_VALUE);
|
||||||
|
bushFireflyAmbientSoundPitch = builder
|
||||||
|
.defineInRange("bushFireflyAmbientSoundPitch", 1.0, 0, Double.MAX_VALUE);
|
||||||
builder.pop();
|
builder.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user