Fairy Lights

Fairy Lights

34M Downloads

Fairy Lights Do Not Give Off Light?

Darkosto opened this issue ยท 4 comments

commented

Would you consider allowing Fairy Lights to emit light? I would love to replace my torches scattered all over my base with your awesome fairy lights!

Thanks!
Darkosto

commented

I wish it was a simple matter of allowing them to. It is difficult to adequately emit light because hanging light sources are unconstrained to blocks and while lighting works per block.

For light to be emitted one option is lit blocks which act like air to be placed wherever there is a light. Handling lit air blocks gets messy with them having to be kept track of so they when connections change they don't leave behind them. There is still an issue of cases where the block is removed in a way it can't handle removing lit air blocks, requiring the lit air blocks to randomly check if they should still exist which would require them to either search a somewhat large area for fasteners or be a blockentity and hold data knowing which fastener they belong to to look specifically for. Having a lot of those fake air light emitting blockentities wouldn't really be great for performance.

Another option would be mildly hacking light computation to override the brightness of a block based on if the is a hanging light source intersecting it. This method wouldn't be too harsh on performance as long as it knows immediately if a chunk has some cord going through it to avoid checking the exact light sources. This requires coremodding so I am hesitant, especially since prior to 1.10.2/1.11 releases I did have a coremod and I was just able to remove it.

The compromise that is half-implemented is visual light when OptiFine is installed. OptiFine has a "Dynamic Lights" feature where some entities and held/dropped items emit light so I abuse that. The unimplemented part is preventing hostile mob spawns as if the blocks were actually lit, which I simply haven't gotten to.

commented

Maybe this could work.

commented

@Voidi I originally ruled out that method because of experience I've had with modifying light like that in the past but after experimenting with it now it appears feasible and won't be hard on performance.

commented

Fairy Lights 2.1.0 is now out to implement this feature.