From c1f0e2cdc7d411b2ca00df58c4976287cb084428 Mon Sep 17 00:00:00 2001 From: Pontus Ullgren Date: Thu, 8 Aug 2024 17:54:04 +0200 Subject: [PATCH] Update AutoFuel to work with Ashlands release --- AutoFuel/BepInExPlugin.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) mode change 100644 => 100755 AutoFuel/BepInExPlugin.cs diff --git a/AutoFuel/BepInExPlugin.cs b/AutoFuel/BepInExPlugin.cs old mode 100644 new mode 100755 index f385797..a8a6189 --- a/AutoFuel/BepInExPlugin.cs +++ b/AutoFuel/BepInExPlugin.cs @@ -200,7 +200,7 @@ public static async void RefuelTorch(Fireplace fireplace, ZNetView znview, int d Destroy(item.gameObject); else ZNetScene.instance.Destroy(item.gameObject); - znview.InvokeRPC("AddFuel", new object[] { }); + znview.InvokeRPC("RPC_AddFuel", new object[] { }); if (distributedFilling.Value) return; break; @@ -208,7 +208,7 @@ public static async void RefuelTorch(Fireplace fireplace, ZNetView znview, int d } item.m_itemData.m_stack--; - znview.InvokeRPC("AddFuel", new object[] { }); + znview.InvokeRPC("RPC_AddFuel", new object[] { }); Traverse.Create(item).Method("Save").GetValue(); if (distributedFilling.Value) return; @@ -236,7 +236,7 @@ public static async void RefuelTorch(Fireplace fireplace, ZNetView znview, int d Dbgl($"container at {c.transform.position} has {fuelItem.m_stack} {fuelItem.m_dropPrefab.name}, taking one"); - znview.InvokeRPC("AddFuel", new object[] { }); + znview.InvokeRPC("RPC_AddFuel", new object[] { }); c.GetInventory().RemoveItem(fireplace.m_fuelItem.m_itemData.m_shared.m_name, 1); typeof(Container).GetMethod("Save", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(c, new object[] { }); @@ -351,14 +351,14 @@ public static async void RefuelSmelter(Smelter __instance, ZNetView ___m_nview, Destroy(item.gameObject); else ZNetScene.instance.Destroy(item.gameObject); - ___m_nview.InvokeRPC("AddOre", new object[] { name }); + ___m_nview.InvokeRPC("RPC_AddOre", new object[] { name }); if (distributedFilling.Value) ored = true; break; } item.m_itemData.m_stack--; - ___m_nview.InvokeRPC("AddOre", new object[] { name }); + ___m_nview.InvokeRPC("RPC_AddOre", new object[] { name }); Traverse.Create(item).Method("Save").GetValue(); if (distributedFilling.Value) ored = true; @@ -388,7 +388,7 @@ public static async void RefuelSmelter(Smelter __instance, ZNetView ___m_nview, Destroy(item.gameObject); else ZNetScene.instance.Destroy(item.gameObject); - ___m_nview.InvokeRPC("AddFuel", new object[] { }); + ___m_nview.InvokeRPC("RPC_AddFuel", new object[] { }); if (distributedFilling.Value) fueled = true; break; @@ -396,7 +396,7 @@ public static async void RefuelSmelter(Smelter __instance, ZNetView ___m_nview, } item.m_itemData.m_stack--; - ___m_nview.InvokeRPC("AddFuel", new object[] { }); + ___m_nview.InvokeRPC("RPC_AddFuel", new object[] { }); Traverse.Create(item).Method("Save").GetValue(); if (distributedFilling.Value) { @@ -427,7 +427,7 @@ public static async void RefuelSmelter(Smelter __instance, ZNetView ___m_nview, Dbgl($"container at {c.transform.position} has {oreItem.m_stack} {oreItem.m_dropPrefab.name}, taking one"); - ___m_nview.InvokeRPC("AddOre", new object[] { oreItem.m_dropPrefab?.name }); + ___m_nview.InvokeRPC("RPC_AddOre", new object[] { oreItem.m_dropPrefab?.name }); c.GetInventory().RemoveItem(itemConversion.m_from.m_itemData.m_shared.m_name, 1); typeof(Container).GetMethod("Save", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(c, new object[] { }); typeof(Inventory).GetMethod("Changed", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(c.GetInventory(), new object[] { }); @@ -461,7 +461,7 @@ public static async void RefuelSmelter(Smelter __instance, ZNetView ___m_nview, Dbgl($"container at {c.transform.position} has {fuelItem.m_stack} {fuelItem.m_dropPrefab.name}, taking one"); - ___m_nview.InvokeRPC("AddFuel", new object[] { }); + ___m_nview.InvokeRPC("RPC_AddFuel", new object[] { }); c.GetInventory().RemoveItem(__instance.m_fuelItem.m_itemData.m_shared.m_name, 1); typeof(Container).GetMethod("Save", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(c, new object[] { });