Jump to content

[1.7.10] How to add new Celestial Bodies?


TheSeaOfSpace

Recommended Posts

Hey there!

My name is Chris, and this is my first post!

 

Currently, I am working on an addon for Galacticraft that adds basic astronomy stuff.

 

I've been looking at how to change the texture of the sun at certain times (same with the moon), but more importantly,

 

I'm trying to add a milky way (through the use of texture)

 

I've looked through both the World classes and the World Provider, as well as looked extensively online (Even looking through Blood Moon's source code)for a number of weeks, but to no avail. Thus bringing me here.

 

So, my question is-

How would I go about adding a new celestial body?

 

Thanks much and please correct me if I'm posting incorrectly!

-Chris

Link to comment
Share on other sites

I think many people do it as a resource pack using Optifine or MCPatcher. For example look at this one: http://www.minecraftforum.net/forums/mapping-and-modding/resource-packs/2286150-1-8-and-1-7-custom-sky-space-edition-optifine-or

 

If you actually want to mod it, I believe that you want to create your own dimension. Then you can replace the sun and moon textures with code by overriding the getSunTexture() and getMoonTexture() in your world provider class. Looks like Draco has some experience with this: http://binarymage.com/forum/viewtopic.php?f=13&t=936

 

The WorldProvider class also has getSkyRenderer() and setSkyRenderer() methods, so I assume you could copy the vanilla sky renderer class and change it how you like and use that instead. There is also a getCloudRenderer() and setCloudRenderer() method. And there is also getWeatherRenderer() and setWeatherRenderer() method.

 

I haven't done it myself, but I expect that should be enough to get you to what you want.

 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

He wants to do it as an addon to GalactiCraft, which is the mod supplying the custom dimension.

 

Unfortunately in order to add the celestials he'd have to either get GalactiCraft to add some API methods or events to the required functions.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

He wants to do it as an addon to GalactiCraft, which is the mod supplying the custom dimension.

 

Unfortunately in order to add the celestials he'd have to either get GalactiCraft to add some API methods or events to the required functions.

 

Doesn't GalactiCraft already have API for that sort of stuff: http://forum.micdoodle8.com/index.php?threads/how-to-write-a-basic-moon-addon-1-7.4452/

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Without replacing dimension/world classes and ASM... Well, there are always some Rendering events. Check out Forge's client.event package.

RenderWorldLast? nah.... won't do the trick.

 

You WILL need to replace something at some point. Let's go back to dimensions idea.

 

Basically you can grab suraface dimension and replace something in it with your own creations. In this case you will need (at least) extension to WorldProvider and override for methods that render sky (lookup WorldProvider.class).

 

For ANYTHING more "exclusive" you will need to make quite bigger replacement - RenderGlobal is your jam. You could (theoretically) extend it and replace it in startup (yay, its public in Minecraft.class).

 

Be cautious! Don't mess with too much code, just ADD new stuff, don't remove (compatibility).

 

Interesting methods: RenderGlobal#renderSky(...)

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

How would I put a graphic into the sky?

 

I already explained to you how. You can put any textures you want by returning them from your own world provider and you can completely override the rendering by providing your own IRenderHandler classes for the sky renderer, cloud renderer, etc.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Ah,

apologies, didn't catch that!

 

I mean to add this in the vanilla world provider, not for a custom dimension. I believe that it's possible, however I'm unsure.

I don't mess with this type of stuff usually.

 

Well this is Java so what you do is create a custom world provider but just extend the vanilla one and just change the parts you want to affect.

 

But I also think you can just use the setSkyRenderer() method on the vanilla world provider to point to your own renderer.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

add this in the vanilla

create a custom world provider

 

*Cough*

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Ah,

apologies, didn't catch that!

 

I mean to add this in the vanilla world provider, not for a custom dimension. I believe that it's possible, however I'm unsure.

I don't mess with this type of stuff usually.

You can just set render handler. Use WorldProvider#setSkyRenderer(IRenderHandler theSkyRenderer).

(In case you don't know how to get overworld worldprovider, use WorldEvent.Load and check if its dimensionId is 0)

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.