feat(blockstates): rotation profiles and placement tracking

This commit is contained in:
Jacobwasbeast
2026-03-11 19:56:21 -05:00
parent b47e3d2354
commit d4f7603390
15 changed files with 840 additions and 26 deletions

View File

@@ -52,6 +52,19 @@ public enum SoundType
Snow = 9
}
/// <summary>
/// Rotation/profile mapping used when resolving blockstate variants.
/// </summary>
public enum BlockRotationProfile
{
None = 0,
Facing = 1,
WallSign = 2,
StandingSign = 3,
Trapdoor = 4,
Door = 5
}
/// <summary>
/// Fluent builder for defining block properties.
/// </summary>
@@ -73,7 +86,10 @@ public class BlockProperties
internal ToolType RequiredToolValue = ToolType.None;
internal bool AcceptsRedstonePowerValue;
internal List<Assets.ModelBox>? ModelBoxes;
internal Dictionary<string, List<Assets.ModelBox>>? ModelVariants;
internal bool ModelIsFullCube;
internal BlockRotationProfile RotationProfileValue = BlockRotationProfile.None;
internal string? BlockStateValue;
public BlockProperties Material(MaterialType material) { MaterialValue = material; return this; }
public BlockProperties Hardness(float hardness) { HardnessValue = hardness; return this; }
@@ -106,4 +122,8 @@ public class BlockProperties
public BlockProperties RequiredTool(ToolType tool) { RequiredToolValue = tool; return this; }
/// <summary>Marks the block as one that can receive redstone power. Stored for future block callbacks.</summary>
public BlockProperties AcceptsRedstonePower(bool accepts = true) { AcceptsRedstonePowerValue = accepts; return this; }
/// <summary>Optional blockstate JSON name (e.g. "examplemod:ruby_chair").</summary>
public BlockProperties BlockState(string blockStateName) { BlockStateValue = blockStateName; return this; }
/// <summary>Rotation/profile mapping for blockstate variants.</summary>
public BlockProperties RotationProfile(BlockRotationProfile profile) { RotationProfileValue = profile; return this; }
}