feat(models): add block model boxes + picking

This commit is contained in:
Jacobwasbeast
2026-03-11 15:12:35 -05:00
parent 6fabb8fd39
commit 788b7167a2
26 changed files with 1429 additions and 4 deletions

View File

@@ -44,7 +44,7 @@ internal class ModManager
{
try
{
mod.Instance.OnTick();
WithContext(mod, () => mod.Instance.OnTick());
}
catch (Exception ex)
{
@@ -64,7 +64,7 @@ internal class ModManager
{
try
{
action();
WithContext(mod, action);
}
catch (Exception ex)
{
@@ -72,4 +72,19 @@ internal class ModManager
Logger.Debug(ex.StackTrace ?? "");
}
}
private static void WithContext(ModDiscovery.DiscoveredMod mod, Action action)
{
ModContext.ModId = mod.Metadata.Id;
ModContext.ModFolder = mod.Folder;
try
{
action();
}
finally
{
ModContext.ModId = null;
ModContext.ModFolder = null;
}
}
}