Jump to content

Is there a way to change skylight?


blaxout1213

Recommended Posts

Hi

 

The world.getStarBrightness() and world.getSunBrightness() methods look promising.  You might be able to implement this through the corresponding WorldProvider methods, for example by DimensionManager.unregisterProviderType and then DimensionManager.registerProviderType for the surface world with your new customised WorldProvider.  Otherwise ASM+Reflection is probably necessary.

 

-TGG

Link to comment
Share on other sites

Hi

 

The world.getStarBrightness() and world.getSunBrightness() methods look promising.  You might be able to implement this through the corresponding WorldProvider methods, for example by DimensionManager.unregisterProviderType and then DimensionManager.registerProviderType for the surface world with your new customised WorldProvider.  Otherwise ASM+Reflection is probably necessary.

 

-TGG

 

No, TGG, That is not enough.

For World#getSunBrightness is client-only, Modifying it only changes.

So, here is what you have to do to change skylight:

 

1. Make your new customized WorldProvider.

2. Override getSunBrightnessFactor, getSunBrightness, and getStarBrightness.

  - getSunBrightnessFactor is for skylight calculation on Server&Client. Affects the light value of whole world.

  - getSunBrightness is for sky rendering on Client on day.

3. Modify the methods with your needs.

4. As TGG said, replace overworld provider with yours.

    first, unregister the overworld provider using DimensionManager.unregisterProviderType

    then DimensionManager.registerProviderType for the surface world with your new customised WorldProvider

5. Done.

 

* These thing can be possible thanks to my PR. :-)

  • Thanks 1

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.