Carbon Copy plugin for VS
修訂 | 8212f56fb84aafcb3eb5e5edab4caa60afbc2b57 (tree) |
---|---|
時間 | 2019-12-13 08:36:03 |
作者 | melchior <melchior@user...> |
Commiter | melchior |
Updated for VS 1.11 series; (modinfo change) - plus better msg
@@ -31,6 +31,12 @@ | ||
31 | 31 | <ErrorReport>prompt</ErrorReport> |
32 | 32 | <WarningLevel>4</WarningLevel> |
33 | 33 | <ConsolePause>false</ConsolePause> |
34 | + <CustomCommands> | |
35 | + <CustomCommands> | |
36 | + <Command type="AfterBuild" command="7z -tzip a Carboncopy_${ProjectConfig}.zip" workingdir="${TargetDir}" /> | |
37 | + <Command type="AfterClean" command="rm -f *.zip" workingdir="${TargetDir}" /> | |
38 | + </CustomCommands> | |
39 | + </CustomCommands> | |
34 | 40 | </PropertyGroup> |
35 | 41 | <ItemGroup> |
36 | 42 | <Reference Include="System" /> |
@@ -104,64 +104,66 @@ namespace VCMiscMods | ||
104 | 104 | |
105 | 105 | private void Process_MarkSubcommand(CmdArgs args ) |
106 | 106 | { |
107 | - if (args.Length > 0) | |
108 | - { | |
109 | - string subCommand = args.PopWord( ).ToLowerInvariant(); | |
110 | - | |
111 | - | |
112 | - switch (subCommand) | |
113 | - { | |
114 | - case "start": | |
115 | - if (this.start == null) { | |
116 | - this.start = ClientAPI.World.Player.Entity.LocalPos.AsBlockPos.Copy( ); | |
117 | - } | |
118 | - BendBlockPosition(this.start, args); | |
107 | + if (args.Length > 0) { | |
108 | + string subCommand = args.PopWord( ).ToLowerInvariant( ); | |
119 | 109 | |
120 | - ClientAPI.ShowChatMessage(string.Format("Marked start; ({0}).", start)); | |
121 | - break; | |
122 | 110 | |
123 | - case "end": | |
124 | - if (this.end == null) { | |
125 | - this.end = ClientAPI.World.Player.Entity.LocalPos.AsBlockPos.Copy( ); | |
126 | - } | |
127 | - BendBlockPosition(this.end, args); | |
111 | + switch (subCommand) { | |
112 | + case "start": | |
113 | + if (this.start == null) { | |
114 | + this.start = ClientAPI.World.Player.Entity.LocalPos.AsBlockPos.Copy( ); | |
115 | + } | |
116 | + BendBlockPosition(this.start, args); | |
128 | 117 | |
129 | - ClientAPI.ShowChatMessage(string.Format("Marked end; ({0}).", end)); | |
130 | - break; | |
118 | + ClientAPI.ShowChatMessage(string.Format("Marked start; ({0}).", start)); | |
119 | + break; | |
131 | 120 | |
132 | - default: | |
133 | - ClientAPI.ShowChatMessage("Mark: start or end ?"); | |
134 | - break; | |
121 | + case "end": | |
122 | + if (this.end == null) { | |
123 | + this.end = ClientAPI.World.Player.Entity.LocalPos.AsBlockPos.Copy( ); | |
135 | 124 | } |
125 | + BendBlockPosition(this.end, args); | |
136 | 126 | |
137 | - this.validSelection = false; | |
127 | + ClientAPI.ShowChatMessage(string.Format("Marked end; ({0}).", end)); | |
128 | + break; | |
138 | 129 | |
139 | - if (this.start != null && | |
140 | - this.end != null && | |
141 | - ClientAPI.World.BulkBlockAccessor.IsValidPos(this.start) && | |
142 | - ClientAPI.World.BulkBlockAccessor.IsValidPos(this.end) | |
143 | - ) | |
144 | - { | |
130 | + default: | |
131 | + ClientAPI.ShowChatMessage("Mark: start or end ?"); | |
132 | + break; | |
133 | + } | |
145 | 134 | |
146 | - //Calc. Vol: | |
147 | - var size = start.DistanceTo(end); | |
135 | + this.validSelection = false; | |
148 | 136 | |
149 | - if (size > 1) { | |
137 | + if (this.start != null && | |
138 | + this.end != null && | |
139 | + ClientAPI.World.BulkBlockAccessor.IsValidPos(this.start) && | |
140 | + ClientAPI.World.BulkBlockAccessor.IsValidPos(this.end) | |
141 | + ) { | |
150 | 142 | |
151 | - this.validSelection = true; | |
143 | + //Calc. Vol: | |
144 | + var size = start.DistanceTo(end); | |
152 | 145 | |
153 | - this.markedBlocks.Clear( ); | |
146 | + if (size > 1) { | |
154 | 147 | |
155 | - ClientAPI.World.BulkBlockAccessor.WalkBlocks(start, end, addToMarked); | |
148 | + this.validSelection = true; | |
156 | 149 | |
157 | - ClientAPI.World.HighlightBlocks(ClientAPI.World.Player, _highlightSlot, this.markedBlocks, colorList, EnumHighlightBlocksMode.Absolute, EnumHighlightShape.Arbitrary); | |
150 | + this.markedBlocks.Clear( ); | |
151 | + | |
152 | + ClientAPI.World.BulkBlockAccessor.WalkBlocks(start, end, addToMarked); | |
153 | + | |
154 | + ClientAPI.World.HighlightBlocks(ClientAPI.World.Player, _highlightSlot, this.markedBlocks, colorList, EnumHighlightBlocksMode.Absolute, EnumHighlightShape.Arbitrary); | |
155 | + | |
156 | + ClientAPI.ShowChatMessage(string.Format("Marked area: {0:f1}diag = {1} blocks", size, markedBlocks.Count)); | |
157 | + } | |
158 | + else { | |
159 | + ClientAPI.ShowChatMessage("Marked area: volume too small"); ; | |
160 | + } | |
161 | + } | |
162 | + } | |
163 | + else { | |
164 | + ClientAPI.ShowChatMessage("Mark: start / end (x,y,z +-1#)"); | |
165 | + } | |
158 | 166 | |
159 | - ClientAPI.ShowChatMessage(string.Format("Marked area: {0:f1}diag = {1} blocks", size, markedBlocks.Count)); | |
160 | - } else { | |
161 | - ClientAPI.ShowChatMessage("Marked area: volume too small"); ; | |
162 | - } | |
163 | - } | |
164 | - } | |
165 | 167 | } |
166 | 168 | |
167 | 169 | private void BendBlockPosition(BlockPos position, CmdArgs args) |
@@ -3,9 +3,10 @@ | ||
3 | 3 | "name": "Carbon-Copy", |
4 | 4 | "description" : "Export schematics from MP (clientside!)", |
5 | 5 | "authors": ["Melchior"], |
6 | - "version": "0.1.1", | |
6 | + "version": "0.1.2", | |
7 | + "side": "client", | |
7 | 8 | "dependencies": { |
8 | - "game": "1.9.9" | |
9 | + "game": "1.11.0" | |
9 | 10 | }, |
10 | 11 | "website": "http://nowebsite.nope" |
11 | 12 | } |