2026-03-30 23:14:28 +02:00
|
|
|
using System;
|
2026-04-03 19:06:43 +02:00
|
|
|
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)
|
|
|
|
|
{
|
2026-04-03 19:06:43 +02:00
|
|
|
MccObservedStateStore.SetTime(newWorldAge, newTimeOfDay);
|
2026-03-30 23:14:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void SetRainLevel(float level)
|
|
|
|
|
{
|
2026-04-03 19:06:43 +02:00
|
|
|
MccObservedStateStore.SetRainLevel(level);
|
2026-03-30 23:14:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void SetThunderLevel(float level)
|
|
|
|
|
{
|
2026-04-03 19:06:43 +02:00
|
|
|
MccObservedStateStore.SetThunderLevel(level);
|
2026-03-30 23:14:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static MccMcpRuntimeStateSnapshot GetSnapshot()
|
|
|
|
|
{
|
2026-04-03 19:06:43 +02:00
|
|
|
MccRuntimeStateSnapshot snapshot = MccObservedStateStore.GetRuntimeStateSnapshot();
|
|
|
|
|
return new MccMcpRuntimeStateSnapshot
|
2026-03-30 23:14:28 +02:00
|
|
|
{
|
2026-04-03 19:06:43 +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()
|
|
|
|
|
{
|
2026-04-03 19:06:43 +02:00
|
|
|
MccObservedStateStore.ClearRuntimeState();
|
2026-03-30 23:14:28 +02:00
|
|
|
}
|
|
|
|
|
}
|