• R/O
  • HTTP
  • SSH
  • HTTPS

automap: Commit

Automap (OSS) GIT software repository


Commit MetaInfo

Revisión16d03c488cf240334842f6a9c38a9fc2921ec227 (tree)
Tiempo2021-06-30 09:45:20
Autormelchior <melchior@user...>
Commitermelchior

Log Message

Resinous Resources Revealed

Cambiar Resumen

Diferencia incremental

--- a/Automap/Data/BlockDesignator.cs
+++ b/Automap/Data/BlockDesignator.cs
@@ -64,6 +64,16 @@ namespace Automap
6464 this.Enabled = true;
6565 }
6666
67+ public BlockDesignator(AssetLocation pattern, Color overwriteColor, EnumBlockMaterial? material, BlockDesignatorAction specialAct, bool state)
68+ {
69+ this.Pattern = pattern;
70+ this.OverwriteColor = overwriteColor;
71+ this.Material = material;
72+ this.SpecialAction = specialAct;
73+ this.SpecialActionName = specialAct.Method.Name;
74+ this.Enabled = state;
75+ }
76+
6777 public override string ToString()
6878 {
6979 return $"{Pattern.ToShortString()} | {OverwriteColor.Name} | {(Material.HasValue ? Material.ToString() : "?")} | [{SpecialActionName}]";
--- a/Automap/Designators/DefaultDesignators.cs
+++ b/Automap/Designators/DefaultDesignators.cs
@@ -77,9 +77,21 @@ namespace Automap
7777 new AssetLocation("game", "wildbeehive"),
7878 Color.Honeydew,
7979 EnumBlockMaterial.Other,
80- NoteWildbeehive
80+ NoteWildbeehive,
81+ false
8182 );
8283
84+ public static BlockDesignator PineResinLeaks =
85+ new BlockDesignator(
86+ new AssetLocation("game", "log-resin"),
87+ Color.DarkOrange,
88+ EnumBlockMaterial.Wood,
89+ NotePineResinLeak,
90+ false
91+ );
92+
93+
94+
8395 /// <summary>
8496 /// Not just blocks, but block-entities as well!
8597 /// </summary>
@@ -96,6 +108,7 @@ namespace Automap
96108 DefaultDesignators.Translocators,
97109 DefaultDesignators.Teleporters,
98110 DefaultDesignators.Wildbeehives,
111+ DefaultDesignators.PineResinLeaks,
99112 };
100113 }
101114 }
@@ -289,7 +302,7 @@ namespace Automap
289302 BlockEntityBeehive bees = clientAPI.World.BlockAccessor.GetBlockEntity(posn) as BlockEntityBeehive;
290303
291304 if (bees != null) {
292- EnumHivePopSize hiveSize = AccessTools.FieldRefAccess<BlockEntityBeehive, EnumHivePopSize>(bees, @"hivePopSize");//TeleporterLocation tpLocation;
305+ EnumHivePopSize hiveSize = AccessTools.FieldRefAccess<BlockEntityBeehive, EnumHivePopSize>(bees, @"hivePopSize");
293306
294307 StringBuilder textTarget = new StringBuilder( );
295308 textTarget.AppendLine($" Population: {(hiveSize != null? hiveSize.ToString() : "?")} ");
@@ -306,6 +319,23 @@ namespace Automap
306319 }
307320 }
308321
322+ internal static void NotePineResinLeak(ICoreClientAPI clientAPI, PointsOfInterest poi, BlockPos posn, Block block)
323+ {
324+ #if DEBUG
325+ clientAPI.Logger.VerboseDebug("Resin leaking Pine tree Designator Invoked!");
326+ #endif
327+ //Note:Due to how Block-Entities are handled...only Harvested resin is tracked....
328+ poi.AddReplace(
329+ new PointOfInterest {
330+ Name = "PineResin",
331+ PrettyLocation = posn.PrettyCoords(clientAPI),
332+ Location = posn.Copy( ),
333+ Notes = String.Empty,
334+ Timestamp = DateTime.UtcNow,
335+ }
336+ );
337+ }
338+
309339 #endregion
310340 }
311341 }
--- a/Automap/Subsystems/AutomapSystem.cs
+++ b/Automap/Subsystems/AutomapSystem.cs
@@ -353,34 +353,36 @@ namespace Automap
353353
354354 private void Reload_POI_Designators()
355355 {
356- Logger.VerboseDebug("Connecting {0} Configured Block-Designators", configuration.BlockDesignators.Count);
356+ uint poisSetup =0, eoiSetup = 0;
357357 foreach (var designator in configuration.BlockDesignators)
358358 {
359+ if (designator.Enabled == false) continue;
359360 var blockIDs = Helpers.ArbitrarytBlockIdHunter(ClientAPI, designator.Pattern, designator.Material);
360361 if (blockIDs.Count > 0) { Logger.VerboseDebug("Designator {0} has {1} associated blockIDs", designator.ToString(), blockIDs.Count); }
361362 foreach (var entry in blockIDs)
362363 {
363364 BlockID_Designators.Add(entry.Key, designator);
365+ poisSetup++;
364366 }
365367 }
366368 this.ChunkRenderer.BlockID_Designators = BlockID_Designators;
369+ Logger.VerboseDebug("Connected {0} IDs from {1} Block-Designators", poisSetup, configuration.BlockDesignators.Count );
367370
368371
369- Logger.VerboseDebug("Connecting {0} Configured Entity-Designators", configuration.EntityDesignators.Count);
370372 foreach (var designator in configuration.EntityDesignators)
371373 {
374+ if (designator.Enabled == false) continue;
372375 //Get Variants first, from EntityTypes...better be populated!
373376 var matched = ClientAPI.World.EntityTypes.FindAll(entp => entp.Code.BeginsWith(designator.Pattern.Domain, designator.Pattern.Path));
374377
375378 foreach (var match in matched)
376- {
379+ {
377380 Logger.VerboseDebug("Linked Entity: {0} Designator: {1}", match.Code, designator);
378381 this.Entity_Designators.Add(match.Code, designator);
382+ eoiSetup++;
379383 }
380-
381- //EntityProperties props = ClientAPI.World.GetEntityType(designator.Pattern);
382384 }
383-
385+ Logger.VerboseDebug("Connected {0} IDs from {1} Entity-Designators", eoiSetup, configuration.EntityDesignators.Count);
384386
385387 }
386388
Show on old repository browser