Пример #1
0
	/// <summary>
	/// Gets the sky light level of a block
	/// </summary>
	/// <param name="pos"></param>
	/// <returns></returns>
	public int GetSkyLightLevel(BlockPos pos)
	{
		if (World.Dimension != World.DimensionType.OVERWORLD)
			throw new Exception("Sky lights do not exist in this dimension!");

		var chunkPos = pos.GetPosWithinChunk();
		return _blockLights[chunkPos.X, chunkPos.Y, chunkPos.Z];
	}
Пример #2
0
	/// <summary>
	/// Gets the block at the specified position
	/// </summary>
	/// <param name="pos"></param>
	/// <returns></returns>
	public BlockState GetBlockAt(BlockPos pos)
	{
		if (pos.Y > 255 || pos.Y < 0)
			return new BlockState(BlockType.VOID_AIR);

		var chunkPos = pos.GetPosWithinChunk();
		return BlockArray[GetBlockIndex(chunkPos)];
	}
Пример #3
0
	/// <summary>
	/// Gets the block light level of a block
	/// </summary>
	/// <param name="pos"></param>
	/// <returns></returns>
	public int GetBlockLightLevel(BlockPos pos)
	{
		var chunkPos = pos.GetPosWithinChunk();
		return _blockLights[chunkPos.X, chunkPos.Y, chunkPos.Z];
	}
Пример #4
0
    /// <summary>
    /// Gets the biome of a block, all blocks in a column have the same biome
    /// </summary>
    /// <param name="pos"></param>
    /// <returns></returns>
    public Biome GetBiome(BlockPos pos)
    {
        var localPos = pos.GetPosWithinChunk();

        return(_biomeMap[localPos.X, localPos.Z]);
    }