Modding: Dimension Stars during the day and no stars

In this tutorial I will show you how to have stars during the day and how to have no stars at all. This is done in the WorldProvider file. I will start with this file.


package Tutorial.common;

import net.minecraft.src.BiomeGenBase;
import net.minecraft.src.IChunkProvider;
import net.minecraft.src.WorldChunkManagerHell;
import net.minecraft.src.WorldProviderBase;

public class WorldProviderTutorial extends WorldProviderBase 
{
public int getDimensionID() 
{
return 37;
}

public void registerWorldChunkManager()
    {
        worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.extremeHills, 0.8F, 0.1F);
    }

    public IChunkProvider getChunkProvider()
    {
        return new ChunkProviderTutorial(worldObj, worldObj.getSeed(), true);
    }
    
public boolean canRespawnHere()
    {
        return true;
    }

public String func_80007_l() 
{
return null;
}
}


To show stars during the day you can add this code.


public float getStarBrightness(World world, float f)
    {
        return 1.0F;
    }


This needs to return 1.0F if you want stars during the day. If it is any lower you can only see them during the night.
A fun thing to note is that the stars during the day looks very winter/christmas like.

To remove all the stars you have to add this code.


public boolean renderStars()
    {
        return false;
    }


The whole file should now look like this.


package Tutorial.common;

import net.minecraft.src.BiomeGenBase;
import net.minecraft.src.IChunkProvider;
import net.minecraft.src.World;
import net.minecraft.src.WorldChunkManagerHell;
import net.minecraft.src.WorldProviderBase;

public class WorldProviderTutorial extends WorldProviderBase 
{
public int getDimensionID() 
{
return 37;
}

public void registerWorldChunkManager()
    {
        worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.extremeHills, 0.8F, 0.1F);
    }

    public IChunkProvider getChunkProvider()
    {
        return new ChunkProviderTutorial(worldObj, worldObj.getSeed(), true);
    }
    
    public float getStarBrightness(World world, float f)
    {
        return 1.0F;
    }
    
    public boolean renderStars()
    {
        return false;
    }
    
public boolean canRespawnHere()
    {
        return true;
    }

public String func_80007_l() 
{
return null;
}
}


Of course the getStarBrightness doesn’t do anything, because the stars aren’t there. This is just to show you where the code goes.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">