Skip to content

Instantly share code, notes, and snippets.

View UgurkanTech's full-sized avatar

UgurkanTech

View GitHub Profile
@UgurkanTech
UgurkanTech / Block.cs
Created February 22, 2024 02:42
A low level block struct.
public struct Block
{
uint data; //8 bytes
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Block(BlockType id, ushort metaData, bool isOpaque)
{
data = (uint)((ushort)id << 16) | (uint)(metaData << 1) | (uint)(isOpaque ? 0x1 : 0x0);
}