• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得cocoawindowspythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdombtronvb.netdirectxarduinopreviewerゲームエンジン

Carbon Copy plugin for VS


Commit MetaInfo

Revisionec7bbc8bbdf4663b7b3a4e9e86b0a8254e4d6f1f (tree)
Time2019-12-02 06:23:04
Authormelchior <melchior@user...>
Commitermelchior

Log Message

Added block list export function (for future use?)

Change Summary

Incremental Difference

--- a/CarbonCopy/CarbonCopyMod.cs
+++ b/CarbonCopy/CarbonCopyMod.cs
@@ -14,6 +14,7 @@ namespace VCMiscMods
1414 public class CarbonCopyMod : ModSystem
1515 {
1616 private const int _highlightSlot = 42;
17+ private const string _exportPath = @"Exports";
1718
1819 private ICoreAPI API { get; set; }
1920 private ICoreServerAPI ServerAPI { get; set; }
@@ -88,6 +89,10 @@ namespace VCMiscMods
8889 Process_ClearCommand( );
8990 break;
9091
92+ case "dumpblocklist":
93+ Dump_BlockList( );
94+ break;
95+
9196 default:
9297 ClientAPI.ShowChatMessage("Wrong argument? mark/save/clear");
9398 break;
@@ -207,7 +212,7 @@ namespace VCMiscMods
207212 {
208213 ClientAPI.ShowChatMessage(string.Format("Export packed OK: {0} Blocks {1} Entities {2} BlockEntity", blockExport.BlockIds.Count, blockExport.Entities.Count, blockExport.BlockEntities.Count));
209214
210- filename = Path.Combine(ClientAPI.GetOrCreateDataPath("Exports"), filename);
215+ filename = Path.Combine(ClientAPI.GetOrCreateDataPath(_exportPath), filename);
211216
212217 blockExport.Save(filename);
213218
@@ -229,6 +234,29 @@ namespace VCMiscMods
229234
230235 ClientAPI.ShowChatMessage("Mark(s) Cleared.");
231236 }
237+
238+ private void Dump_BlockList( )
239+ {
240+ var filename = Path.Combine(ClientAPI.GetOrCreateDataPath(_exportPath), "vs_block_list_export_" + GameVersion.OverallVersion + ".tsv");
241+
242+ using (StreamWriter reporter = new StreamWriter(filename)) {
243+
244+ reporter.WriteLine("MC Block Name\tVS Block Name\tVS ID#\tMaterial\t");
245+
246+ foreach (var block in ClientAPI.World.Blocks) {
247+ if (block.Id != 0 && !block.IsMissing) {
248+ reporter.WriteLine($"<FILL>\t{block.Code.Path}\t{block.BlockId}\t{block.BlockMaterial}");
249+
250+ }
251+
252+ }
253+
254+ reporter.Flush( );
255+ }
256+
257+ ClientAPI.ShowChatMessage("Created Block List....");
258+ }
259+
232260 }
233261 }
234262
--- a/CarbonCopy/modinfo.json
+++ b/CarbonCopy/modinfo.json
@@ -3,7 +3,7 @@
33 "name": "Carbon-Copy",
44 "description" : "Export schematics from MP (clientside!)",
55 "authors": ["Melchior"],
6- "version": "0.1.0",
6+ "version": "0.1.1",
77 "dependencies": {
88 "game": "1.9.9"
99 },