This repository has been archived on 2024-06-13. You can view files and clone it, but cannot push or open issues or pull requests.
2017-11-08 23:48:19 -08:00

32 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TrueCraft.API;
using TrueCraft.API.World;
using TrueCraft.Core.Logic.Blocks;
using TrueCraft.Core.World;
namespace TrueCraft.Core.TerrainGen.Decorations
{
public class ConiferTree : PineTree
{
const int LeafRadius = 2;
public override bool GenerateAt(IWorldSeed world, ISpatialBlockInformationProvider chunk, Coordinates3D location)
{
if (!ValidLocation(location))
return false;
var random = new Random(world.Seed);
int height = random.Next(7, 8);
GenerateColumn(chunk, location, height, WoodBlock.BlockID, 0x1);
GenerateCircle(chunk, location + new Coordinates3D(0, height - 2, 0), LeafRadius - 1, LeavesBlock.BlockID, 0x1);
GenerateCircle(chunk, location + new Coordinates3D(0, height - 1, 0), LeafRadius, LeavesBlock.BlockID, 0x1);
GenerateCircle(chunk, location + new Coordinates3D(0, height, 0), LeafRadius, LeavesBlock.BlockID, 0x1);
GenerateTopper(chunk, (location + new Coordinates3D(0, height + 1, 0)), 0x0);
return true;
}
}
}