mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
feat: expose block state properties through MCP
This commit is contained in:
parent
1fd4b0244d
commit
f1d844afbe
8 changed files with 4733 additions and 10 deletions
43
MinecraftClient.Tests/BlockStatePropertiesTests.cs
Normal file
43
MinecraftClient.Tests/BlockStatePropertiesTests.cs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
using MinecraftClient.Mapping.BlockPalettes;
|
||||
|
||||
namespace MinecraftClient.Tests;
|
||||
|
||||
public sealed class BlockStatePropertiesTests
|
||||
{
|
||||
private readonly Palette262 _palette = new();
|
||||
|
||||
[Theory]
|
||||
[InlineData(32162, "north", "true", "inactive")]
|
||||
[InlineData(32168, "north", "false", "unlocking")]
|
||||
[InlineData(32193, "east", "false", "ejecting")]
|
||||
public void VaultStatesExposeAllProperties(
|
||||
int stateId,
|
||||
string facing,
|
||||
string ominous,
|
||||
string vaultState)
|
||||
{
|
||||
IReadOnlyDictionary<string, string> properties = _palette.GetStateProperties(stateId);
|
||||
|
||||
Assert.Equal(facing, properties["facing"]);
|
||||
Assert.Equal(ominous, properties["ominous"]);
|
||||
Assert.Equal(vaultState, properties["vault_state"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PropertiesUseServerReportedStateStride()
|
||||
{
|
||||
IReadOnlyDictionary<string, string> properties = _palette.GetStateProperties(3989);
|
||||
|
||||
Assert.Equal("left", properties["type"]);
|
||||
Assert.Equal("north", properties["facing"]);
|
||||
Assert.Equal("true", properties["waterlogged"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void StateWithoutPropertiesReturnsEmptyMap()
|
||||
{
|
||||
IReadOnlyDictionary<string, string> properties = _palette.GetStateProperties(1);
|
||||
|
||||
Assert.Empty(properties);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue