adding saving to Datapacks and datasets
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using Cogwheel;
|
||||
using SessionZero.Cogwheel;
|
||||
@@ -15,6 +16,27 @@ public static class AppManager
|
||||
public static CommandsManager CommandsManager { get; } = new();
|
||||
public static ConsoleControl ConsoleControl { get; } = new();
|
||||
public static AppSettings Settings { get; } = new();
|
||||
|
||||
public static string DataDirectory => Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "data");
|
||||
public static string DatapacksDirectory => Path.Combine(DataDirectory, "datapacks");
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
VerifyDataDirs();
|
||||
}
|
||||
|
||||
public static void VerifyDataDirs()
|
||||
{
|
||||
if (!Directory.Exists(DataDirectory))
|
||||
{
|
||||
Directory.CreateDirectory(DataDirectory);
|
||||
}
|
||||
|
||||
if (!Directory.Exists(DatapacksDirectory))
|
||||
{
|
||||
Directory.CreateDirectory(DatapacksDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
public static void ShowConsole()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user