This is the first of many short dimension customization tutorials. They will all cover one small subject for your dimension. They are usually really short and simple.
In this tutorial I will show you how to change the save folder for your dimension. This is done in the WorldProvider file. This is the file I will start with.
package tutorial;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManagerHell;
import net.minecraft.world.chunk.IChunkProvider;
public class WorldProviderTutorial extends WorldProvider
{
public void registerWorldChunkManager()
{
this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.beach, 0.8F, 0.1F);
this.dimensionId = Tutorial.dimension;
}
public String getDimensionName()
{
return "Tutorial";
}
public boolean canRespawnHere()
{
return true;
}
@Override
public IChunkProvider createChunkGenerator()
{
return new ChunkProviderTutorial(worldObj, worldObj.getSeed(), true);
}
}
The code you need for this is just one method that looks like this.
public String getSaveFolder()
{
return "Custom Dimension Tutorial Folder";
}
Now when you start the game it will create a folder called Custom Dimension Tutorial Folder inside of the save folder for the world you are in.
The whole file should now look like this.
package tutorial;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManagerHell;
import net.minecraft.world.chunk.IChunkProvider;
public class WorldProviderTutorial extends WorldProvider
{
public void registerWorldChunkManager()
{
this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.beach, 0.8F, 0.1F);
this.dimensionId = Tutorial.dimension;
}
public String getDimensionName()
{
return "Tutorial";
}
public boolean canRespawnHere()
{
return true;
}
public String getSaveFolder()
{
return "Custom Dimension Tutorial Folder";
}
@Override
public IChunkProvider createChunkGenerator()
{
return new ChunkProviderTutorial(worldObj, worldObj.getSeed(), true);
}
}
When you are done you should go back to the tutorials list here.
Geen opmerkingen:
Een reactie posten