this.Enabled = true;
}
+ public BlockDesignator(AssetLocation pattern, Color overwriteColor, EnumBlockMaterial? material, BlockDesignatorAction specialAct, bool state)
+ {
+ this.Pattern = pattern;
+ this.OverwriteColor = overwriteColor;
+ this.Material = material;
+ this.SpecialAction = specialAct;
+ this.SpecialActionName = specialAct.Method.Name;
+ this.Enabled = state;
+ }
+
public override string ToString()
{
return $"{Pattern.ToShortString()} | {OverwriteColor.Name} | {(Material.HasValue ? Material.ToString() : "?")} | [{SpecialActionName}]";
new AssetLocation("game", "wildbeehive"),
Color.Honeydew,
EnumBlockMaterial.Other,
- NoteWildbeehive
+ NoteWildbeehive,
+ false
);
+ public static BlockDesignator PineResinLeaks =
+ new BlockDesignator(
+ new AssetLocation("game", "log-resin"),
+ Color.DarkOrange,
+ EnumBlockMaterial.Wood,
+ NotePineResinLeak,
+ false
+ );
+
+
+
/// <summary>
/// Not just blocks, but block-entities as well!
/// </summary>
DefaultDesignators.Translocators,
DefaultDesignators.Teleporters,
DefaultDesignators.Wildbeehives,
+ DefaultDesignators.PineResinLeaks,
};
}
}
BlockEntityBeehive bees = clientAPI.World.BlockAccessor.GetBlockEntity(posn) as BlockEntityBeehive;
if (bees != null) {
- EnumHivePopSize hiveSize = AccessTools.FieldRefAccess<BlockEntityBeehive, EnumHivePopSize>(bees, @"hivePopSize");//TeleporterLocation tpLocation;
+ EnumHivePopSize hiveSize = AccessTools.FieldRefAccess<BlockEntityBeehive, EnumHivePopSize>(bees, @"hivePopSize");
StringBuilder textTarget = new StringBuilder( );
textTarget.AppendLine($" Population: {(hiveSize != null? hiveSize.ToString() : "?")} ");
}
}
+ internal static void NotePineResinLeak(ICoreClientAPI clientAPI, PointsOfInterest poi, BlockPos posn, Block block)
+ {
+ #if DEBUG
+ clientAPI.Logger.VerboseDebug("Resin leaking Pine tree Designator Invoked!");
+ #endif
+ //Note:Due to how Block-Entities are handled...only Harvested resin is tracked....
+ poi.AddReplace(
+ new PointOfInterest {
+ Name = "PineResin",
+ PrettyLocation = posn.PrettyCoords(clientAPI),
+ Location = posn.Copy( ),
+ Notes = String.Empty,
+ Timestamp = DateTime.UtcNow,
+ }
+ );
+ }
+
#endregion
}
}
private void Reload_POI_Designators()
{
- Logger.VerboseDebug("Connecting {0} Configured Block-Designators", configuration.BlockDesignators.Count);
+ uint poisSetup =0, eoiSetup = 0;
foreach (var designator in configuration.BlockDesignators)
{
+ if (designator.Enabled == false) continue;
var blockIDs = Helpers.ArbitrarytBlockIdHunter(ClientAPI, designator.Pattern, designator.Material);
if (blockIDs.Count > 0) { Logger.VerboseDebug("Designator {0} has {1} associated blockIDs", designator.ToString(), blockIDs.Count); }
foreach (var entry in blockIDs)
{
BlockID_Designators.Add(entry.Key, designator);
+ poisSetup++;
}
}
this.ChunkRenderer.BlockID_Designators = BlockID_Designators;
+ Logger.VerboseDebug("Connected {0} IDs from {1} Block-Designators", poisSetup, configuration.BlockDesignators.Count );
- Logger.VerboseDebug("Connecting {0} Configured Entity-Designators", configuration.EntityDesignators.Count);
foreach (var designator in configuration.EntityDesignators)
{
+ if (designator.Enabled == false) continue;
//Get Variants first, from EntityTypes...better be populated!
var matched = ClientAPI.World.EntityTypes.FindAll(entp => entp.Code.BeginsWith(designator.Pattern.Domain, designator.Pattern.Path));
foreach (var match in matched)
- {
+ {
Logger.VerboseDebug("Linked Entity: {0} Designator: {1}", match.Code, designator);
this.Entity_Designators.Add(match.Code, designator);
+ eoiSetup++;
}
-
- //EntityProperties props = ClientAPI.World.GetEntityType(designator.Pattern);
}
-
+ Logger.VerboseDebug("Connected {0} IDs from {1} Entity-Designators", eoiSetup, configuration.EntityDesignators.Count);
}