Set block luminance based on lambda funcion
IbraheemR opened this issue ยท 4 comments
As of the 1.16 snapshots (at least since 20w13b) Block#getLuminance
no longer excists.
Looking at the vanilla code, luminance is now set with a lambda, that takes a block state and returns a light level. For most lit blocks this returns a constant, but for blocks like redstone lamp this returns a value based on its "lit" property.
This should probably be added to the FabricBlockSettings
API, as without it there seems to be no way to create blocks with 'dynamic' light levels (without entering mixin hell).
@modmuss50 tells me this is already planned for an upcoming revamp, but that it could trivially be added sooner
Light lamda functions can be used without mixins, like here
So vanilla currently restricts the context of luminance (server side lighting) but allows you to return custom emissive light levels ( i.e. client only light level). Weird indeed, hope they can move the luminance to one of the lambdas in settings.