Modding: Dimension custom sun and moon size

In this tutorial I will show you how to give a custom sun and/or moon size to your dimension. The size of those is set in the WorldProvider. This is the file I will start with.


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;
}
}


Now to change the sun and moon size you can add one or both of those methods.


public float setSunSize()
    {
        return 2.0F;
    }
     
    public float setMoonSize()
    {
        return 0.5F;
    }


The default for both of these methods is 1.0F. Making it 2.0F will double the size and 0.5F will have half the size. You could use pretty much every value you want for this.
The whole file should now look something like this.


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 float setSunSize()
    {
        return 2.0F;
    }

    public float setMoonSize()
    {
        return 0.5F;
    }

public String func_80007_l() 
{
return null;
}
}



When you are done you should go back to the tutorials list here.

1 opmerking:

  1. ROBLOX is driven by an ever growing community of more than 300,000 creator players who generate an infinite variety of highly immersive experiences.

    These experiences range from 3D multiplayer games and contests, to interactive adventures where players can take on new personas to imagine what it's like to be a dinosaur, a miner working a mine or an astronaut out in space.

    BeantwoordenVerwijderen