Jump to content

Using custom sky graphics (sun/moon textures, sizes, positions, etc)?


pacguy

Recommended Posts

Despite extensive searching, I've been unable to find resources on how to do this...

 

At the bare minimum, I want to change the textures the sun and moon uses in my custom dimension. It currently uses the normal overworld sky, with the sky color and fog color modified, and still renders the vanilla moon and sun. I've been trying to track down how to do this, but have been unable too:

 

  • WorldProvider has an obvious set of routines responsible for how the sky is rendered, setSkyRenderer() and getSkyRenderer(). However, I seem to be completely unable to figure out which vanilla class is actually used in these routines (I'm hoping to extend it onto my own class so I can make minor tweaks to it, or at least view its' code so I can figure out what it even does). I tried getting its' class name and outputting that to the console, but apparently the client uses a different console then the server (the latter of which is the only console I can see, as far as I can tell). I'm not sure how I'd even debug client side stuff in general without a console to check...
  • The sun and moon textures themselves, as well as a bunch of code seemingly for handling how the sky renders, is in "net.minecraft.client.renderer.RenderGlobal". The code for rendering the sky looks pretty hard coded and not exactly extendable, and it only seems to be called by minecrafts' main run loop, so I doubt that trying to replace it with a child class would be wise, or even possible.

 

So how would I change the textures for the sun and moon? Can the visible size of the textures in the sky be changed? And if possible, how could I change their movement/positions in the sky, or add more/remove objects from the sky?

 

I apologize if I've tripped over basic java or minecraft forge coding knowledge here, or forgot to mention something important; my java is very rusty, and this is the second mod I've ever made (first one being a basic crops/tools/armor/etc. mod for 1.7).

Link to comment
Share on other sites

6 hours ago, pacguy said:

However, I seem to be completely unable to figure out which vanilla class is actually used in these routines (I'm hoping to extend it onto my own class so I can make minor tweaks to it, or at least view its' code so I can figure out what it even does).

There isn't a class in vanilla that does it. There are methods in WorldRenderer. To have your own sky call setSkyRenderer or override getSkyRenderer in your Dimension class. This will instead be rendered in place of what vanilla does.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Ah, I see. Are there any examples of using it like this I can work off of? Could I copy the vanilla code into a SkyRenderer and tweak it to do what I need? If so, what routine should I put it in?

 

I could take a gander at Galacticrafts implementation if push comes to shove, but I'd feel bad copying and messing with their implementation.

Edited by pacguy
Link to comment
Share on other sites

3 minutes ago, pacguy said:

Are there any examples of using it like this I can work off of?

Vanilla any mod that has a custom sky in their dimension.
 

4 minutes ago, pacguy said:

Could I copy the vanilla code into a SkyRenderer and tweak it to do what I need?

If you understand Java of course.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

1 minute ago, Animefan8888 said:

Vanilla any mod that has a custom sky in their dimension.

Ah, I guess that's alright. I'll try to copy the vanilla code into a custom SkyRenderer class and see what I can do.

 

3 minutes ago, Animefan8888 said:

If you understand Java of course.

Like I said in the OP, I do understand java, I have a fair amount of experience in it even if I am a bit rusty. It's the minecraft engine I don't understand.

Link to comment
Share on other sites

2 minutes ago, pacguy said:

Like I said in the OP, I do understand java, I have a fair amount of experience in it even if I am a bit rusty. It's the minecraft engine I don't understand.

I only said it that way because it should've been self explanatory.

  • Thanks 1

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

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.