27 lines
1.1 KiB
C#
27 lines
1.1 KiB
C#
using Vintagestory.API.Common;
|
|
using Vintagestory.API.MathTools;
|
|
|
|
namespace RoamingBees.Behaviors;
|
|
|
|
public class BlockBehaviorRoamingBees(Block block) : BlockBehavior(block)
|
|
{
|
|
public override string GetPlacedBlockInfo(IWorldAccessor world, BlockPos pos, IPlayer forPlayer)
|
|
{
|
|
if (!world.EntityDebugMode)
|
|
return base.GetPlacedBlockInfo(world, pos, forPlayer);
|
|
|
|
var entityBehavior = block.GetBEBehavior<BlockEntityBehaviorRoamingBees>(pos);
|
|
if (entityBehavior is null)
|
|
return base.GetPlacedBlockInfo(world, pos, forPlayer);
|
|
|
|
var str = $"Roaming bees: {entityBehavior.ActiveBeesCount}\n";
|
|
str += $"Target roaming bees: {entityBehavior.TargetParticleCount}\n";
|
|
str += $"Time since last spawn + cooldown: {entityBehavior.TimeSinceLastSpawn:F1}\n";
|
|
|
|
str += $"Flowers around: {entityBehavior.FlowerCount}, crops around: {entityBehavior.CropCount}\n";
|
|
str += $"Scan progress: {entityBehavior.InitialScanProgress * 100f:F1}%, rescan progress: {entityBehavior.RescanProgress * 100f:F1}%\n";
|
|
|
|
return base.GetPlacedBlockInfo(world, pos, forPlayer) + str;
|
|
}
|
|
}
|