Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.

Commit 9758817

Browse files
committed
Use SE built-in serializer.
Remove access to non-existent property.
1 parent 02523b8 commit 9758817

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
//2444
1+
//2452
22
//
33
// This code was generated by a tool. Any changes made manually will be lost
44
// the next time this code is regenerated.
55
//
66

77
using System.Reflection;
88

9-
[assembly: AssemblyFileVersion("1.13.2.2444")]
10-
[assembly: AssemblyVersion("1.13.2.2444")]
9+
[assembly: AssemblyFileVersion("1.13.3.2452")]
10+
[assembly: AssemblyVersion("1.13.3.2452")]

EssentialsPlugin/AssemblyFileVersion.tt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@
2929

3030
using System.Reflection;
3131

32-
[assembly: AssemblyFileVersion("1.13.2.<#= revisionNumber #>")]
33-
[assembly: AssemblyVersion("1.13.2.<#= revisionNumber #>")]
32+
[assembly: AssemblyFileVersion("1.13.3.<#= revisionNumber #>")]
33+
[assembly: AssemblyVersion("1.13.3.<#= revisionNumber #>")]

EssentialsPlugin/ChatHandlers/Dock/HandleAdminUndockAll.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ public override bool HandleCommand(ulong userId, string[] words)
6161
}
6262

6363
// FileInfo fileInfo = new FileInfo(dockedShipFileName);
64-
MyObjectBuilder_CubeGrid cubeGrid = BaseObjectManager.ReadSpaceEngineersFile<MyObjectBuilder_CubeGrid, MyObjectBuilder_CubeGridSerializer>(dockedShipFileName);
64+
MyObjectBuilder_CubeGrid cubeGrid;
65+
MyObjectBuilderSerializer.DeserializeXML( dockedShipFileName, out cubeGrid );
6566

6667
if (entity != null)
6768
{

EssentialsPlugin/ChatHandlers/Dock/HandleDockUndock.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ public override bool HandleCommand(ulong userId, string[] words)
141141
FileInfo fileInfo = new FileInfo( dockedShipFileName );
142142
//CubeGridEntity cubeGrid = new CubeGridEntity(fileInfo);
143143

144-
MyObjectBuilder_CubeGrid cubeGrid = BaseObjectManager.ReadSpaceEngineersFile<MyObjectBuilder_CubeGrid, MyObjectBuilder_CubeGridSerializer>( dockedShipFileName );
144+
MyObjectBuilder_CubeGrid cubeGrid;
145+
MyObjectBuilderSerializer.DeserializeXML( dockedShipFileName, out cubeGrid );
145146

146147
// Rotate our ship relative to our saved rotation and the new carrier rotation
147148
cubeGrid.PositionAndOrientation =

EssentialsPlugin/ProcessHandlers/ProcessBlockEnforcement.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ private void ScanForBlockItems( )
7070
IMyGridTerminalSystem gridTerminal = MyAPIGateway.TerminalActionsHelper.GetTerminalSystemForGrid( grid );
7171

7272
Dictionary<SettingsBlockEnforcementItem, int> blocks = new Dictionary<SettingsBlockEnforcementItem, int>( );
73-
foreach ( IMyTerminalBlock myTerminalBlock in gridTerminal.Blocks )
73+
List<IMyTerminalBlock> blockstoProcess = new List<IMyTerminalBlock>( );
74+
gridTerminal.GetBlocksOfType<IMyTerminalBlock>( blockstoProcess );
75+
foreach ( IMyTerminalBlock myTerminalBlock in blockstoProcess )
7476
{
7577
IMyTerminalBlock block = myTerminalBlock;
7678
foreach ( SettingsBlockEnforcementItem item in PluginSettings.Instance.BlockEnforcementItems )
@@ -169,9 +171,11 @@ private void DeleteReverse( SettingsBlockEnforcementItem blockEnforcementSetting
169171
IMyGridTerminalSystem gridTerminal = MyAPIGateway.TerminalActionsHelper.GetTerminalSystemForGrid( grid );
170172

171173
List<Sandbox.ModAPI.IMyTerminalBlock> blocksToRemove = new List<Sandbox.ModAPI.IMyTerminalBlock>( );
172-
for ( int r = gridTerminal.Blocks.Count - 1; r >= 0; r-- )
174+
List<IMyTerminalBlock> blockstoProcess = new List<IMyTerminalBlock>();
175+
gridTerminal.GetBlocksOfType<IMyTerminalBlock>( blockstoProcess );
176+
for ( int r = blockstoProcess.Count - 1; r >= 0; r-- )
173177
{
174-
Sandbox.ModAPI.IMyTerminalBlock block = (Sandbox.ModAPI.IMyTerminalBlock)gridTerminal.Blocks[ r ];
178+
Sandbox.ModAPI.IMyTerminalBlock block = (Sandbox.ModAPI.IMyTerminalBlock)blockstoProcess[ r ];
175179
switch ( blockEnforcementSetting.Mode )
176180
{
177181
case SettingsBlockEnforcementItem.EnforcementMode.BlockSubtypeId:

0 commit comments

Comments
 (0)