Just Enough Resources (JER)

Just Enough Resources (JER)

163M Downloads

Make LightLevel's constructor public

Tslat opened this issue ยท 1 comments

commented

Can we make LightLevel's constructor public? The way it is at the moment, it only supports vanilla-esque lighting conditions for mobs, which not all mods use.
even just having access to a custom light level and relative would be enough to add more options. I don't see why this is locked off to the four existing options

If I get a chance I can PR this, but it seems like a simple enough fix without that

commented

+1 this would be great, but for now you should be able to get the same result by abusing reflection:

final java.lang.reflect.Constructor<LightLevel> ctor =
    LightLevel.class.getDeclaredConstructor(int.class, LightLevel.Relative.class);
ctor.setAccessible(true);
return ctor.newInstance(4, LightLevel.Relative.below);

Making sure, of course, to catch any required exceptions