Private
Public Access
1
0

Added config option for light level.

This commit is contained in:
2025-06-06 05:05:34 +01:00
parent 5add42d487
commit 6696263249
2 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package dev.micle.firefly_bush_backport.block; package dev.micle.firefly_bush_backport.block;
import dev.micle.firefly_bush_backport.FireflyBushBackport; import dev.micle.firefly_bush_backport.FireflyBushBackport;
import dev.micle.firefly_bush_backport.config.Config;
import dev.micle.firefly_bush_backport.item.ModItems; import dev.micle.firefly_bush_backport.item.ModItems;
import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
@ -23,7 +24,7 @@ public class ModBlocks {
() -> new FireflyBushBlock(BlockBehaviour.Properties.of() () -> new FireflyBushBlock(BlockBehaviour.Properties.of()
.mapColor(MapColor.PLANT) .mapColor(MapColor.PLANT)
.ignitedByLava() .ignitedByLava()
.lightLevel(blockState -> 2) .lightLevel(blockState -> Config.Client.bushFireflyLightLevel.get())
.noCollission() .noCollission()
.instabreak() .instabreak()
.sound(SoundType.SWEET_BERRY_BUSH) .sound(SoundType.SWEET_BERRY_BUSH)

View File

@ -57,6 +57,7 @@ public final class Config {
public static ForgeConfigSpec.IntValue bushFireflyAmbientSoundChanceOneIn; public static ForgeConfigSpec.IntValue bushFireflyAmbientSoundChanceOneIn;
public static ForgeConfigSpec.DoubleValue bushFireflyAmbientSoundVolume; public static ForgeConfigSpec.DoubleValue bushFireflyAmbientSoundVolume;
public static ForgeConfigSpec.DoubleValue bushFireflyAmbientSoundPitch; public static ForgeConfigSpec.DoubleValue bushFireflyAmbientSoundPitch;
public static ForgeConfigSpec.IntValue bushFireflyLightLevel;
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");
@ -74,6 +75,9 @@ public final class Config {
.defineInRange("bushFireflyAmbientSoundVolume", 1.0, 0, Double.MAX_VALUE); .defineInRange("bushFireflyAmbientSoundVolume", 1.0, 0, Double.MAX_VALUE);
bushFireflyAmbientSoundPitch = builder bushFireflyAmbientSoundPitch = builder
.defineInRange("bushFireflyAmbientSoundPitch", 1.0, 0, Double.MAX_VALUE); .defineInRange("bushFireflyAmbientSoundPitch", 1.0, 0, Double.MAX_VALUE);
bushFireflyLightLevel = builder
.comment("NOTE: This option requires a restart!")
.defineInRange("bushFireflyLightLevel", 2, 0, Level.MAX_BRIGHTNESS);
builder.pop(); builder.pop();
} }