Tschipcraft / dynamiclights

Burning entities/items such as torches or lanterns emit light!
https://tschipcraft.ddns.net/dynamiclights.html
Other
23 stars 0 forks source link

More emit light level #14

Open EyatMC opened 10 months ago

EyatMC commented 10 months ago

Is your feature request related to a problem? Please describe.

The current datapack generates light levels of 6, 9, and 15. However, another users might want to use light levels other than 6, 9, and 15

Describe the feature you'd like

I attempted to add level 12 to bridge the significant gap between level 9 and level 15 but failed It would be great to have files with a more diverse range of light levels, such as (3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)

Describe alternatives you've considered

No response

Additional context

No response

Tschipcraft commented 10 months ago

This is a planned feature (to be fair not listed in the wiki under planned features for some reason) and I will add support for at least light levels 3 and 12 in the next updates.

Edit: Light levels 3 and 12 have been implemented in v1.8

BrailleBennett commented 4 months ago

This can probably be closed as completed now.

Mrglanet commented 4 months ago

Having recently found out and looked at this, I'm curious as to why the whole light level spectrum isn't included, or if it'd be possible/simple to add another light level? For example, while torches dynamically emit a light level of 15, in-world they actually emit a light level of 14.

Tschipcraft commented 3 months ago

It would certainly be possible to include even more light levels/the whole range, but this might tank performance, since every added light level means running a pretty long predicate chain every tick for most entities to detect any items that should trigger that light level. Since performance is already pretty bad due to light updates and just generally commands, I'm reluctant to add more overhead (even though predicates should be pretty fast)

XanderCrafter commented 1 month ago

I have multiple follow-up questions, if you don’t mind: 1) Does this mean that simply creating similar .json files for additional light levels won’t work due to a lack of support for them within the code? 2) If that is so, would it not be possible to add said support, thereby allowing players with powerful rigs to choose whether to tax their setup with the additional light levels? Or would the mere existence of that support affect the mod’s performance? 3) Does deleting a good number of supported items from the .json files (I don’t like enchanted items, trimmed armor, amethyst, etc emitting light) help with the performance, or is the overhead there regardless of the number of items being checked for? Thank you so much for the awesome mod!

Tschipcraft commented 1 month ago

Thanks <3

  1. Yes
  2. Would be possible, and shouldn't affect performance too much (will be a bit of work to implement though, especially if the already specified items then should use their exact values instead)
  3. The overhead for checking the items will be there regardless, but having less active dynamic light spots will be better for overall performance