C#:
using HarmonyLib;
using System.Collections.Generic;
namespace Oxide.Plugins;
[Info("FFastSmelt", "fufeldev", "1.0.0")]
public class FFastSmelt : RustPlugin
{
Harmony h;
void Init() { h = new Harmony(Name); h.PatchAll(); }
void Unload() => h?.UnpatchAll(Name);
[HarmonyPatch(typeof(BaseOven), nameof(BaseOven.Cook))]
class P
{
static readonly Dictionary<BaseOven, float> c = new Dictionary<BaseOven, float>();
static void Prefix(BaseOven __instance) { if (__instance.ShortPrefabName.Contains("furnace")) __instance.smeltSpeed = 1; }
static void Postfix(BaseOven __instance, float deltaTime)
{
if (!__instance.ShortPrefabName.Contains("furnace")) return;
var f = __instance.FindBurnable();
var b = f?.info?.ItemModBurnable;
if (b != null) f.UseItem(100);
if (b?.byproductItem != null)
{
c.TryGetValue(__instance, out var a);
a += 250f;
var n = (int)a;
if (n > 0) { ItemManager.Create(b.byproductItem, n).MoveToContainer(__instance.inventory); a -= n; }
c[__instance] = a;
}
__instance.IncreaseCookTime(deltaTime * 14999f);
}
}
}