Jump to content

Recommended Posts

Posted

In WorldProvider class, there is getSkyColor method. You can use it.

For the cloud, one solution is editing your own cloudrenderer and sets the cloudrenderer of the WorldProvider with your own.

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

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

Posted

When you change the skycolor, don't forge to change fogcolor too, or wierd shifts happen. 

 

On the cloudrender, I posted an example you can look at a week ago or so.  I only had one issue, I couldn't figure out how to keep the clouds for brightening as if a light was shining on them.  It was wierd.

Long time Bukkit & Forge Programmer

Happy to try and help

Posted

I've made an event manager (using a Wuppy tutorial for the base

), and am now figuring how to use the getSkyColor method.  I suppose I put it in the generateSurface() method that I've created:

 

 

package tutorial.generic;

import java.util.Random;

import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import cpw.mods.fml.common.IWorldGenerator;

public class EventManager implements IWorldGenerator{

public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) 
{
	switch (world.provider.dimensionId)
	{
	case -1:
		generateNether(world, random, chunkX * 16, chunkZ * 16);
	case 0:
		generateSurface(world, random, chunkX * 16, chunkZ * 16);
	case 1:
		generateEnd(world, random, chunkX * 16, chunkZ * 16);
	}
}

private void generateEnd(World world, Random random, int x, int z)
{

}

private void generateSurface(World world, Random random, int x, int z)
{

}

private void generateNether(World world, Random random, int x, int z)
{

}
}

 

Posted

There is a setcouldrender method Forge created in worldprovider. 

 

Just set your client after a few seconds to your custom cloudrender with the method.  No need for anything fancy.

Long time Bukkit & Forge Programmer

Happy to try and help

Posted

This is doing my head in!

 

I've made an ITWorldProvider that extends WorldProvider:

 

package tutorial.generic.world;

import net.minecraft.util.Vec3;
import net.minecraft.world.WorldProvider;

import com.sun.xml.internal.stream.Entity;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public abstract class ITWorldProvider extends WorldProvider
{

@Override
@SideOnly(Side.CLIENT)
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
{
	System.out.println("getSkyColor was called.");

	return this.worldObj.getWorldVec3Pool().getVecFromPool(0, 0, 0);
}

}

 

But Eclipse puts a redline under "getSkyColor" and give me an error: The method getSkyColor(Entity, float) of the type ITWorldProvider must override or implement a supertype method.

 

I copied the gist of this code from some Galacticraft code.  Any ideas what I'm doing wrong?

 

Posted

See the code in the WorldProvider class.

Find the getSkyColor method, and see what is wrong.

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

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

Posted

Solved it.  noob error.  When I used the Eclipse auto-import-packages-keystroke-thing, it put in import com.sun.xml.internal.stream.Entity; rather than import net.minecraft.entity.Entity;

 

New code:

 

package tutorial.generic.world;

import net.minecraft.entity.Entity;
import net.minecraft.util.Vec3;
import net.minecraft.world.WorldProvider;
import net.minecraftforge.client.IRenderHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public abstract class ITWorldProvider extends WorldProvider
{


//	@SideOnly(Side.CLIENT)
@Override
public Vec3 getFogColor(float var1, float var2)
{
	System.out.println("getFogColor called");

	return this.worldObj.getWorldVec3Pool().getVecFromPool((double) 0F / 255F, (double) 0F / 255F, (double) 0F / 255F);
}

@Override
//	@SideOnly(Side.CLIENT)
public Vec3 getSkyColor(Entity cameraEntity, float partialTicks)
{
	System.out.println("getSkyColor called");
	return this.worldObj.getWorldVec3Pool().getVecFromPool(0, 0, 0);

}

@Override
    public void setCloudRenderer(IRenderHandler renderer)
    {
	System.out.println("setCloudRenderer called");
    }

}

 

New question: how do I get my WorldProvider used on the Overworld?

Posted

Maybe changing DimensionManager.gerWorld(0).provider on World Load Event would work..

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

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

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.