Plugin for composter Rate and stack size

how to create a plugin to increase composter rate and stack size for farming community of rust  

If there is any idea how to amend composter rate in server config i welcome you all ideas .

any feedback will be apprecaited thank you .

Glancing at the game code, I notice a few things.

  • There appears to be a cvar called server.composterupdateinterval which you could decrease to make the composter run more frequently. That means the server is doing more work, so this could affect performance if you set it really low and have lots of composters.
  • The ItemModCompostable component of the ItemDefinition class (some items will have this mod) has a TotalFertilizerProduced field which you could update with a plugin to increase the output.
  • The Composter class has a boolean CompostEntireStack field which you could set to true to compost an entire stack of items per interval instead of incrementally composting each stack.
  • You could do something where you call composter.CancelInvoke(composter.UpdateComposting) to cancel the vanilla composter logic and then invoke a different (custom) repeating function, allowing you full control.
If you are intending on releasing a plugin to the public for this, I recommend the following.

  • Reset composters to vanilla when the plugn is unloaded. For example, reset TotalFertilizerProducedCompostEntireStack and reinvoke the UpdateComposting method on unload.
  • Allow the adjustments to only apply to specific composters placed by players with permission (composter.OwnerID).
  • Implement hooks to allow other plugins to block the adjustments on specific composters.
  • Consider implementing a new hook for when the composter update interval processes an item. Guide on the subject here: https://umod.org/guides/development/contributing-hooks

Thank you for you feedback it mean much to me .I will use you advise .

WhiteThunder - where can I get the Class information for the Composter (like you shared above). All of the sites I can find don't have the Composter, yet. I used Reflection to get Properties and Methods, and none of the ones you mentioned (except CancelInvoke) were on there.

Speaking of which, do you know (and can tell me how to find out) what the System.Action's are for the Invoke methods?

Thank you!

You can see all that info in the assemblies that come with the Rust server. Just open them in a decompiler. The main one is Assembly-CSharp.dll.

Thank you! Do you have a decompiler you'd recommend?