-using Vintagestory.API.Client;
-using Vintagestory.API.Common;
+using System.Collections.ObjectModel;
+using System.Linq;
+using Vintagestory.API.Client;
+using Vintagestory.API.Common;
namespace Automap
public override double ExecuteOrder()
{
- return 0.2;
+ return 1.2;
}
private bool ToggleAM_Dialog(KeyCombination comb)
ClientAPI.StoreModConfig<PersistedConfiguration>(this.CachedConfiguration, _configFilename);
}
+ #region External Interfaces
+ //Perhaps Other mods can make use of POI / EOI?
+
+ public ReadOnlyCollection<PointOfInterest> PointsOfInterest {
+ get
+ {
+ return _localAutomap.POIs.ToList().AsReadOnly();
+ }
+ }
+
+ public ReadOnlyCollection<EntityOfInterest> EntitiesOfInterest {
+ get
+ {
+ return _localAutomap.EOIs.ToList().AsReadOnly();
+ }
+ }
+
+ public CommandType Status
+ {
+ get { return _localAutomap.CurrentState; }
+ }
+
+ #endregion
}
KeepTrackOfMerchant
);
+ public static BlockDesignator Wildbeehives =
+ new BlockDesignator(
+ new AssetLocation("game", "wildbeehive"),
+ Color.Honeydew,
+ EnumBlockMaterial.Other,
+ NoteWildbeehive
+ );
+
/// <summary>
/// Not just blocks, but block-entities as well!
/// </summary>
DefaultDesignators.PostSigns,
DefaultDesignators.Translocators,
DefaultDesignators.Teleporters,
+ DefaultDesignators.Wildbeehives,
};
}
}
}
}
+ internal static void NoteWildbeehive(ICoreClientAPI clientAPI, PointsOfInterest poi, BlockPos posn, Block block)
+ {
+ #if DEBUG
+ clientAPI.Logger.VerboseDebug("Wild bee hive Designator Invoked!");
+ #endif
+
+ BlockEntityBeehive bees = clientAPI.World.BlockAccessor.GetBlockEntity(posn) as BlockEntityBeehive;
+
+ if (bees != null) {
+ EnumHivePopSize hiveSize = AccessTools.FieldRefAccess<BlockEntityBeehive, EnumHivePopSize>(bees, @"hivePopSize");//TeleporterLocation tpLocation;
+
+ StringBuilder textTarget = new StringBuilder( );
+ textTarget.AppendLine($" Population: {(hiveSize != null? hiveSize.ToString() : "?")} ");
+
+ poi.AddReplace(
+ new PointOfInterest {
+ Name = "Wildbeehive",
+ PrettyLocation = posn.PrettyCoords(clientAPI),
+ Location = posn.Copy( ),
+ Notes = textTarget.ToString( ),
+ Timestamp = DateTime.UtcNow,
+ }
+ );
+ }
+ }
+
#endregion
}
}
private ConcurrentDictionary<Vec2i, ColumnCounter> columnCounters = new ConcurrentDictionary<Vec2i, ColumnCounter>(3, 150);
private ColumnsMetadata chunkTopMetadata;
- private PointsOfInterest POIs = new PointsOfInterest();
- private EntitiesOfInterest EOIs = new EntitiesOfInterest();
- private Dictionary<int, ulong> blockTally;//TODO: TOTAL Road Tally
+ internal PointsOfInterest POIs = new PointsOfInterest();
+ internal EntitiesOfInterest EOIs = new EntitiesOfInterest();
internal Dictionary<int, BlockDesignator> BlockID_Designators { get; private set; }
internal Dictionary<AssetLocation, EntityDesignator> Entity_Designators { get; private set; }
mdWriter.WriteLine("AMVersion '{0}'", ClientAPI.Self().Info.Version);
mdWriter.WriteLine("PlayTime {0:F1}", ClientAPI.InWorldEllapsedMilliseconds / 1000);
mdWriter.WriteLine("GameDate {0}", ClientAPI.World.Calendar.PrettyDate());
+ mdWriter.WriteLine("Chunks {0:D}", chunkTopMetadata.Count);
+ mdWriter.WriteLine("Chunks Updated {0:D}", updatedChunksTotal);
+ mdWriter.WriteLine("Null Chunks {0:D}", nullChunkCount);
mdWriter.Flush( );
}
}
"description" : "Automap; Generates a static HTML5 map dynamically, with P.O.I. Tracking & more.",
"authors": ["Melchior","VeryGoodDog"],
"contributors":["VeryGoodDog"],
- "version": "0.1.6",
+ "version": "0.1.7",
"side":"Client",
"dependencies": {
"game": "1.14.10"