Carbon Copy plugin for VS
Revisão | ec7bbc8bbdf4663b7b3a4e9e86b0a8254e4d6f1f (tree) |
---|---|
Hora | 2019-12-02 06:23:04 |
Autor | melchior <melchior@user...> |
Commiter | melchior |
Added block list export function (for future use?)
@@ -14,6 +14,7 @@ namespace VCMiscMods | ||
14 | 14 | public class CarbonCopyMod : ModSystem |
15 | 15 | { |
16 | 16 | private const int _highlightSlot = 42; |
17 | + private const string _exportPath = @"Exports"; | |
17 | 18 | |
18 | 19 | private ICoreAPI API { get; set; } |
19 | 20 | private ICoreServerAPI ServerAPI { get; set; } |
@@ -88,6 +89,10 @@ namespace VCMiscMods | ||
88 | 89 | Process_ClearCommand( ); |
89 | 90 | break; |
90 | 91 | |
92 | + case "dumpblocklist": | |
93 | + Dump_BlockList( ); | |
94 | + break; | |
95 | + | |
91 | 96 | default: |
92 | 97 | ClientAPI.ShowChatMessage("Wrong argument? mark/save/clear"); |
93 | 98 | break; |
@@ -207,7 +212,7 @@ namespace VCMiscMods | ||
207 | 212 | { |
208 | 213 | ClientAPI.ShowChatMessage(string.Format("Export packed OK: {0} Blocks {1} Entities {2} BlockEntity", blockExport.BlockIds.Count, blockExport.Entities.Count, blockExport.BlockEntities.Count)); |
209 | 214 | |
210 | - filename = Path.Combine(ClientAPI.GetOrCreateDataPath("Exports"), filename); | |
215 | + filename = Path.Combine(ClientAPI.GetOrCreateDataPath(_exportPath), filename); | |
211 | 216 | |
212 | 217 | blockExport.Save(filename); |
213 | 218 |
@@ -229,6 +234,29 @@ namespace VCMiscMods | ||
229 | 234 | |
230 | 235 | ClientAPI.ShowChatMessage("Mark(s) Cleared."); |
231 | 236 | } |
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 | + | |
232 | 260 | } |
233 | 261 | } |
234 | 262 |
@@ -3,7 +3,7 @@ | ||
3 | 3 | "name": "Carbon-Copy", |
4 | 4 | "description" : "Export schematics from MP (clientside!)", |
5 | 5 | "authors": ["Melchior"], |
6 | - "version": "0.1.0", | |
6 | + "version": "0.1.1", | |
7 | 7 | "dependencies": { |
8 | 8 | "game": "1.9.9" |
9 | 9 | }, |