diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs
index 1fcdfa11..493ec01a 100644
--- a/TShockAPI/TShock.cs
+++ b/TShockAPI/TShock.cs
@@ -654,10 +654,20 @@ namespace TShockAPI
}
case "-dump":
{
+ Utils.PrepareLangForDump();
+ Lang.setLang(true);
ConfigFile.DumpDescriptions();
Permissions.DumpDescriptions();
ServerSideConfig.DumpDescriptions();
RestManager.DumpDescriptions();
+ Utils.DumpBuffs("BuffList.txt");
+ Utils.DumpItems("Items-1_0.txt", -48, 235);
+ Utils.DumpItems("Items-1_1.txt", 235, 604);
+ Utils.DumpItems("Items-1_2.txt", 604, 2749);
+ Utils.DumpItems("Items-1_3.txt", 2749, Main.maxItemTypes);
+ Utils.DumpNPCs("NPCs.txt");
+ Utils.DumpProjectiles("Projectiles.txt");
+ Utils.DumpPrefixes("Prefixes.txt");
Environment.Exit(1);
break;
}
diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs
index f669c684..e2b791d9 100644
--- a/TShockAPI/Utils.cs
+++ b/TShockAPI/Utils.cs
@@ -17,6 +17,7 @@ along with this program. If not, see .
*/
using System;
+using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -27,6 +28,7 @@ using System.Text;
using System.Text.RegularExpressions;
using Terraria;
using Terraria.ID;
+using Terraria.Utilities;
using TShockAPI.DB;
using BCrypt.Net;
using Microsoft.Xna.Framework;
@@ -1167,5 +1169,212 @@ namespace TShockAPI
return points;
}
+
+ internal void PrepareLangForDump()
+ {
+ for(int i = 0; i < Main.recipe.Length; i++)
+ Main.recipe[i] = new Recipe();
+ }
+
+ public void DumpBuffs(string path)
+ {
+ StringBuilder buffer = new StringBuilder();
+ buffer.AppendLine("[block:parameters]").AppendLine("{").AppendLine(" \"data\": {");
+ buffer.AppendLine(" \"h-0\": \"ID\",");
+ buffer.AppendLine(" \"h-1\": \"Name\",");
+ buffer.AppendLine(" \"h-2\": \"Description\",");
+
+ List