Skip to content

Commit

Permalink
Update RPC name changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Grantapher committed Apr 24, 2024
1 parent e5a1317 commit e507e78
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ValheimPlus/GameClasses/Fermenter.cs
Expand Up @@ -163,7 +163,7 @@ private static void InvokeRPCTap(Fermenter __instance)
{
if (!Configuration.Current.Fermenter.autoDeposit) return;

__instance.m_nview.InvokeRPC("Tap", new object[] { });
__instance.m_nview.InvokeRPC("RPC_Tap", new object[] { });
}

private static void AddItemFromNearbyChests(Fermenter __instance)
Expand All @@ -181,7 +181,7 @@ private static void AddItemFromNearbyChests(Fermenter __instance)
{
if (InventoryAssistant.RemoveItemFromChest(c, item) == 0) continue;

__instance.m_nview.InvokeRPC("AddItem", new object[] { item.m_dropPrefab.name });
__instance.m_nview.InvokeRPC("RPC_AddItem", new object[] { item.m_dropPrefab.name });
ValheimPlusPlugin.Logger.LogInfo("Added " + item.m_shared.m_name + " to " + __instance.m_name);
break;
}
Expand Down
5 changes: 1 addition & 4 deletions ValheimPlus/GameClasses/Fireplace.cs
Expand Up @@ -105,10 +105,7 @@ private static void AddFuelFromNearbyChests(Fireplace __instance)
ItemDrop.ItemData fuelItemData = __instance.m_fuelItem.m_itemData;

int addedFuel = InventoryAssistant.RemoveItemInAmountFromAllNearbyChests(__instance.gameObject, Helper.Clamp(Configuration.Current.FireSource.autoRange, 1, 50), fuelItemData, toMaxFuel, !Configuration.Current.FireSource.ignorePrivateAreaCheck);
for (int i = 0; i < addedFuel; i++)
{
__instance.m_nview.InvokeRPC("AddFuel", new object[] { });
}
__instance.m_nview.InvokeRPC("RPC_AddFuelAmount", new object[] { (float) addedFuel });
if (addedFuel > 0)
ValheimPlusPlugin.Logger.LogInfo("Added " + addedFuel + " fuel(" + fuelItemData.m_shared.m_name + ") in " + __instance.m_name);
}
Expand Down
4 changes: 2 additions & 2 deletions ValheimPlus/GameClasses/Smelter.cs
Expand Up @@ -232,7 +232,7 @@ static void Prefix(Smelter __instance)
int addedFuel = InventoryAssistant.RemoveItemInAmountFromAllNearbyChests(smelter.gameObject, autoFuelRange, fuelItemData, toMaxFuel, !ignorePrivateAreaCheck);
for (int i = 0; i < addedFuel; i++)
{
smelter.m_nview.InvokeRPC("AddFuel", new object[] { });
smelter.m_nview.InvokeRPC("RPC_AddFuel", new object[] { });
}
if (addedFuel > 0)
ValheimPlusPlugin.Logger.LogInfo("Added " + addedFuel + " fuel(" + fuelItemData.m_shared.m_name + ") in " + smelter.m_name);
Expand Down Expand Up @@ -261,7 +261,7 @@ static void Prefix(Smelter __instance)

for (int i = 0; i < addedOres; i++)
{
smelter.m_nview.InvokeRPC("AddOre", new object[] { orePrefab.name });
smelter.m_nview.InvokeRPC("RPC_AddOre", new object[] { orePrefab.name });
}
toMaxOre -= addedOres;
if (addedOres > 0)
Expand Down

0 comments on commit e507e78

Please sign in to comment.