コード例 #1
0
ファイル: Plugin.cs プロジェクト: severd8/Valheim
        private void ContainerRecyclingTriggered()
        {
            var player    = Player.m_localPlayer;
            var container = (Container)AccessTools.Field(typeof(InventoryGui), "m_currentContainer")
                            .GetValue(InventoryGui.instance);

            if (container == null)
            {
                return;
            }
            Log.LogDebug($"Player {player.GetPlayerName()} triggered recycling");
            Recycler.RecycleInventoryForAllRecipes(container.GetInventory(), player);
        }