1. After today's update I am getting this error on one of my personal plugins
    Code:
    [Oxide] 5:12 PM [Error] Failed to call hook 'OnPlantGather' on plugin 'Gather Stats' (ArgumentException: failed to convert parameters)
    [Oxide] 5:12 PM [Debug]  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
      at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0 
    It seems very similar to this error which came right after the update but was quickly fixed with another update.

    Should something be fixed within oxide for OnPlantGather as OnTrapSnapped needed? Or is it my plugin that is the problem?
     
  2. Wulf

    Wulf Community Admin

    It requires a the player argument now as well, as per the update notes.
     
  3. I believe my arguments are correct

    Code:
            private void OnPlantGather(BaseEntity.RPCMessage msg, PlantEntity plantentity, Item item)
            {
                try
                {
                    GatherItem(item.info.itemid, item.amount, msg.player.net.connection.userid);
                }
                catch
                {
                    PrintError("Error handling on gather!");
                }
            }
     
  4. Wulf

    Wulf Community Admin

    OnPlantGather(PlantEntity entity, Item item, BasePlayer player)
     
  5. Thx wolf your the man!
    rtf when I put in my github pull request for this I added the RPCmsg at the end ;)
    When I decompile I still see the hook arguments set up as "msg, this, item" but maybe Im looking at an old version?
     
  6. Wulf

    Wulf Community Admin

    You are looking at the internal hook, before it is wrapped to get rid of RPC/msg.
    See https://github.com/OxideMod/Oxide/blob/master/Oxide.Game.Rust/RustCore.cs#L1006.
     
  7. I see now! Thank you!!! :) :) :)