Private
Public Access
1
0

Changed light level config to affect getLightEmission instead of registry since we can't use config options during registry.

This commit is contained in:
2025-06-06 05:15:54 +01:00
parent 36d9a195e9
commit b59d68240f
3 changed files with 8 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.BonemealableBlock;
@ -24,6 +25,11 @@ public class FireflyBushBlock extends BushBlock implements BonemealableBlock {
super(properties);
}
@Override
public int getLightEmission(BlockState state, BlockGetter level, BlockPos pos) {
return Config.Client.bushFireflyLightLevel.get();
}
@Override
@ParametersAreNonnullByDefault
public void animateTick(BlockState blockState, Level level, BlockPos blockPos, RandomSource randomSource) {

View File

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

View File

@ -76,7 +76,7 @@ public final class Config {
bushFireflyAmbientSoundPitch = builder
.defineInRange("bushFireflyAmbientSoundPitch", 1.0, 0, Double.MAX_VALUE);
bushFireflyLightLevel = builder
.comment("NOTE: This option requires a restart!")
.comment("NOTE: This option requires blocks to be replaced!")
.defineInRange("bushFireflyLightLevel", 2, 0, Level.MAX_BRIGHTNESS);
builder.pop();
}