OSDN Git Service

Apparently 'fixed' Air Block type filters (non-solid plants)
authormelchior <melchior@users.osdn.me>
Wed, 11 Nov 2020 22:42:49 +0000 (17:42 -0500)
committermelchior <melchior@users.osdn.me>
Wed, 11 Nov 2020 22:42:49 +0000 (17:42 -0500)
Automap/Subsystems/AutomapSystem.cs

index e83bc1a..f61fef5 100644 (file)
@@ -328,10 +328,16 @@ namespace Automap
                        this.BlockID_Designators = new Dictionary<int, BlockDesignator>();
                        this.Entity_Designators = new Dictionary<AssetLocation, EntityDesignator>();
                        this.RockIdCodes = Helpers.ArbitrarytBlockIdHunter(ClientAPI, new AssetLocation(GlobalConstants.DefaultDomain, "rock-"), EnumBlockMaterial.Stone);
-                       this.AiryIdCodes = Helpers.ArbitrarytBlockIdHunter(ClientAPI, new AssetLocation(GlobalConstants.DefaultDomain, "tallgrass-"), EnumBlockMaterial.Plant);
 
-                       //Add special marker types for BlockID's of "Interest", overwrite colour, and method
+                       var airBlocksQuery = from airyBlock in ClientAPI.World.Blocks
+                                                        where airyBlock.MatterState == EnumMatterState.Solid
+                                                        where airyBlock.BlockMaterial == EnumBlockMaterial.Plant || airyBlock.BlockMaterial == EnumBlockMaterial.Leaves
+                                                        where airyBlock.CollisionBoxes == null || airyBlock.CollisionBoxes.Length == 0
+                                                        select airyBlock;                      
+                       //^^ 'Solid' phase - 'Plant' Blocks without any boundg box ? Except water...
+                       this.AiryIdCodes = airBlocksQuery.ToDictionary(aBlk => aBlk.BlockId, aBlk => aBlk.Code.Path);
 
+                       //Add special marker types for BlockID's of "Interest", overwrite colour, and method
                        Reload_POI_Designators();
                }