public void OnPlayerGathering(Player player, GatherEvent evt) { Invoke("On_PlayerGathering", player, evt); }
public static void PlayerGather(Inventory rec, ResourceTarget rt, ResourceGivePair rg, ref int amount) { try { Fougerite.Player player = Fougerite.Player.FindByNetworkPlayer(rec.networkView.owner); GatherEvent ge = new GatherEvent(rt, rg, amount); if (OnPlayerGathering != null) { OnPlayerGathering(player, ge); } amount = ge.Quantity; if (!ge.Override) { amount = Mathf.Min(amount, rg.AmountLeft()); } rg._resourceItemDatablock = ge.Item; rg.ResourceItemName = ge.Item; } catch (Exception ex) { Logger.LogException(ex); } }
public static void PlayerGatherWood(IMeleeWeaponItem rec, ResourceTarget rt, ref ItemDataBlock db, ref int amount, ref string name) { try { Fougerite.Player player = Fougerite.Player.FindByNetworkPlayer(rec.inventory.networkView.owner); GatherEvent ge = new GatherEvent(rt, db, amount); ge.Item = "Wood"; if (OnPlayerGathering != null) { OnPlayerGathering(player, ge); } db = Fougerite.Server.GetServer().Items.Find(ge.Item); amount = ge.Quantity; name = ge.Item; } catch (Exception ex) { Logger.LogException(ex); } }
void OnPlayerGathering(Fougerite.Player param0, GatherEvent param1) { foreach (KeyValuePair<string, V8Plugin> plugin in plugins) { plugin.Value.Invoke("On_PlayerGathering", param0, param1); // Deprecated plugin.Value.Invoke("OnPlayerGathering", param0, param1); } }