public bool CallOverrideDebrisCreation(DeepWoods deepWoods) { if (OverrideDebrisCreation == null) { return(false); } // If multiple mods add an override, we shuffle the overrides and the first one "wins": foreach (Func <IDeepWoodsLocation, bool> callback in ToShuffledList(OverrideDebrisCreation.GetInvocationList())) { try { if (callback(deepWoods)) { return(true); } } catch (Exception e) { ModEntry.Log("[THIS IS NOT A BUG IN DEEPWOODS] Exception caught while calling callback from another mod: " + e, StardewModdingAPI.LogLevel.Warn); } } return(false); }
public void CallAfterDebrisCreation(DeepWoods deepWoods) { if (AfterDebrisCreation == null) { return; } foreach (Action <IDeepWoodsLocation> callback in AfterDebrisCreation.GetInvocationList()) { try { callback(deepWoods); } catch (Exception e) { ModEntry.Log("[THIS IS NOT A BUG IN DEEPWOODS] Exception caught while calling callback from another mod: " + e, StardewModdingAPI.LogLevel.Warn); } } }