Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I want to remove the clouds and change the sky colour of the Overworld.

 

Do I do this using generateSurface() function?  Or some other method?

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.

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

  • Author

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)
{

}
}

 

Actually, I believe that code is hard-coded into WorldProvider.

You can "maybe" use events to extract that and use it for your own use.

 

Otherwise, you might think about using ASM.

 

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

  • Author

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?

 

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.

  • Author

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?

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.