Minecraft-Console-Client/MinecraftClient/Mcp/MccMcpRuntimeStateStore.cs

48 lines
1.2 KiB
C#
Raw Normal View History

2026-03-30 23:14:28 +02:00
using System;
using MinecraftClient.Scripting;
2026-03-30 23:14:28 +02:00
namespace MinecraftClient.Mcp;
public sealed class MccMcpRuntimeStateSnapshot
{
public long? WorldAge { get; init; }
public long? TimeOfDay { get; init; }
public float? RainLevel { get; init; }
public float? ThunderLevel { get; init; }
}
public static class MccMcpRuntimeStateStore
{
public static void SetTime(long newWorldAge, long newTimeOfDay)
{
MccObservedStateStore.SetTime(newWorldAge, newTimeOfDay);
2026-03-30 23:14:28 +02:00
}
public static void SetRainLevel(float level)
{
MccObservedStateStore.SetRainLevel(level);
2026-03-30 23:14:28 +02:00
}
public static void SetThunderLevel(float level)
{
MccObservedStateStore.SetThunderLevel(level);
2026-03-30 23:14:28 +02:00
}
public static MccMcpRuntimeStateSnapshot GetSnapshot()
{
MccRuntimeStateSnapshot snapshot = MccObservedStateStore.GetRuntimeStateSnapshot();
return new MccMcpRuntimeStateSnapshot
2026-03-30 23:14:28 +02:00
{
WorldAge = snapshot.WorldAge,
TimeOfDay = snapshot.TimeOfDay,
RainLevel = snapshot.RainLevel,
ThunderLevel = snapshot.ThunderLevel
};
2026-03-30 23:14:28 +02:00
}
public static void Clear()
{
MccObservedStateStore.ClearRuntimeState();
2026-03-30 23:14:28 +02:00
}
}