public void CheckPlots() foreach (var user in PlayerPlots.Keys.ToList())

public class AutoFarmMonitor : IModInit

It alerts you when a farm plot needs water or fertilizer, and optionally logs the data to a chat channel or a file for later review. 1. Create the file: EcoServer/Mods/AutoFarmMonitor.cs

int thirsty = plots.Count(p => p.WaterLevel.Normalized < 0.3f); int hungry = plots.Count(p => p.FertilizerLevel.Normalized < 0.5f);

using Eco.Core.Plugins.Interfaces; using Eco.Gameplay.Players; using Eco.Gameplay.DynamicValues; using Eco.Mods.TechTree; using Eco.Shared.Localization; using Eco.Shared.Utils; using System.Collections.Generic; using System.Linq; using Eco.Core.Utils; using Eco.Gameplay.Systems.Chat; using Eco.Gameplay.Systems.Messaging.Chat; namespace Eco.Mods.AutoFarmMonitor

public void Initialize() Obj = this; Eco.Core.Plugins.PluginManager<ChatCommands>.Add(new FarmMonitorCommands());

public FarmPlotObject(FarmPlotObjectEntity entity, User owner) Entity = entity; Owner = owner; public FarmPlotObjectEntity Entity get; set; public User Owner get; set; public float WaterLevel => Entity.WaterLevel.Normalized; public float FertilizerLevel => Entity.FertilizerLevel.Normalized;

Eco v0.10.0.1
Subscribe to Our Newsletter
Get Insider Tips Straight to Your Inbox!
Eco v0.10.0.1