Carbon Copy plugin for VS
修訂 | 0c96495765339442b7200992acbb85b92197b6b2 (tree) |
---|---|
時間 | 2020-10-21 02:25:59 |
作者 | melchior <melchior@user...> |
Commiter | melchior |
Updated for V.S. 1.13
@@ -1,6 +1,7 @@ | ||
1 | 1 | using System; |
2 | 2 | using System.Collections.Generic; |
3 | 3 | using System.IO; |
4 | +using System.Linq; | |
4 | 5 | |
5 | 6 | using Vintagestory.API.Client; |
6 | 7 | using Vintagestory.API.Common; |
@@ -96,7 +97,7 @@ namespace CarbonCopy | ||
96 | 97 | switch (subCommand) { |
97 | 98 | case "start": |
98 | 99 | if (this.start == null) { |
99 | - this.start = ClientAPI.World.Player.Entity.LocalPos.AsBlockPos.Copy( ); | |
100 | + this.start = ClientAPI.World.Player.Entity.Pos.AsBlockPos.Copy( ); | |
100 | 101 | } |
101 | 102 | BendBlockPosition(this.start, args); |
102 | 103 |
@@ -105,7 +106,7 @@ namespace CarbonCopy | ||
105 | 106 | |
106 | 107 | case "end": |
107 | 108 | if (this.end == null) { |
108 | - this.end = ClientAPI.World.Player.Entity.LocalPos.AsBlockPos.Copy( ); | |
109 | + this.end = ClientAPI.World.Player.Entity.Pos.AsBlockPos.Copy( ); | |
109 | 110 | } |
110 | 111 | BendBlockPosition(this.end, args); |
111 | 112 |
@@ -232,8 +233,8 @@ namespace CarbonCopy | ||
232 | 233 | |
233 | 234 | reporter.WriteLine("MC Block Name\tVS Block Name\tVS ID#\tMaterial\t"); |
234 | 235 | Logger.VerboseDebug("Dumping {0} Blocks", ClientAPI.World.Blocks.Count); |
235 | - foreach (var block in ClientAPI.World.Blocks.FindAll(blk => blk.Code != null && blk.Code.Domain == GlobalConstants.DefaultDomain)) { | |
236 | - if (block.Id != 0 && !block.IsMissing ) { | |
236 | + foreach (var block in ClientAPI.World.Blocks.Where(blk => blk.Code != null && blk.Code.Domain == GlobalConstants.DefaultDomain)) { | |
237 | + if (block.Id != 0 && !block.IsMissing && block.Code.Path != "unknown" ) { | |
237 | 238 | reporter.WriteLine($"____\t{block.Code.Path}\t{block.BlockId}\t{block.BlockMaterial}"); |
238 | 239 | |
239 | 240 | } |
@@ -254,8 +255,8 @@ namespace CarbonCopy | ||
254 | 255 | |
255 | 256 | reporter.WriteLine("MC Item Name\tVS Item Name\tVS ID#\tStorage Flags\tMax Stack Size\tC.I. Tabs\t"); |
256 | 257 | Logger.VerboseDebug("Dumping {0} Items", ClientAPI.World.Items.Count); |
257 | - foreach (var item in ClientAPI.World.Items.FindAll(itm => itm.Code != null && itm.Code.Domain == GlobalConstants.DefaultDomain)) { | |
258 | - if (item.Id != 0 && !item.IsMissing) { | |
258 | + foreach (var item in ClientAPI.World.Items.Where(itm => itm.Code != null && itm.Code.Domain == GlobalConstants.DefaultDomain)) { | |
259 | + if (item.Id != 0 && !item.IsMissing && item.Code.Path != "unknown") { | |
259 | 260 | reporter.WriteLine($"____\t{item.Code.Path}\t{item.ItemId}\t{String.Join(",", item.StorageFlags)}\t{item.MaxStackSize}\t{(item.CreativeInventoryTabs != null ? String.Join(",",item.CreativeInventoryTabs): " ")}"); |
260 | 261 | } |
261 | 262 |
@@ -3,10 +3,10 @@ | ||
3 | 3 | "name": "Carbon-Copy", |
4 | 4 | "description" : "Export schematics from MP (clientside!)", |
5 | 5 | "authors": ["Melchior"], |
6 | - "version": "0.1.4", | |
6 | + "version": "0.1.5", | |
7 | 7 | "side": "client", |
8 | 8 | "dependencies": { |
9 | - "game": "1.11.0" | |
9 | + "game": "1.13.0" | |
10 | 10 | }, |
11 | 11 | "website": "http://nowebsite.nope" |
12 | 12 | } |