feat: make Sand/Snow opaque and register Sand/Snow/Water blocks

This commit is contained in:
MDietermann
2026-05-31 21:38:11 +02:00
parent 4e14786668
commit 6eb17b6c5d
6 changed files with 59 additions and 1 deletions

View File

@@ -8,11 +8,15 @@ public sealed class BlockRegistry
public StoneBlock Stone { get; } = new();
public DirtBlock Dirt { get; } = new();
public GrassBlock Grass { get; } = new();
public SandBlock Sand { get; } = new();
public SnowBlock Snow { get; } = new();
public WaterBlock Water { get; } = new();
public BlockRegistry()
{
// Index by id. Order does not matter; slot = block.Id.
IBlock[] blocks = new IBlock[] { this.Air, this.Stone, this.Dirt, this.Grass };
IBlock[] blocks = new IBlock[]
{ this.Air, this.Stone, this.Dirt, this.Grass, this.Sand, this.Snow, this.Water };
this._byId = new IBlock[blocks.Length];
foreach (IBlock block in blocks)
{