Hello, I am making a Minecraft-Clone game caled BuildWorld, and the game uses MinePackage. I have some code from the wiki for a building function, and here it is.
public class MyCoolNewDecoration : IDecoration
{
private readonly WorldData m_WorldData;
public MyCoolNewDecoration(WorldData worldData)
{
m_WorldData = worldData;
}
public bool Decorate(int blockX, int blockY, int blockZ, Random random)
{
if (IsAValidLocationforDecoration(blockX, blockY, blockZ, random))
{
CreateDecorationAt(blockX, blockY, blockZ, random);
return true;
}
return false;
}
private void CreateDecorationAt(int blockX, int blockY, int blockZ, Random random)
{
m_WorldData.SetBlockType(blockX, blockY, blockZ, BlockType.Stone);
}
private bool IsAValidLocationforDecoration(int blockX, int blockY, int blockZ, Random random)
{
if (random.RandomRange(1, 100) < 90)
{
return false;
}
return m_WorldData.GetBlock(blockX, blockY, blockZ).Type == BlockType.Air;
}
}
The thing keeps saying The type or namespace “IDecorator” could not be found. I badly need someone to help with this code, so I can implement a building function into the game. IDecorator is another script I have. Anyone help? ![]()